lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 14 Mar 2012 08:52:17 +0200
From:	Gilad Ben-Yossef <gilad@...yossef.com>
To:	linux-kernel@...r.kernel.org
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Mel Gorman <mel@....ul.ie>, Christoph Lameter <cl@...ux.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	Andi Kleen <ak@...ux.intel.com>, Linux-MM <linux-mm@...ck.org>
Subject: [PATCH] mm: fix vmstat_update to keep scheduling itself on all cores

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@...yossef.com>
CC: Andrew Morton <akpm@...ux-foundation.org>
CC: Mel Gorman <mel@....ul.ie>
CC: Christoph Lameter <cl@...ux.com>
CC: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
CC: Andi Kleen <ak@...ux.intel.com>
CC: linux-mm@...ck.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@...yossef.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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ