From: Tejun Heo <tj@kernel.org>
To: Alex Naidis <alex.naidis@linux.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] workqueue: Implement delayed_work_busy()
Date: Wed, 24 May 2017 11:11:54 -0400 [thread overview]
Message-ID: <20170524151154.GD24798@htj.duckdns.org> (raw)
In-Reply-To: <1495582493-10069-1-git-send-email-alex.naidis@linux.com>
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 <alex.naidis@linux.com>
> ---
> 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
next prev parent reply other threads:[~2017-05-24 15:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-23 23:34 Alex Naidis
2017-05-24 15:11 ` Tejun Heo [this message]
[not found] ` <CACuw83r65iSCQdV1WVR=wQqw0voJ_98HmsRF9XaAdeGtQ_daGQ@mail.gmail.com>
2017-05-24 20:01 ` Fwd: " Alex Naidis
2017-05-24 20:01 ` Tejun Heo
2017-05-24 20:16 ` Alex Naidis
2017-05-24 20:21 ` Tejun Heo
2017-05-24 20:32 ` Alex Naidis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170524151154.GD24798@htj.duckdns.org \
--to=tj@kernel.org \
--cc=alex.naidis@linux.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®