Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1625153
| From | Alex Shi <alex.shi@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/3] rtmutex: comments update |
| Date | 2017-04-18 10:50 +0200 |
| Message-ID | <txwZI-3ZQ-37@gated-at.bofh.it> (permalink) |
| References | <tvNBD-43N-3@gated-at.bofh.it> <tvNBD-43N-5@gated-at.bofh.it> <tvPk5-514-7@gated-at.bofh.it> <tw5fc-7mS-33@gated-at.bofh.it> <twesb-4Ay-39@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/3] rtmutex: comments update Alex Shi <alex.shi@linaro.org> - 2017-04-13 16:10 +0200
Re: [PATCH 1/3] rtmutex: comments update Steven Rostedt <rostedt@goodmis.org> - 2017-04-13 18:00 +0200
Re: [PATCH 1/3] rtmutex: comments update Alex Shi <alex.shi@linaro.org> - 2017-04-14 11:00 +0200
Re: [PATCH 1/3] rtmutex: comments update Steven Rostedt <rostedt@goodmis.org> - 2017-04-14 20:50 +0200
Re: [PATCH 1/3] rtmutex: comments update Alex Shi <alex.shi@linaro.org> - 2017-04-18 10:50 +0200
Re: [PATCH 1/3] rtmutex: comments update Steven Rostedt <rostedt@goodmis.org> - 2017-04-13 18:10 +0200
csiph-web