From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932528AbcBKODA (ORCPT ); Thu, 11 Feb 2016 09:03:00 -0500 Received: from mx2.suse.de ([195.135.220.15]:49863 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932344AbcBKOAc (ORCPT ); Thu, 11 Feb 2016 09:00:32 -0500 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" From: Jiri Slaby To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Linus Torvalds , Christoph Lameter , Tejun Heo , Mike Galbraith , Michal Hocko , Jiri Slaby Subject: [PATCH 3.12 57/64] vmstat: explicitly schedule per-cpu work on the CPU we need it to run on Date: Thu, 11 Feb 2016 14:59:33 +0100 Message-Id: X-Mailer: git-send-email 2.7.1 In-Reply-To: <74c0820133f1dada0d70c74bc70a9530b2697f86.1455198893.git.jslaby@suse.cz> References: <74c0820133f1dada0d70c74bc70a9530b2697f86.1455198893.git.jslaby@suse.cz> In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Linus Torvalds 3.12-stable review patch. If anyone has any objections, please let me know. =============== commit 176bed1de5bf977938cad26551969eca8f0883b1 upstream. The vmstat code uses "schedule_delayed_work_on()" to do the initial startup of the delayed work on the right CPU, but then once it was started it would use the non-cpu-specific "schedule_delayed_work()" to re-schedule it on that CPU. That just happened to schedule it on the same CPU historically (well, in almost all situations), but the code _requires_ this work to be per-cpu, and should say so explicitly rather than depend on the non-cpu-specific scheduling to schedule on the current CPU. The timer code is being changed to not be as single-minded in always running things on the calling CPU. See also commit 874bbfe600a6 ("workqueue: make sure delayed work run in local cpu") that for now maintains the local CPU guarantees just in case there are other broken users that depended on the accidental behavior. js: 3.12 backport Cc: Christoph Lameter Cc: Tejun Heo Cc: Mike Galbraith Cc: Michal Hocko Signed-off-by: Linus Torvalds Signed-off-by: Jiri Slaby --- mm/vmstat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/vmstat.c b/mm/vmstat.c index f7ca04482299..1dbd89d2fb9c 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1221,7 +1221,8 @@ int sysctl_stat_interval __read_mostly = HZ; static void vmstat_update(struct work_struct *w) { refresh_cpu_vm_stats(); - schedule_delayed_work(&__get_cpu_var(vmstat_work), + schedule_delayed_work_on(smp_processor_id(), + &__get_cpu_var(vmstat_work), round_jiffies_relative(sysctl_stat_interval)); } -- 2.7.1