linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xunlei Pang <xpang@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Juri Lelli <juri.lelli@arm.com>,
	Ingo Molnar <mingo@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] sched/deadline/rtmutex: Fix a PI crash for deadline tasks
Date: Sat, 9 Apr 2016 11:25:39 +0800	[thread overview]
Message-ID: <57087633.3020700@redhat.com> (raw)
In-Reply-To: <20160408185916.GQ3448@twins.programming.kicks-ass.net>

On 2016/04/09 at 02:59, Peter Zijlstra wrote:
> On Fri, Apr 08, 2016 at 02:50:55PM -0400, Steven Rostedt wrote:
>> On Fri, 8 Apr 2016 19:38:35 +0200
>> Peter Zijlstra <peterz@infradead.org> wrote:
>>
>>> On Fri, Apr 08, 2016 at 12:25:10PM -0400, Steven Rostedt wrote:
>>>
>>>> So the preempt_disable() is to allow us to set current back to its
>>>> normal priority first before waking up the other task because we don't
>>>> want two tasks at the same priority?  
>>>> What's the point of swapping deboost and the wake up again?  
>>> In the context of this patch, it ensures the new pi_task pointer points
>>> to something that exists -- this is a rather useful property for a
>>> pointer to have.
>> It's not clear to what would make the new pi_task pointer object no
>> longer exist from this patch. I take it that waking up the wake_q, will
>> cause something to change in the code of rt_mutex_adjust_prio(current).
>> If so, it should probably be stated in a comment, because nothing is
>> obvious here.
> Its pretty obvious that a running task can exit :-)
>
> But also, wake_q holds a task ref.
>
>>> It furthermore guarantees that it points to a blocked task, another
>>> useful property.
>> I would think that the slowfn() would have removed anything to do with
>> what's on the wake_q removed from current.
> It cannot.
>
>> What task on what pointer.
>> I'm only looking at this current patch, not anything to do with the
>> original patch of this thread. That is, just the swap of waking up
>> wake_q and calling rt_mutex_adjust_prio().
> This whole patch was in the context of the previous patch, as should be
> clear from the thread.
>
> In any case, I just realized we do not in fact provide this guarantee
> (of pointing to a blocked task) that needs a bit more work.

Current patch calls rt_mutex_adjust_prio() before wake_up_q() the wakee, at that moment
the wakee has been removed by rt_mutex_slowunlock()->mark_wakeup_next_waiter(),
from current's pi_waiters, rt_mutex_adjust_prio() won't see this wakee, so I think this should
not be problem.

Regards,
Xunlei

  parent reply	other threads:[~2016-04-09  3:25 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-01 11:00 [PATCH] sched/deadline/rtmutex: Fix a PI crash for deadline tasks Xunlei Pang
2016-04-01 11:38 ` Peter Zijlstra
2016-04-01 12:23   ` Xunlei Pang
2016-04-01 13:12     ` Peter Zijlstra
2016-04-01 13:34       ` Xunlei Pang
2016-04-01 21:51         ` Peter Zijlstra
2016-04-02 10:19           ` Xunlei Pang
2016-04-05  8:38           ` Xunlei Pang
2016-04-05  9:19             ` Peter Zijlstra
2016-04-05  9:29               ` Peter Zijlstra
2016-04-05 10:48                 ` Xunlei Pang
2016-04-05 11:32                   ` Peter Zijlstra
2016-04-08 16:25                 ` Steven Rostedt
2016-04-08 17:38                   ` Peter Zijlstra
2016-04-08 18:50                     ` Steven Rostedt
2016-04-08 18:59                       ` Peter Zijlstra
2016-04-08 19:15                         ` Steven Rostedt
2016-04-08 19:28                           ` Steven Rostedt
2016-04-09  3:27                             ` Xunlei Pang
2016-04-09  3:25                         ` Xunlei Pang [this message]
2016-04-09 13:29                           ` Peter Zijlstra
2016-04-10  8:22                             ` Xunlei Pang
2016-04-12  3:08                               ` Xunlei Pang
2016-04-12 15:51                                 ` Peter Zijlstra
2016-04-13  2:13                                   ` Xunlei Pang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57087633.3020700@redhat.com \
    --to=xpang@redhat.com \
    --cc=juri.lelli@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=xlpang@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).