From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: LKML <linux-kernel@vger.kernel.org>,
linux-mm <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>,
Christoph Lameter <clameter@sgi.com>
Cc: kosaki.motohiro@jp.fujitsu.com
Subject: make vmstat cpu-unplug safe
Date: Tue, 06 May 2008 16:02:09 +0900 [thread overview]
Message-ID: <20080506154938.AC6B.KOSAKI.MOTOHIRO@jp.fujitsu.com> (raw)
btw: I think all_vm_event() author is Cristoph Lameter, right?
--------------------------------------------
When access cpu_online_map, We should prevent that dynamically
change cpu_online_map by get_online_cpus().
Unfortunately, all_vm_events() doesn't it.
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: Christoph Lameter <clameter@sgi.com>
---
mm/vmstat.c | 2 ++
1 file changed, 2 insertions(+)
Index: b/mm/vmstat.c
===================================================================
--- a/mm/vmstat.c 2008-05-04 23:00:52.000000000 +0900
+++ b/mm/vmstat.c 2008-05-06 16:13:32.000000000 +0900
@@ -42,7 +42,9 @@ static void sum_vm_events(unsigned long
*/
void all_vm_events(unsigned long *ret)
{
+ get_online_cpus();
sum_vm_events(ret, &cpu_online_map);
+ put_online_cpus();
}
EXPORT_SYMBOL_GPL(all_vm_events);
--
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 reply other threads:[~2008-05-06 7:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-06 7:02 KOSAKI Motohiro [this message]
2008-05-06 17:48 ` Christoph Lameter
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=20080506154938.AC6B.KOSAKI.MOTOHIRO@jp.fujitsu.com \
--to=kosaki.motohiro@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=clameter@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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