Return-path: Received: from mail-pb0-f46.google.com ([209.85.160.46]:42949 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752027Ab2LAOjb (ORCPT ); Sat, 1 Dec 2012 09:39:31 -0500 Date: Sat, 1 Dec 2012 06:39:26 -0800 From: Tejun Heo To: Anders Kaseorg Cc: Herbert Xu , "John W. Linville" , netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Wireless regression in workqueue: use mod_delayed_work() instead of __cancel + queue Message-ID: <20121201143926.GB2685@htj.dyndns.org> (sfid-20121201_153950_109226_1EF86E47) References: <20121130211435.GJ3873@htj.dyndns.org> <20121130225619.GD6021@htj.dyndns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: Sender: linux-wireless-owner@vger.kernel.org List-ID: Hey, Anders. On Fri, Nov 30, 2012 at 11:15:50PM -0500, Anders Kaseorg wrote: > Yes. I tested that both directly on top of the bad commit, and on > v3.7-rc7, and it fixes the bug in both cases. Can you please test this one too? Thanks! diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 042d221..94964d1 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1364,6 +1364,11 @@ static void __queue_delayed_work(int cpu, struct workqueue_struct *wq, BUG_ON(timer_pending(timer)); BUG_ON(!list_empty(&work->entry)); + if (!delay) { + __queue_work(cpu, wq, &dwork->work); + return; + } + timer_stats_timer_set_start_info(&dwork->timer); /* @@ -1417,9 +1422,6 @@ bool queue_delayed_work_on(int cpu, struct workqueue_struct *wq, bool ret = false; unsigned long flags; - if (!delay) - return queue_work_on(cpu, wq, &dwork->work); - /* read the comment in __queue_work() */ local_irq_save(flags);