summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2009-05-07 01:03:02 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2009-05-07 01:36:10 +0200
commit9155203a5de94278525647b16733f0c315f3b786 (patch)
tree68d64b7cf9671c2a725f4f191b3cfb4b37e41f32 /mm
parentisl29003: fix resume functionality (diff)
downloadlinux-9155203a5de94278525647b16733f0c315f3b786.tar.xz
linux-9155203a5de94278525647b16733f0c315f3b786.zip
mm: use roundown_pow_of_two() in zone_batchsize()
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> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/page_alloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index e2f26991fff1..8add7daf98b0 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;
}