aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gleixner <[email protected]>2010-03-10 15:20:40 -0800
committerLinus Torvalds <[email protected]>2010-03-12 15:52:28 -0800
commit2d30a1f6315b8940537e8e98882c6038fbac9ba5 (patch)
tree11936ee1bdab8b01503c3e71b2868a8139c9d00a
parent53bddb4e9f3f53df02a783751984ddeade71b085 (diff)
mm: do not iterate over NR_CPUS in __zone_pcp_update()
__zone_pcp_update() iterates over NR_CPUS instead of limiting the access to the possible cpus. This might result in access to uninitialized areas as the per cpu allocator only populates the per cpu memory for possible cpus. This problem was created as a result of the dynamic allocation of pagesets from percpu memory that went in during the merge window - commit 99dcc3e5a94ed491fbef402831d8c0bbb267f995 ("this_cpu: Page allocator conversion"). Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Pekka Enberg <[email protected]> Acked-by: Tejun Heo <[email protected]> Acked-by: Christoph Lameter <[email protected]> Acked-by: Mel Gorman <[email protected]> Reviewed-by: KOSAKI Motohiro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-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 a8182c89de59..78ce90dd671f 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3224,7 +3224,7 @@ static int __zone_pcp_update(void *data)
int cpu;
unsigned long batch = zone_batchsize(zone), flags;
- for (cpu = 0; cpu < NR_CPUS; cpu++) {
+ for_each_possible_cpu(cpu) {
struct per_cpu_pageset *pset;
struct per_cpu_pages *pcp;