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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 7 Sep 2022 09:35:20 +0200
From:   Ingo Molnar <mingo@...nel.org>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     rjw@...ysocki.net, oleg@...hat.com, vincent.guittot@...aro.org,
        dietmar.eggemann@....com, rostedt@...dmis.org, mgorman@...e.de,
        ebiederm@...ssion.com, bigeasy@...utronix.de,
        Will Deacon <will@...nel.org>, linux-kernel@...r.kernel.org,
        tj@...nel.org, linux-pm@...r.kernel.org
Subject: Re: [PATCH v3 4/6] sched/completion: Add wait_for_completion_state()


* Peter Zijlstra <peterz@...radead.org> wrote:

> On Sun, Sep 04, 2022 at 12:46:11PM +0200, Ingo Molnar wrote:
> > 
> > * Peter Zijlstra <peterz@...radead.org> wrote:
> > 
> > > Allows waiting with a custom @state.
> > > 
> > > Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> > > ---
> > >  include/linux/completion.h |    1 +
> > >  kernel/sched/completion.c  |    9 +++++++++
> > >  2 files changed, 10 insertions(+)
> > > 
> > > --- a/include/linux/completion.h
> > > +++ b/include/linux/completion.h
> > > @@ -103,6 +103,7 @@ extern void wait_for_completion(struct c
> > >  extern void wait_for_completion_io(struct completion *);
> > >  extern int wait_for_completion_interruptible(struct completion *x);
> > >  extern int wait_for_completion_killable(struct completion *x);
> > > +extern int wait_for_completion_state(struct completion *x, unsigned int state);
> > >  extern unsigned long wait_for_completion_timeout(struct completion *x,
> > >  						   unsigned long timeout);
> > >  extern unsigned long wait_for_completion_io_timeout(struct completion *x,
> > > --- a/kernel/sched/completion.c
> > > +++ b/kernel/sched/completion.c
> > > @@ -247,6 +247,15 @@ int __sched wait_for_completion_killable
> > >  }
> > >  EXPORT_SYMBOL(wait_for_completion_killable);
> > >  
> > > +int __sched wait_for_completion_state(struct completion *x, unsigned int state)
> > > +{
> > > +	long t = wait_for_common(x, MAX_SCHEDULE_TIMEOUT, state);
> > > +	if (t == -ERESTARTSYS)
> > > +		return t;
> > > +	return 0;
> > 
> > Nit: newline missing after local variable definition.
> 
> Yah, I know, but all the other similar functions there have the same
> defect. I don't much like whitespace patches, so I figured I'd be
> consistent and let it all be for now.

That's not actually true: there's ~7 functions in kernel/sched/completion.c 
with local variables, and only ~2 have this minor stylistic inconsistency 
right now AFAICS. Scheduler-wide the ratio is even lower.

So even if a patch doesn't entirely remove the residual noise, let's not 
add to it, please?

Thanks,

	Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ