From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S940431AbdEXPL6 (ORCPT ); Wed, 24 May 2017 11:11:58 -0400 Received: from mail-yw0-f193.google.com ([209.85.161.193]:35975 "EHLO mail-yw0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759269AbdEXPL5 (ORCPT ); Wed, 24 May 2017 11:11:57 -0400 Date: Wed, 24 May 2017 11:11:54 -0400 From: Tejun Heo To: Alex Naidis Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] workqueue: Implement delayed_work_busy() Message-ID: <20170524151154.GD24798@htj.duckdns.org> References: <1495582493-10069-1-git-send-email-alex.naidis@linux.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1495582493-10069-1-git-send-email-alex.naidis@linux.com> User-Agent: Mutt/1.8.2 (2017-04-18) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Wed, May 24, 2017 at 01:34:53AM +0200, Alex Naidis wrote: > This implements a variant of work_busy() for > delayed work. > > CC: linux-kernel@vger.kernel.org > Signed-off-by: Alex Naidis > --- > include/linux/workqueue.h | 1 + > kernel/workqueue.c | 9 +++++++++ > 2 files changed, 10 insertions(+) > > diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h > index c102ef6..32ab046 100644 > --- a/include/linux/workqueue.h > +++ b/include/linux/workqueue.h > @@ -467,6 +467,7 @@ extern void workqueue_set_max_active(struct workqueue_struct *wq, > extern bool current_is_workqueue_rescuer(void); > extern bool workqueue_congested(int cpu, struct workqueue_struct *wq); > extern unsigned int work_busy(struct work_struct *work); > +extern unsigned int delayed_work_busy(struct delayed_work *dwork); > extern __printf(1, 2) void set_worker_desc(const char *fmt, ...); > extern void print_worker_info(const char *log_lvl, struct task_struct *task); > extern void show_workqueue_state(void); > diff --git a/kernel/workqueue.c b/kernel/workqueue.c > index c74bf39..658cc2e 100644 > --- a/kernel/workqueue.c > +++ b/kernel/workqueue.c > @@ -4224,6 +4224,15 @@ unsigned int work_busy(struct work_struct *work) > } > EXPORT_SYMBOL_GPL(work_busy); > > +/* > + * See work_busy() > + */ > +unsigned int delayed_work_busy(struct delayed_work *dwork) > +{ > + return work_busy(&dwork->work); > +} > +EXPORT_SYMBOL_GPL(delayed_work_busy); What's the use case? Some of existing work_busy() seem wrong already. Also, if we need this, let's make it an inline function. Thanks. -- tejun