Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758538AbZLNWCz (ORCPT ); Mon, 14 Dec 2009 17:02:55 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758495AbZLNWCx (ORCPT ); Mon, 14 Dec 2009 17:02:53 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:46291 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1758467AbZLNWCw (ORCPT ); Mon, 14 Dec 2009 17:02:52 -0500 Date: Mon, 14 Dec 2009 17:02:51 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Oliver Neukum cc: Tejun Heo , Kernel development list Subject: Re: Warn people about flush_scheduled_work() In-Reply-To: <200912142242.06633.oliver@neukum.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 910 Lines: 23 On Mon, 14 Dec 2009, Oliver Neukum wrote: > Am Montag, 14. Dezember 2009 22:33:38 schrieb Alan Stern: > > Consider using cancel_work_sync() or cancel_delayed_work_sync() > > instead. In most situations they will accomplish what you > > need. > > In which respect is cancel_work_sync() fundamentally safer? > If the work is already running and takes a lock you are holding, > then what? With cancel_work_sync() you _know_ what locks the work item is going to take, since it's your work item. With flush_scheduled_work() you have no idea what locks will be needed by the items on the queue. They could come from anywhere. Alan Stern -- 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/