From: Dimitri Sivanich <sivanich@sgi.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] page_alloc: Oops when setting percpu_pagelist_fraction
Date: Tue, 16 Jun 2009 09:57:06 -0500 [thread overview]
Message-ID: <20090616145706.GB14680@sgi.com> (raw)
After downing/upping a cpu, an attempt to set
/proc/sys/vm/percpu_pagelist_fraction results in an oops in
percpu_pagelist_fraction_sysctl_handler().
To reproduce this:
localhost:/sys/devices/system/cpu/cpu6 # echo 0 >online
localhost:/sys/devices/system/cpu/cpu6 # echo 1 >online
localhost:/sys/devices/system/cpu/cpu6 # cd /proc/sys/vm
localhost:/proc/sys/vm # echo 100000 >percpu_pagelist_fraction
BUG: unable to handle kernel NULL pointer dereference at 0000000000000004
IP: [<ffffffff80286946>] percpu_pagelist_fraction_sysctl_handler+0x4a/0x96
This is because the zone->pageset[cpu] value has not been set when the
cpu has been brought back up for unpopulated zones (the "Movable" zone
in the case I'm running into). Prior to downing/upping the cpu it had
been set to &boot_pageset[cpu].
There are two possible fixes that come to mind. One is to check for an
unpopulated zone or NULL zone pageset for that cpu in
percpu_pagelist_fraction_sysctl_handler(), and simply not set a pagelist
highmark for that zone/cpu combination.
The other, and the one I'm proposing here, is to set the zone's pageset
back to the boot_pageset when the cpu is brought back up if the zone is
unpopulated.
Signed-off-by: Dimitri Sivanich <sivanich@sgi.com>
---
mm/page_alloc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Index: linux/mm/page_alloc.c
===================================================================
--- linux.orig/mm/page_alloc.c 2009-06-16 09:25:25.000000000 -0500
+++ linux/mm/page_alloc.c 2009-06-16 09:27:47.000000000 -0500
@@ -2806,7 +2806,11 @@ static int __cpuinit process_zones(int c
node_set_state(node, N_CPU); /* this node has a cpu */
- for_each_populated_zone(zone) {
+ for_each_zone(zone) {
+ if (!populated_zone(zone)) {
+ zone_pcp(zone, cpu) = &boot_pageset[cpu];
+ continue;
+ }
zone_pcp(zone, cpu) = kmalloc_node(sizeof(struct per_cpu_pageset),
GFP_KERNEL, node);
if (!zone_pcp(zone, cpu))
reply other threads:[~2009-06-16 14:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20090616145706.GB14680@sgi.com \
--to=sivanich@sgi.com \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox