Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754985AbaG3DKY (ORCPT ); Tue, 29 Jul 2014 23:10:24 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:49598 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1754698AbaG3DKX (ORCPT ); Tue, 29 Jul 2014 23:10:23 -0400 X-IronPort-AV: E=Sophos;i="5.00,992,1396972800"; d="scan'208";a="33941400" Message-ID: <53D8626E.5060900@cn.fujitsu.com> Date: Wed, 30 Jul 2014 11:11:42 +0800 From: Lai Jiangshan User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100921 Fedora/3.1.4-1.fc14 Thunderbird/3.1.4 MIME-Version: 1.0 To: Christoph Lameter CC: Tejun Heo , Peter Zijlstra , Sasha Levin , , Gilad Ben-Yossef , Thomas Gleixner , John Stultz , Mike Frysinger , Minchan Kim , Hakan Akkan , Max Krasnyansky , Frederic Weisbecker , "Paul E. McKenney" , , , , , , Subject: Re: vmstat: On demand vmstat workers V8 References: <53D31101.8000107@oracle.com> <20140729075637.GA19379@twins.programming.kicks-ass.net> <20140729120525.GA28366@mtj.dyndns.org> <20140729122303.GA3935@laptop> <20140729131226.GS7462@htj.dyndns.org> <20140729151415.GF4791@htj.dyndns.org> In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.167.226.103] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/29/2014 11:39 PM, Christoph Lameter wrote: > On Tue, 29 Jul 2014, Tejun Heo wrote: > >> Hmmm, well, then it's something else. Either a bug in workqueue or in >> the caller. Given the track record, the latter is more likely. >> e.g. it looks kinda suspicious that the work func is cleared after >> cancel_delayed_work_sync() is called. What happens if somebody tries >> to schedule it inbetween? > > Here is yet another patch to also address this idea: > > Subject: vmstat: Clear the work.func before cancelling delayed work > > Looks strange to me but Tejun thinks this could do some good. > If this really is the right thing to do then cancel_delayed_work should > zap the work func itselt I think. > > Signed-off-by: Christoph Lameter > > > Index: linux/mm/vmstat.c > =================================================================== > --- linux.orig/mm/vmstat.c 2014-07-29 10:22:45.073884943 -0500 > +++ linux/mm/vmstat.c 2014-07-29 10:34:45.083369228 -0500 > @@ -1277,8 +1277,8 @@ static int vmstat_cpuup_callback(struct > break; > case CPU_DOWN_PREPARE: > case CPU_DOWN_PREPARE_FROZEN: > - cancel_delayed_work_sync(&per_cpu(vmstat_work, cpu)); > per_cpu(vmstat_work, cpu).work.func = NULL; > + cancel_delayed_work_sync(&per_cpu(vmstat_work, cpu)); I think we should just remove "per_cpu(vmstat_work, cpu).work.func = NULL;" > break; > case CPU_DOWN_FAILED: > case CPU_DOWN_FAILED_FROZEN: > . > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/