From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754850Ab3ARC7p (ORCPT ); Thu, 17 Jan 2013 21:59:45 -0500 Received: from mail-gh0-f175.google.com ([209.85.160.175]:60846 "EHLO mail-gh0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753576Ab3ARC7n (ORCPT ); Thu, 17 Jan 2013 21:59:43 -0500 X-Greylist: delayed 29601 seconds by postgrey-1.27 at vger.kernel.org; Thu, 17 Jan 2013 21:59:43 EST Date: Thu, 17 Jan 2013 18:59:36 -0800 From: Tejun Heo To: Linus Torvalds Cc: Arjan van de Ven , Ming Lei , Alex Riesen , Alan Stern , Jens Axboe , USB list , Linux Kernel Mailing List , Rusty Russell Subject: Re: [PATCH 2/3] workqueue, async: implement work/async_current_func() Message-ID: <20130118025936.GJ16568@mtj.dyndns.org> References: <20130116032502.GN2668@htj.dyndns.org> <20130116164832.GP2668@htj.dyndns.org> <50F6DD4D.3070808@linux.intel.com> <20130116213032.GS2668@htj.dyndns.org> <20130118012503.GH16568@mtj.dyndns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Hello, Linus. On Thu, Jan 17, 2013 at 06:47:48PM -0800, Linus Torvalds wrote: > On Thu, Jan 17, 2013 at 5:25 PM, Tejun Heo wrote: > > Implement work/async_current_func() which query whether the current > > task is a workqueue or async worker respectively and, if so, return > > the current function being executed along with work / async item > > related information. > > So why the odd interface? The only user of it calls it with a Yeah, I was doing something else in async and arguing between that and current_is_async() and ended up keeping it as it was consistent with the workqueue counterpart. > NULL/NULL pair of arguments, and in general it's just way too complex > to be an exported function at all. I *suspect* you chose that complex > interface because you feel you may have some use for it inside of the > async code itself, but why isn't that then not totally private to > there? > > IOW, why isn't the interface just > > static struct worker *current_worker(void) > { > if (current->flags & PF_WQ_WORKER) > return kthread_data(current); > return NULL; > } I'd prefer to keep struct worker inside workqueue.c, so how about keeping the workqueue part and make async part current_is_async()? Thanks. -- tejun