From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932096Ab2C0Wus (ORCPT ); Tue, 27 Mar 2012 18:50:48 -0400 Received: from ogre.sisk.pl ([217.79.144.158]:38674 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756491Ab2C0Wur (ORCPT ); Tue, 27 Mar 2012 18:50:47 -0400 From: "Rafael J. Wysocki" To: Tejun Heo , Stephen Boyd Subject: Re: [PATCH 2/2] firmware_class: Move request_firmware_nowait() to workqueues Date: Wed, 28 Mar 2012 00:55:06 +0200 User-Agent: KMail/1.13.6 (Linux/3.3.0+; KDE/4.6.0; x86_64; ; ) Cc: linux-kernel@vger.kernel.org, Linus Torvalds , Saravana Kannan , Kay Sievers , Greg KH , Christian Lamparter , "Srivatsa S. Bhat" , alan@lxorguk.ukuu.org.uk, Linux PM mailing list References: <201203260000.34377.rjw@sisk.pl> <201203280021.27582.rjw@sisk.pl> <20120327224837.GC22371@google.com> In-Reply-To: <20120327224837.GC22371@google.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201203280055.06624.rjw@sisk.pl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday, March 28, 2012, Tejun Heo wrote: > On Wed, Mar 28, 2012 at 12:21:27AM +0200, Rafael J. Wysocki wrote: > > On Wednesday, March 28, 2012, Tejun Heo wrote: > > > On Tue, Mar 27, 2012 at 02:28:30PM -0700, Stephen Boyd wrote: > > > > Oddly enough a work_struct was already part of the firmware_work > > > > structure but nobody was using it. Instead of creating a new > > > > kthread for each request_firmware_nowait() call just schedule the > > > > work on the long system workqueue. This should avoid some overhead > > > > in forking new threads when they're not strictly necessary. > > > > > > > > Signed-off-by: Stephen Boyd > > > > --- > > > > > > > > Is it better to use alloc_workqueue() and not put these on the system > > > > long workqueue? > > > > > > No, just use schedule_work() unless there are specific requirements > > > which can't be fulfilled that way (e.g. it's on memory allocation > > > path, may consume large amount of cpu cycles, ...) > > > > It may wait quite long. > > That shouldn't matter. system_long_wq's name is a bit misleading at > this point. The only reason it's used currently is to avoid cyclic > dependency involving flush_workqueue(), which calls for clearer > solution anyway. So, yeap, using system_wq should be fine here. Good, thanks for the explanation. Stephen, care to respin? Rafael