__alloc_pages ()

From: Parveen Verma, Noida
Date: Mon Jun 20 2005 - 06:58:03 EST


I have found that while allocating (mostly it is done) the pages in
__alloc_pages(), after successfully allocating the page the
zone_statistics() function is called.

static void zone_statistics(struct zonelist *zonelist, struct zone *z)
The whole body of this function is enclosed b/w #ifdef ... #endif.
This function is called each time and does nothing if we don't have a NUMA
Can we put the call for this b/w #ifdef ... #endif?
Although the gcc -O3 option does not generate a function call if the
function body is nil.

The patch for the same is given below:

diff -Nru linux-
--- linux- 2005-05-27
01:06:46.000000000 -0400
+++ linux- 2005-06-20 17:07:41.000000000 -0400
@@ -851,7 +851,9 @@
return NULL;
zone_statistics(zonelist, z);
return page;

Further, I have not removed the #ifdef ... #endif from zone_statistics() as
in future some other function might call this function, but in present
kernel no one calls this.

Comments are invited..

Praveen Verma
(Hare Rama Hare Krishna)
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/