Re: RFC on fixing mutex spinning on owner

2016-03-19 Thread Steven Rostedt
On Wed, 16 Mar 2016 16:38:56 -0700 Joel Fernandes wrote: > I am not sure if the problem is with the i915 driver, because the > mutex spin on owner stuff is mutex related so the mutex design may > potentially need a tweak (I mentioned a proposal of adding mutex > spinning

Re: RFC on fixing mutex spinning on owner

2016-03-19 Thread Steven Rostedt
On Wed, 16 Mar 2016 16:38:56 -0700 Joel Fernandes wrote: > I am not sure if the problem is with the i915 driver, because the > mutex spin on owner stuff is mutex related so the mutex design may > potentially need a tweak (I mentioned a proposal of adding mutex > spinning time outs). > Also since

Re: RFC on fixing mutex spinning on owner

2016-03-19 Thread Joel Fernandes
Hi Greg, On Wed, Mar 16, 2016 at 4:35 PM, Greg Kroah-Hartman wrote: > On Wed, Mar 16, 2016 at 04:22:17PM -0700, Joel Fernandes wrote: >> Hi, >> >> On a fairly recent kernel and android userspace, I am seeing that with >> i915 driver is in a spin loop waiting for mutex owner to

Re: RFC on fixing mutex spinning on owner

2016-03-19 Thread Joel Fernandes
Hi Greg, On Wed, Mar 16, 2016 at 4:35 PM, Greg Kroah-Hartman wrote: > On Wed, Mar 16, 2016 at 04:22:17PM -0700, Joel Fernandes wrote: >> Hi, >> >> On a fairly recent kernel and android userspace, I am seeing that with >> i915 driver is in a spin loop waiting for mutex owner to release it >>

Re: RFC on fixing mutex spinning on owner

2016-03-19 Thread Steven Rostedt
On Wed, 16 Mar 2016 22:35:21 -0700 Joel Fernandes wrote: > Also, since we are on the topic of preemptoff tracer, I posted a patch > [1] few days ago fixing another issue, if it looks Ok to you could you > pick it up? I had CC'd you on it. > > [1]

Re: RFC on fixing mutex spinning on owner

2016-03-19 Thread Steven Rostedt
On Wed, 16 Mar 2016 22:35:21 -0700 Joel Fernandes wrote: > Also, since we are on the topic of preemptoff tracer, I posted a patch > [1] few days ago fixing another issue, if it looks Ok to you could you > pick it up? I had CC'd you on it. > > [1]

Re: RFC on fixing mutex spinning on owner

2016-03-19 Thread Peter Zijlstra
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; > >

Re: RFC on fixing mutex spinning on owner

2016-03-19 Thread Peter Zijlstra
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; > >

Re: RFC on fixing mutex spinning on owner

2016-03-19 Thread Peter Zijlstra
On Thu, Mar 17, 2016 at 08:06:29AM -0400, Steven Rostedt wrote: > On Thu, 17 Mar 2016 12:16:11 +0100 (CET) > Thomas Gleixner wrote: > > > On Thu, 17 Mar 2016, Peter Zijlstra wrote: > > > Also, maybe the tracer should measure the time from need_resched() > > > getting true

Re: RFC on fixing mutex spinning on owner

2016-03-19 Thread Peter Zijlstra
On Thu, Mar 17, 2016 at 08:06:29AM -0400, Steven Rostedt wrote: > On Thu, 17 Mar 2016 12:16:11 +0100 (CET) > Thomas Gleixner wrote: > > > On Thu, 17 Mar 2016, Peter Zijlstra wrote: > > > Also, maybe the tracer should measure the time from need_resched() > > > getting true until the next

Re: RFC on fixing mutex spinning on owner

2016-03-19 Thread Thomas Gleixner
On Thu, 17 Mar 2016, Peter Zijlstra wrote: > Also, maybe the tracer should measure the time from need_resched() > getting true until the next preemption point, instead of the entire time > preemption was disabled. Which would avoid the entire issue altogether. Well, that only gives you the

Re: RFC on fixing mutex spinning on owner

2016-03-19 Thread Thomas Gleixner
On Thu, 17 Mar 2016, Peter Zijlstra wrote: > Also, maybe the tracer should measure the time from need_resched() > getting true until the next preemption point, instead of the entire time > preemption was disabled. Which would avoid the entire issue altogether. Well, that only gives you the

Re: RFC on fixing mutex spinning on owner

2016-03-19 Thread Nicholas Mc Guire
On Thu, Mar 17, 2016 at 02:32:54PM +0100, Thomas Gleixner wrote: > On Thu, 17 Mar 2016, Peter Zijlstra wrote: > > On Thu, Mar 17, 2016 at 08:06:29AM -0400, Steven Rostedt wrote: > > > On Thu, 17 Mar 2016 12:16:11 +0100 (CET) > > > Thomas Gleixner wrote: > > > > > > > On Thu,

Re: RFC on fixing mutex spinning on owner

2016-03-19 Thread Nicholas Mc Guire
On Thu, Mar 17, 2016 at 02:32:54PM +0100, Thomas Gleixner wrote: > On Thu, 17 Mar 2016, Peter Zijlstra wrote: > > On Thu, Mar 17, 2016 at 08:06:29AM -0400, Steven Rostedt wrote: > > > On Thu, 17 Mar 2016 12:16:11 +0100 (CET) > > > Thomas Gleixner wrote: > > > > > > > On Thu, 17 Mar 2016, Peter

Re: RFC on fixing mutex spinning on owner

2016-03-19 Thread Joel Fernandes
On Wed, Mar 16, 2016 at 7:17 PM, Steven Rostedt wrote: > > On Wed, 16 Mar 2016 16:38:56 -0700 > Joel Fernandes wrote: > > > I am not sure if the problem is with the i915 driver, because the > > mutex spin on owner stuff is mutex related so the mutex

Re: RFC on fixing mutex spinning on owner

2016-03-19 Thread Joel Fernandes
On Wed, Mar 16, 2016 at 7:17 PM, Steven Rostedt wrote: > > On Wed, 16 Mar 2016 16:38:56 -0700 > Joel Fernandes wrote: > > > I am not sure if the problem is with the i915 driver, because the > > mutex spin on owner stuff is mutex related so the mutex design may > > potentially need a tweak (I

Re: RFC on fixing mutex spinning on owner

2016-03-19 Thread Peter Zijlstra
On Thu, Mar 17, 2016 at 08:05:26AM +, Nicholas Mc Guire wrote: > 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() || ...) >

Re: RFC on fixing mutex spinning on owner

2016-03-19 Thread Peter Zijlstra
On Thu, Mar 17, 2016 at 08:05:26AM +, Nicholas Mc Guire wrote: > 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() || ...) >

Re: RFC on fixing mutex spinning on owner

2016-03-19 Thread Nicholas Mc Guire
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

Re: RFC on fixing mutex spinning on owner

2016-03-19 Thread Nicholas Mc Guire
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

RFC on fixing mutex spinning on owner

2016-03-19 Thread Joel Fernandes
Hi, On a fairly recent kernel and android userspace, I am seeing that with i915 driver is in a spin loop waiting for mutex owner to release it (mutex_spin_on_owner). I believe this because the owner of the mutex is running on another CPU and the expectation is the mutex owner releases the mutex

RFC on fixing mutex spinning on owner

2016-03-19 Thread Joel Fernandes
Hi, On a fairly recent kernel and android userspace, I am seeing that with i915 driver is in a spin loop waiting for mutex owner to release it (mutex_spin_on_owner). I believe this because the owner of the mutex is running on another CPU and the expectation is the mutex owner releases the mutex

Re: RFC on fixing mutex spinning on owner

2016-03-19 Thread Steven Rostedt
On Thu, 17 Mar 2016 12:16:11 +0100 (CET) Thomas Gleixner wrote: > On Thu, 17 Mar 2016, Peter Zijlstra wrote: > > Also, maybe the tracer should measure the time from need_resched() > > getting true until the next preemption point, instead of the entire time > > preemption was

Re: RFC on fixing mutex spinning on owner

2016-03-19 Thread Steven Rostedt
On Thu, 17 Mar 2016 12:16:11 +0100 (CET) Thomas Gleixner wrote: > On Thu, 17 Mar 2016, Peter Zijlstra wrote: > > Also, maybe the tracer should measure the time from need_resched() > > getting true until the next preemption point, instead of the entire time > > preemption was disabled. Which

Re: RFC on fixing mutex spinning on owner

2016-03-18 Thread Greg Kroah-Hartman
On Wed, Mar 16, 2016 at 04:22:17PM -0700, Joel Fernandes wrote: > Hi, > > On a fairly recent kernel and android userspace, I am seeing that with > i915 driver is in a spin loop waiting for mutex owner to release it > (mutex_spin_on_owner). Why not provide a backtrace to the drm and i915

Re: RFC on fixing mutex spinning on owner

2016-03-18 Thread Greg Kroah-Hartman
On Wed, Mar 16, 2016 at 04:22:17PM -0700, Joel Fernandes wrote: > Hi, > > On a fairly recent kernel and android userspace, I am seeing that with > i915 driver is in a spin loop waiting for mutex owner to release it > (mutex_spin_on_owner). Why not provide a backtrace to the drm and i915

Re: RFC on fixing mutex spinning on owner

2016-03-18 Thread Thomas Gleixner
On Thu, 17 Mar 2016, Peter Zijlstra wrote: > On Thu, Mar 17, 2016 at 08:06:29AM -0400, Steven Rostedt wrote: > > On Thu, 17 Mar 2016 12:16:11 +0100 (CET) > > Thomas Gleixner wrote: > > > > > On Thu, 17 Mar 2016, Peter Zijlstra wrote: > > > > Also, maybe the tracer should

Re: RFC on fixing mutex spinning on owner

2016-03-18 Thread Thomas Gleixner
On Thu, 17 Mar 2016, Peter Zijlstra wrote: > On Thu, Mar 17, 2016 at 08:06:29AM -0400, Steven Rostedt wrote: > > On Thu, 17 Mar 2016 12:16:11 +0100 (CET) > > Thomas Gleixner wrote: > > > > > On Thu, 17 Mar 2016, Peter Zijlstra wrote: > > > > Also, maybe the tracer should measure the time from