linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* mm: Do not iterate over NR_CPUS in __zone_pcp_update()
@ 2010-03-08  9:21 Thomas Gleixner
  2010-03-08 13:29 ` Pekka Enberg
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ 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;
 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

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

Thread overview: 14+ 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 13:29 ` Pekka Enberg
2010-03-09  2:06   ` Tejun Heo
2010-03-09 15:10     ` Christoph Lameter
2010-03-09 20:04       ` Pekka Enberg
2010-03-09 20:19         ` Andrew Morton
2010-03-08 15:59 ` Christoph Lameter
2010-03-08 16:09 ` Mel Gorman
2010-03-09  6:34 ` KOSAKI Motohiro
2010-03-09 20:22 ` Andrew Morton
2010-03-09 20:33   ` Christoph Lameter
2010-03-09 20:33   ` Robert P. J. Day
2010-03-09 20:55     ` Christoph Lameter
2010-03-09 21:02       ` Robert P. J. Day

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).