All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Shi <alex.shi@linaro.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: peterz@infradead.org, mingo@redhat.com, corbet@lwn.net,
	"open list:LOCKING PRIMITIVES" <linux-kernel@vger.kernel.org>,
	"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
	Sebastian Siewior <bigeasy@linutronix.de>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 1/3] rtmutex: comments update
Date: Tue, 18 Apr 2017 16:38:17 +0800	[thread overview]
Message-ID: <22a06728-7bdc-6b96-ce5a-f97cfdd0b4c3@linaro.org> (raw)
In-Reply-To: <20170414144330.67a9a2ea@gandalf.local.home>



On 04/15/2017 02:43 AM, Steven Rostedt wrote:
>> Yes, how about this?
>> +If the G process has highest priority in the chain, any rightside lock owners
>> +in the tree branch need to increase its' priority as high as G.
> 
> If task G is the highest priority task in the chain, then all the tasks
> up the chain (A and B in this example), must have their priorities
> increased to that of G.

Sounds better than mine. :)
>>
>> The schedule can then wake up for a couple of reasons:
> 
> The task can then wake up for a couple of reasons:

fixed.
> 
>>   1) The previous lock owner released the lock, and we are top_waiter now
> 
>   and the task is now the top_waiter

Yes.
> 
>>   2) we received a signal or timeout
>>
>> For the first reason, we could get the lock in acquisition retry and back to 
>> TASK_RUNNING state.
> 
> Actually that's not quite true.
> 
> In the first case, the task will try again to acquire the lock. If it
> does, then it will take itself off the waiters tree and set itself back
> to the TASK_RUNNING state. If the lock was acquired by another task
> before this task could get the lock, then it will go back to sleep and
> wait to be woken again.

Yes, your version includes the failure conditions in lock retrying. will
use yours explanation, thanks!

> 
>> For the second reason, if task is in TASK_INTERRUPTIBLE 
>> state, we will give up the lock acquisition, and also back to TASK_RUNNING. 
> 
> The second case is only applicable for tasks that are grabbing a mutex
> that can wake up before getting the lock, either due to a signal or
> a timeout (i.e. rt_mutex_timed_futex_lock()). When woken, it will try to
> take the lock again, if it succeeds, then the task will return with the
> lock held, otherwise it will return with -EINTR if the task was woken
> by a signal, or -ETIMEDOUT if it timed out.

Will use yours version too. Thanks a lot!
> 
>> Otherwise we will yield cpu and back to sleep.
> 
> Nuke the above sentence.

Drop this sentence.

  reply	other threads:[~2017-04-18  8:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-13 14:02 [RFC PATCH 0/3] rtmutex comments update and trival fix Alex Shi
2017-04-13 14:02 ` [PATCH 1/3] rtmutex: comments update Alex Shi
2017-04-13 15:54   ` Steven Rostedt
2017-04-14  8:52     ` Alex Shi
2017-04-14 18:43       ` Steven Rostedt
2017-04-18  8:38         ` Alex Shi [this message]
2017-04-13 16:00   ` Steven Rostedt
2017-04-13 14:02 ` [PATCH 2/3] rtmutex: deboost priority conditionally when rt-mutex unlock Alex Shi
2017-04-13 14:23   ` Sebastian Siewior
2017-04-13 14:39   ` Peter Zijlstra
2017-04-13 16:09     ` Steven Rostedt
2017-04-13 16:21       ` Peter Zijlstra
2017-04-13 16:40         ` Steven Rostedt
2017-04-13 16:51           ` Peter Zijlstra
2017-04-13 14:02 ` [PATCH 3/3] rtmutex: remove unnecessary adjust prio Alex Shi
2017-04-13 16:15   ` Steven Rostedt

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=22a06728-7bdc-6b96-ce5a-f97cfdd0b4c3@linaro.org \
    --to=alex.shi@linaro.org \
    --cc=bigeasy@linutronix.de \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.