All of lore.kernel.org
 help / color / mirror / Atom feed
* mm: Do not iterate over NR_CPUS in __zone_pcp_update()
@ 2010-03-08  9:21 ` Thomas Gleixner
  0 siblings, 0 replies; 28+ messages in thread
From: Thomas Gleixner @ 2010-03-08  9:21 UTC (permalink / raw)
  To: LKML; +Cc: linux-mm, Pekka Enberg, Christoph Lameter

__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.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 mm/page_alloc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/mm/page_alloc.c
===================================================================
--- linux-2.6.orig/mm/page_alloc.c
+++ linux-2.6/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;
 

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2010-03-09 21:04 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-08  9:21 mm: Do not iterate over NR_CPUS in __zone_pcp_update() Thomas Gleixner
2010-03-08  9:21 ` Thomas Gleixner
2010-03-08 13:29 ` Pekka Enberg
2010-03-08 13:29   ` Pekka Enberg
2010-03-09  2:06   ` Tejun Heo
2010-03-09  2:06     ` Tejun Heo
2010-03-09 15:10     ` Christoph Lameter
2010-03-09 15:10       ` Christoph Lameter
2010-03-09 20:04       ` Pekka Enberg
2010-03-09 20:04         ` Pekka Enberg
2010-03-09 20:19         ` Andrew Morton
2010-03-09 20:19           ` Andrew Morton
2010-03-08 15:59 ` Christoph Lameter
2010-03-08 15:59   ` Christoph Lameter
2010-03-08 16:09 ` Mel Gorman
2010-03-08 16:09   ` Mel Gorman
2010-03-09  6:34 ` KOSAKI Motohiro
2010-03-09  6:34   ` KOSAKI Motohiro
2010-03-09 20:22 ` Andrew Morton
2010-03-09 20:22   ` Andrew Morton
2010-03-09 20:33   ` Christoph Lameter
2010-03-09 20:33     ` Christoph Lameter
2010-03-09 20:33   ` Robert P. J. Day
2010-03-09 20:33     ` Robert P. J. Day
2010-03-09 20:55     ` Christoph Lameter
2010-03-09 20:55       ` Christoph Lameter
2010-03-09 21:02       ` Robert P. J. Day
2010-03-09 21:02         ` Robert P. J. Day

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.