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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160317080526.GB6679@osadl.at>
Date:	Thu, 17 Mar 2016 08:05:26 +0000
From:	Nicholas Mc Guire <der.herr@...r.at>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Steven Rostedt <rostedt@...dmis.org>,
	Joel Fernandes <agnel.joel@...il.com>,
	Greg Kroah-Hartman <greg@...ah.com>,
	linux-rt-users@...r.kernel.org,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	kernelnewbies <kernelnewbies@...linux.org>,
	Ingo Molnar <mingo@...hat.com>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: RFC on fixing mutex spinning on owner

On Thu, Mar 17, 2016 at 08:36:05AM +0100, Peter Zijlstra wrote:
> On Wed, Mar 16, 2016 at 10:17:51PM -0400, Steven Rostedt wrote:
> > Actually, the preempt off section here is not really an issue:
> > 
> > 	rcu_read_lock();
> > 	while (owner_running(lock, owner)) {
> > 		if (need_resched())
> > 			break;
> > 
> > 		cpu_relax_lowlatency();
> > 	}
> > 	rcu_read_unlock();
> > 
> > Although preemption may be disabled, that "need_resched()" check will
> > break out of the loop if a higher priority task were to want to run on
> > this CPU.
> > 
> > I probably should add a hook there to let the preemptoff tracer know
> > that this is not an issue.
> 
> Urgh, there's a lot of such spin loops all over, that's going to be a
> pain to annotate all.

scanning for that patter with a quite relaxed spatch did not
turn up more than a hand full:

@resched_spin exists@
position p;
@@

(
* while@p (...) {
          ...
          if (need_resched() || ...)
                  break;
          ...
          \(cpu_relax\|cpu_relax_lowlatency\)();
  }
|
* while@p (!need_resched()) {
          ...
          \(cpu_relax\|cpu_relax_lowlatency\)();
  }
)

@script:python@
p << resched_spin.p;
@@
print "%s:%s " % (p[0].file,p[0].line)                                          


is this making some wrong assumptions here or is this
really so infrequent ? 

thx!
hofrat

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ