lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Wed, 24 May 2017 22:01:25 +0200
From:   Alex Naidis <alex.naidis@...ux.com>
To:     Alex NDS <alex.naidis@...ux.com>
Cc:     linux-kernel@...r.kernel.org
Subject: Fwd: [PATCH] workqueue: Implement delayed_work_busy()

Hello,
thank you for your quick review!

2017-05-24 17:11 GMT+02:00 Tejun Heo <tj@...nel.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@...r.kernel.org
> > Signed-off-by: Alex Naidis <alex.naidis@...ux.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.

Yeah, I agree, it is wrong to rely on work_busy() providing correct data.
However sometimes it is useful to have an indicator like this to at least
catch some cases where requeuing work would be obsolete.
This applies for delayed work too.

>
> Also, if we need this, let's make it an inline function.

Alright, you should receive V2 of this patch right after this mail.
>
>
> Thanks.
>
> --
> tejun


Thank you again!
Alex

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ