* current_is_kswapd is a function
@ 2003-10-12 2:17 William Lee Irwin III
2003-10-12 12:02 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: William Lee Irwin III @ 2003-10-12 2:17 UTC (permalink / raw)
To: linux-kernel; +Cc: akpm
current_is_kswapd() is a function, not an integer; this explains some
anomalies in reported statistics.
===== fs/inode.c 1.107 vs edited =====
--- 1.107/fs/inode.c Sun Oct 5 01:07:55 2003
+++ edited/fs/inode.c Sat Oct 11 19:15:48 2003
@@ -453,7 +453,7 @@
dispose_list(&freeable);
up(&iprune_sem);
- if (current_is_kswapd)
+ if (current_is_kswapd())
mod_page_state(kswapd_inodesteal, reap);
else
mod_page_state(pginodesteal, reap);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: current_is_kswapd is a function
2003-10-12 2:17 current_is_kswapd is a function William Lee Irwin III
@ 2003-10-12 12:02 ` Andrew Morton
2003-10-12 12:18 ` Jamie Lokier
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2003-10-12 12:02 UTC (permalink / raw)
To: William Lee Irwin III; +Cc: linux-kernel
William Lee Irwin III <wli@holomorphy.com> wrote:
>
> - if (current_is_kswapd)
> + if (current_is_kswapd())
Well damn, I must have looked at that a hundred times when wondering why
/proc/vmstat:pginodesteal was always zero. Thanks.
It would probably be worthwhile teaching the compiler to generate a warning
in this case; I doubt if anyone is likely to want to find out at runtime
whether the linker happened to place a particular function at address zero.
I shall suggest that.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: current_is_kswapd is a function
2003-10-12 12:02 ` Andrew Morton
@ 2003-10-12 12:18 ` Jamie Lokier
0 siblings, 0 replies; 3+ messages in thread
From: Jamie Lokier @ 2003-10-12 12:18 UTC (permalink / raw)
To: Andrew Morton; +Cc: William Lee Irwin III, linux-kernel
Andrew Morton wrote:
> It would probably be worthwhile teaching the compiler to generate a warning
> in this case; I doubt if anyone is likely to want to find out at runtime
> whether the linker happened to place a particular function at address zero.
> I shall suggest that.
I agree it would be a very useful warning.
Testing the address is useful occasionally, to ask whether the target
of a weak linkage reference was linked in, so a syntax is needed to
suppress the warning, such as "&function != 0".
-- Jamie
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-10-12 12:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-12 2:17 current_is_kswapd is a function William Lee Irwin III
2003-10-12 12:02 ` Andrew Morton
2003-10-12 12:18 ` Jamie Lokier
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.