From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753636Ab2G2U52 (ORCPT ); Sun, 29 Jul 2012 16:57:28 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:57317 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753536Ab2G2U50 (ORCPT ); Sun, 29 Jul 2012 16:57:26 -0400 Date: Sun, 29 Jul 2012 13:55:16 -0700 From: Anton Vorontsov To: Tejun Heo Cc: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, padovan@profusion.mobi, marcel@holtmann.org, peterz@infradead.org, mingo@redhat.com, davem@davemloft.net, dougthompson@xmission.com, ibm-acpi@hmh.eng.br, rui.zhang@intel.com, Jens Axboe , Jiri Kosina , David Airlie , Roland Dreier , Dmitry Torokhov , "John W. Linville" , Len Brown , David Howells , "J. Bruce Fields" , Johannes Berg Subject: Re: [PATCH 14/15] workqueue: use mod_delayed_work() instead of cancel + queue Message-ID: <20120729205516.GA14801@lizard> References: <1343433308-26614-1-git-send-email-tj@kernel.org> <1343433308-26614-15-git-send-email-tj@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1343433308-26614-15-git-send-email-tj@kernel.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 27, 2012 at 04:55:07PM -0700, Tejun Heo wrote: > Convert delayed_work users doing [__]cancel_delayed_work() + > queue_delayed_work() to mod_delayed_work(). > > Most conversions are straight-forward. Ones worth mentioning are, > > * drivers/edac/edac_mc.c: edac_mc_workq_setup() converted to always > use mod_delayed_work() and cancel loop in > edac_mc_reset_delay_period() is dropped. > > * drivers/platform/x86/thinkpad_acpi.c: No need to remember whether > watchdog is active or not. @fan_watchdog_active and related code > dropped. > > * drivers/power/charger-manager.c: Seemingly a lot of > delayed_work_pending() abuse going on here. > [delayed_]work_pending() are unsynchronized and racy when used like > this. I converted one instance in fullbatt_handler(). Please > conver the rest so that it invokes workqueue APIs for the intended > target state rather than trying to game work item pending state > transitions. e.g. if timer should be modified - call > mod_delayed_work(), canceled - call cancel_delayed_work[_sync](). > > * drivers/thermal/thermal_sys.c: thermal_zone_device_set_polling() > simplified. Note that round_jiffies() calls in this function are > meaningless. round_jiffies() work on absolute jiffies not delta > delay used by delayed_work. > > * net/core/link_watch.c: linkwatch_schedule_work() was doing a quite > elaborate dancing around its delayed_work. Collapse it such that > linkwatch_work is queued for immediate execution if LW_URGENT and > existing timer is kept otherwise. > > Signed-off-by: Tejun Heo drivers/power/ bits: Acked-by: Anton Vorontsov Thanks! -- Anton Vorontsov Email: cbouatmailru@gmail.com