Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 625
b: refs/heads/master
c: 8e30f27
h: refs/heads/master
i:
  623: 4506dff
v: v3
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed May 1, 2005
1 parent 6143c44 commit 73de519
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 81b4082dc7666e2bc5ec229d8e837f3bafb96883
refs/heads/master: 8e30f272a93ec9c1d5c305c5040dfaebc880499d
12 changes: 12 additions & 0 deletions trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1671,6 +1671,18 @@ static void __init free_area_init_core(struct pglist_data *pgdat,
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;

for (cpu = 0; cpu < NR_CPUS; cpu++) {
struct per_cpu_pages *pcp;

Expand Down

0 comments on commit 73de519

Please sign in to comment.