Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752985AbcCQFfZ (ORCPT ); Thu, 17 Mar 2016 01:35:25 -0400 Received: from mail-lf0-f41.google.com ([209.85.215.41]:33914 "EHLO mail-lf0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751678AbcCQFfX (ORCPT ); Thu, 17 Mar 2016 01:35:23 -0400 MIME-Version: 1.0 In-Reply-To: <20160316221751.71816309@grimm.local.home> References: <20160316233530.GA8731@kroah.com> <20160316221751.71816309@grimm.local.home> Date: Wed, 16 Mar 2016 22:35:21 -0700 Message-ID: Subject: Re: RFC on fixing mutex spinning on owner From: Joel Fernandes To: Steven Rostedt Cc: Greg Kroah-Hartman , linux-rt-users@vger.kernel.org, Linux Kernel Mailing List , kernelnewbies , Ingo Molnar , Peter Zijlstra , Thomas Gleixner Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1689 Lines: 44 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 mentioned a proposal of adding mutex > > spinning time outs). > > Also since this is latency issue related (I mentioned preemptoff > > tracer and preempt disabled), I sent it to linux-rt-users. Thanks for > > the tip about sending it to i915 developers, incase no one here has a > > say in the matter, I can drop them a note later as well. > > 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. Thanks Steve! That makes sense. If you do end up adding this hook to the tracer, I would appreciate it if you could Cc me on the patch so I could back port it to my kernel as well. 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] http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1099561.html Thanks, Joel