diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-05-12 11:57:09 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-05-12 11:57:09 +0200 |
commit | ddc4097b77bbb227851a44287acb2fb8a9896cc1 (patch) | |
tree | 319d098879bed7c45543d983de8becd509701b22 /mm/page_alloc.c | |
parent | bec4c99e8637b5b8bd4b0513eacb51da25885e3b (diff) | |
parent | ae31c1fbdbb18d917b0a1139497c2dbd35886989 (diff) |
Merge branch 'topic/drvdata-fix' into topic/asoc
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index e2f26991fff..fe753ecf2aa 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2681,6 +2681,7 @@ static void __meminit zone_init_free_lists(struct zone *zone) static int zone_batchsize(struct zone *zone) { +#ifdef CONFIG_MMU int batch; /* @@ -2706,9 +2707,26 @@ 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; + +#else + /* The deferral and batching of frees should be suppressed under NOMMU + * conditions. + * + * The problem is that NOMMU needs to be able to allocate large chunks + * of contiguous memory as there's no hardware page translation to + * assemble apparent contiguous memory from discontiguous pages. + * + * Queueing large contiguous runs of pages for batching, however, + * causes the pages to actually be freed in smaller chunks. As there + * can be a significant delay between the individual batches being + * recycled, this leads to the once large chunks of space being + * fragmented and becoming unavailable for high-order allocations. + */ + return 0; +#endif } static void setup_pageset(struct per_cpu_pageset *p, unsigned long batch) |