diff options
| author | Haicheng Li <[email protected]> | 2010-05-24 14:32:52 -0700 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2010-05-25 08:07:02 -0700 |
| commit | 4eaf3f64397c3db3c5785eee508270d62a9fabd9 (patch) | |
| tree | bfd986a7e974876755ea6fe0de394199c68e2e36 /tools/perf/scripts/python/syscall-counts-by-pid.py | |
| parent | 1f522509c77a5dea8dc384b735314f03908a6415 (diff) | |
mem-hotplug: fix potential race while building zonelist for new populated zone
Add global mutex zonelists_mutex to fix the possible race:
CPU0 CPU1 CPU2
(1) zone->present_pages += online_pages;
(2) build_all_zonelists();
(3) alloc_page();
(4) free_page();
(5) build_all_zonelists();
(6) __build_all_zonelists();
(7) zone->pageset = alloc_percpu();
In step (3,4), zone->pageset still points to boot_pageset, so bad
things may happen if 2+ nodes are in this state. Even if only 1 node
is accessing the boot_pageset, (3) may still consume too much memory
to fail the memory allocations in step (7).
Besides, atomic operation ensures alloc_percpu() in step (7) will never fail
since there is a new fresh memory block added in step(6).
[[email protected]: hold zonelists_mutex when build_all_zonelists]
Signed-off-by: Haicheng Li <[email protected]>
Signed-off-by: Wu Fengguang <[email protected]>
Reviewed-by: Andi Kleen <[email protected]>
Cc: Christoph Lameter <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: Tejun Heo <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/syscall-counts-by-pid.py')
0 files changed, 0 insertions, 0 deletions