From: Gilad Ben-Yossef <gilad@benyossef.com>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
Mel Gorman <mel@csn.ul.ie>, Christoph Lameter <cl@linux.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Andi Kleen <ak@linux.intel.com>, Linux-MM <linux-mm@kvack.org>
Subject: [PATCH] mm: fix vmstat_update to keep scheduling itself on all cores
Date: Wed, 14 Mar 2012 08:52:17 +0200 [thread overview]
Message-ID: <CAOtvUMdVrjUHLx2jZ2xbpBoDBMCX8sdCASEkmXCtBrU-gQ3EhQ@mail.gmail.com> (raw)
We set up per-cpu work structures for vmstat and schedule them on
each cpu when they go online only to re-schedule them on the general
work queue when they first run.
This doesn't seem right - how do we ever guarantee that vmstat_update runs
on all cpus? Either I've missed something or our vm stats are off and per-cpu
pages are not drained as frequently as we think they are.
Fix it by re-scheduling the work item on the same cpu it first ran on.
Tested on x86 on 8 way SMP VM.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Mel Gorman <mel@csn.ul.ie>
CC: Christoph Lameter <cl@linux.com>
CC: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
CC: Andi Kleen <ak@linux.intel.com>
CC: linux-mm@kvack.org
---
diff --git a/mm/vmstat.c b/mm/vmstat.c
index f600557..b396044 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -1144,8 +1144,10 @@ int sysctl_stat_interval __read_mostly = HZ;
static void vmstat_update(struct work_struct *w)
{
- refresh_cpu_vm_stats(smp_processor_id());
- schedule_delayed_work(&__get_cpu_var(vmstat_work),
+ int cpu = smp_processor_id();
+
+ refresh_cpu_vm_stats(cpu);
+ schedule_delayed_work_on(cpu, &__get_cpu_var(vmstat_work),
round_jiffies_relative(sysctl_stat_interval));
}
--
Gilad Ben-Yossef
Chief Coffee Drinker
gilad@benyossef.com
Israel Cell: +972-52-8260388
US Cell: +1-973-8260388
http://benyossef.com
"If you take a class in large-scale robotics, can you end up in a
situation where the homework eats your dog?"
-- Jean-Baptiste Queru
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next reply other threads:[~2012-03-14 6:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-14 6:52 Gilad Ben-Yossef [this message]
2012-03-14 14:09 ` Christoph Lameter
2012-03-14 14:51 ` Gilad Ben-Yossef
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=CAOtvUMdVrjUHLx2jZ2xbpBoDBMCX8sdCASEkmXCtBrU-gQ3EhQ@mail.gmail.com \
--to=gilad@benyossef.com \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
/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