Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756745AbbLQPuf (ORCPT ); Thu, 17 Dec 2015 10:50:35 -0500 Received: from mail-yk0-f178.google.com ([209.85.160.178]:35576 "EHLO mail-yk0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755866AbbLQPud (ORCPT ); Thu, 17 Dec 2015 10:50:33 -0500 Date: Thu, 17 Dec 2015 10:50:32 -0500 From: Tejun Heo To: Nikolay Borisov Cc: Mike Snitzer , "Linux-Kernel@Vger. Kernel. Org" , SiteGround Operations , Alasdair Kergon , device-mapper development Subject: Re: corruption causing crash in __queue_work Message-ID: <20151217155032.GJ4026@mtj.duckdns.org> References: <20151210152901.GR30240@mtj.duckdns.org> <566AF262.8050009@kyup.com> <20151211170805.GT30240@mtj.duckdns.org> <566E80AE.7020502@kyup.com> <20151214153147.GA14957@redhat.com> <20151214203138.GA2871@redhat.com> <56729272.2010803@kyup.com> <20151217153327.GI4026@mtj.duckdns.org> <5672D810.2010404@kyup.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5672D810.2010404@kyup.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1165 Lines: 32 Hello, Nikolay. On Thu, Dec 17, 2015 at 05:43:12PM +0200, Nikolay Borisov wrote: > Right, but my initial understanding was that when canceling the delayed > work and then issuing flush_workqueue would act the same way as if > cancel_delayed_work_sync is called wrt to this particular delayed item, no? Not necessarily. cancel_delayed_work() cancels whatever is currently pending. flush_workqueue() flushes whatever is pending and in flight at the time of invocation. Imagine the following scenario. 1. Work item is running but hasn't requeued itself yet. 2. cancel_delayed_work_sync() doesn't do anything as it's not pending. 3. flush_workqueue() starts and waits for the running instance. 4. The running instance requeues itself but this isn't included in the scope of the above flush_workqueue(). 5. flush_workqueue() returns when the work item is finished (but it's still queued). Thanks. -- tejun -- 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/