public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] Use roundown_pow_of_two() in zone_batchsize()
@ 2009-05-05 21:26 David Howells
  2009-05-05 21:26 ` [PATCH 2/3] NOMMU: Clamp zone_batchsize() to 0 under NOMMU conditions David Howells
  2009-05-05 21:26 ` [PATCH 3/3] NOMMU: Make the initial mmap allocation excess behaviour Kconfig configurable David Howells
  0 siblings, 2 replies; 6+ messages in thread
From: David Howells @ 2009-05-05 21:26 UTC (permalink / raw)
  To: torvalds, akpm, npiggin; +Cc: gerg, linux-kernel, David Howells

Use roundown_pow_of_two(N) in zone_batchsize() rather than (1 << (fls(N)-1))
as they are equivalent, and with the former it is easier to see what is going
on.

Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Lanttor Guo <lanttor.guo@freescale.com>
---

 mm/page_alloc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index e2f2699..8add7da 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2706,7 +2706,7 @@ static int zone_batchsize(struct zone *zone)
 	 * of pages of one half of the possible page colors
 	 * and the other with pages of the other colors.
 	 */
-	batch = (1 << (fls(batch + batch/2)-1)) - 1;
+	batch = rounddown_pow_of_two(batch + batch/2) - 1;
 
 	return batch;
 }


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-05-06 11:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-05 21:26 [PATCH 1/3] Use roundown_pow_of_two() in zone_batchsize() David Howells
2009-05-05 21:26 ` [PATCH 2/3] NOMMU: Clamp zone_batchsize() to 0 under NOMMU conditions David Howells
2009-05-05 21:26 ` [PATCH 3/3] NOMMU: Make the initial mmap allocation excess behaviour Kconfig configurable David Howells
2009-05-05 22:15   ` Andrew Morton
2009-05-06  0:09     ` Greg Ungerer
2009-05-06 11:42     ` David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox