clamp batch size to (2^n)-1
Subsystems (2)
PATCH 1/1 clamp batch size to (2^n)-1
Oh, this is the other thing.
I'm thinking it would be a good idea to get this into -mm ASAP, even before you guys have fully tested it. Just to get the wheels in motion early.
Yeah? Or did you have something else in mind?
(It is actually against the previous patchset, but obviously that won't be merged before this patch).
Signature · 1 line
SUSE Labs, Novell Inc.
mm/page_alloc.c +12 -0
@@ -1623,6 +1623,18 @@ void __init build_percpu_pagelists(void)if (batch <1 ) batch =1 ; +/* +* Clamp the batch to a 2^n - 1 value. Having a power +* of 2 value was found to be more likely to have +* suboptimal cache aliasing properties in some cases. +* +* For example if 2 tasks are alternately allocating +* batches of pages, one task can end up with a lot +* 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 ; +init_percpu_pageset (&zone->pageset, batch);for (cpu =0 ; cpu <NR_CPUS ; cpu++) {struct zone_pagesets *zp;