From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753678AbcBBHx2 (ORCPT ); Tue, 2 Feb 2016 02:53:28 -0500 Received: from mx2.suse.de ([195.135.220.15]:52527 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751360AbcBBHx0 (ORCPT ); Tue, 2 Feb 2016 02:53:26 -0500 Message-ID: <1454399605.11183.8.camel@suse.de> Subject: [PATCH 3/2] mm, vmstat: cancel pending work of the cpu_stat_off CPU From: Mike Galbraith To: Michal Hocko , Andrew Morton Cc: Cristopher Lameter , Mike Galbraith , linux-mm@kvack.org, LKML , Michal Hocko Date: Tue, 02 Feb 2016 08:53:25 +0100 In-Reply-To: <1454001466-27398-2-git-send-email-mhocko@kernel.org> References: <1454001466-27398-1-git-send-email-mhocko@kernel.org> <1454001466-27398-2-git-send-email-mhocko@kernel.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.16.5 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Cancel pending work of the cpu_stat_off CPU. Signed-off-by: Mike Galbraith --- mm/vmstat.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1486,25 +1486,25 @@ static void vmstat_shepherd(struct work_ get_online_cpus(); /* Check processors whose vmstat worker threads have been disabled */ - for_each_cpu(cpu, cpu_stat_off) + for_each_cpu(cpu, cpu_stat_off) { + struct delayed_work *dw = &per_cpu(vmstat_work, cpu); + if (need_update(cpu)) { if (cpumask_test_and_clear_cpu(cpu, cpu_stat_off)) - queue_delayed_work_on(cpu, vmstat_wq, - &per_cpu(vmstat_work, cpu), 0); + queue_delayed_work_on(cpu, vmstat_wq, dw, 0); } else { /* * Cancel the work if quiet_vmstat has put this * cpu on cpu_stat_off because the work item might * be still scheduled */ - cancel_delayed_work(this_cpu_ptr(&vmstat_work)); + cancel_delayed_work(dw); } - + } put_online_cpus(); schedule_delayed_work(&shepherd, round_jiffies_relative(sysctl_stat_interval)); - } static void __init start_shepherd_timer(void)