From: Andrew Morton <akpm@linux-foundation.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
linux-mm@kvack.org, Pekka Enberg <penberg@cs.helsinki.fi>,
Christoph Lameter <cl@linux-foundation.org>
Subject: Re: mm: Do not iterate over NR_CPUS in __zone_pcp_update()
Date: Tue, 9 Mar 2010 12:22:53 -0800 [thread overview]
Message-ID: <20100309122253.3f3d4a53.akpm@linux-foundation.org> (raw)
In-Reply-To: <alpine.LFD.2.00.1003081018070.22855@localhost.localdomain>
On Mon, 8 Mar 2010 10:21:04 +0100 (CET)
Thomas Gleixner <tglx@linutronix.de> wrote:
> __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;
>
I'm having trouble working out whether we want to backport this into
2.6.33.x or earlier. Help?
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
linux-mm@kvack.org, Pekka Enberg <penberg@cs.helsinki.fi>,
Christoph Lameter <cl@linux-foundation.org>
Subject: Re: mm: Do not iterate over NR_CPUS in __zone_pcp_update()
Date: Tue, 9 Mar 2010 12:22:53 -0800 [thread overview]
Message-ID: <20100309122253.3f3d4a53.akpm@linux-foundation.org> (raw)
In-Reply-To: <alpine.LFD.2.00.1003081018070.22855@localhost.localdomain>
On Mon, 8 Mar 2010 10:21:04 +0100 (CET)
Thomas Gleixner <tglx@linutronix.de> wrote:
> __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;
>
I'm having trouble working out whether we want to backport this into
2.6.33.x or earlier. Help?
--
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>
next prev parent reply other threads:[~2010-03-09 20:23 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100309122253.3f3d4a53.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=cl@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=penberg@cs.helsinki.fi \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.