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]
Message-ID: <20170705161800.wnrrbgpxsrtltxxc@hirez.programming.kicks-ass.net>
Date:   Wed, 5 Jul 2017 18:18:00 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     "Luis R. Rodriguez" <mcgrof@...nel.org>
Cc:     Linus Torvalds <torvalds@...ux-foundation.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        DanielWagnerwagi@...om.org, Boqun Feng <boqun.feng@...il.com>,
        Marcelo Tosatti <mtosatti@...hat.com>,
        Paul Gortmaker <paul.gortmaker@...driver.com>,
        Ming Lei <ming.lei@...hat.com>, yi1.li@...ux.intel.com,
        takahiro.akashi@...aro.org,
        Jakub Kicinski <jakub.kicinski@...ronome.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
        Davidlohr Bueso <dave@...olabs.net>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        ebiederm@...ssion.com, pmladek@...e.com, luto@...nel.org,
        keescook@...omium.org, dhowells@...hat.com, alan@...ux.intel.com,
        tytso@....edu, oss-drivers@...ronome.com
Subject: Re: [PATCH] firmware: wake all waiters



On Tue, Jun 27, 2017 at 01:30:30AM +0200, Luis R. Rodriguez wrote:

> > But the *only* reason for swait is extreme memory issues and some very
> > special realtime issues, where it saves a couple of bytes in
> > structures that need close packing, and doesn't even use normal
> > spinlocks, so it saves a couple of cycles at wakeup/sleep because it
> > doesn't do a good job in general.

Yes, its about real-time. But it shouldn't be _that_ special purpose.

So swait should be capable of most things people want from a waitqueue.

Things it explicitly does not do are things like:

  - custom wake functions
  - exclusive mode
  - mixing different sleep types on a queue (which I would recommend
    against in any case).

But only very few people need those.

> > The "avoid normal spinlocks" is because it is meant for code that is
> > *so* special that it needs the magical low-level raw spinlocks.

> > I think the two valid users are RCU (which needed it for RT), and kvm
> > (which also needed it for similar issues - it needs to be
> > non-preemptible).

Right, so we need the raw_spinlock in order to run from non-preemptible
code on RT. And we then also need bounded runtimes on stuff.

The only function which is affected by that is swake_up_all(), that does
an unbounded list iteration and is therefore required to be called from
the schedulable context (so we can drop the lock and gain bounds on the
preemption latency).


But aside of all that, it should provide 'everything' people want from a
bog standard regular waitqueue. So I don't see why people shouldn't use
it more.

In any case, I'm not seeing why you call it idiotic.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ