linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Alex Shi <alex.shi@linaro.org>
Cc: mathieu.poirier@linaro.org, Ingo Molnar <mingo@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	"open list:LOCKING PRIMITIVES" <linux-kernel@vger.kernel.org>,
	"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Sebastian Siewior <bigeasy@linutronix.de>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH v2 1/3] rtmutex: update rt-mutex-design
Date: Fri, 21 Apr 2017 17:47:52 +0200	[thread overview]
Message-ID: <20170421154752.n54qikxldxzi4hs2@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <1492783975-13633-1-git-send-email-alex.shi@linaro.org>

On Fri, Apr 21, 2017 at 10:12:53PM +0800, Alex Shi wrote:
> diff --git a/Documentation/locking/rt-mutex-design.txt b/Documentation/locking/rt-mutex-design.txt
> index 8666070..11beb55 100644
> --- a/Documentation/locking/rt-mutex-design.txt
> +++ b/Documentation/locking/rt-mutex-design.txt
> @@ -97,9 +97,9 @@ waiter   - A waiter is a struct that is stored on the stack of a blocked
>             a process being blocked on the mutex, it is fine to allocate
>             the waiter on the process's stack (local variable).  This
>             structure holds a pointer to the task, as well as the mutex that
> -           the task is blocked on.  It also has the plist node structures to
> -           place the task in the waiter_list of a mutex as well as the
> -           pi_list of a mutex owner task (described below).
> +	   the task is blocked on.  It also has a rbtree node structures to
> +	   place the task in waiters rbtree of a mutex as well as the
> +	   pi_waiters rbtree of a mutex owner task (described below).

whitespace fail

>  
>             waiter is sometimes used in reference to the task that is waiting
>             on a mutex. This is the same as waiter->task.
> @@ -179,53 +179,35 @@ again.
>                           |
>                     F->L5-+
>  
> +If the G process has highest priority 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.

No, only the top task that's actually runnable needs to be modified. The
rest we don't care about because they're blocked.

> +Since the pi_waiters of a task holds an order by priority of all the top waiters
> +of all the mutexes that the task owns, rt_mutex_getprio simply needs to compare
> +the top pi waiter to its own normal priority, and return the higher priority
> +back.

rt_mutex_getprio() doesn't exist.

> +The main operation of this function is summarized by Thomas Gleixner in
> +rtmutex.c. See the 'Chain walk basics and protection scope' comment for further
> +details.

Since all the useful bits are there anyway, why keep this document
around at all?

  parent reply	other threads:[~2017-04-21 16:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-21 14:12 [PATCH v2 1/3] rtmutex: update rt-mutex-design Alex Shi
2017-04-21 14:12 ` [PATCH v2 2/3] rtmutex: update rt-mutex Alex Shi
2017-04-21 14:12 ` [PATCH v2 3/3] rtmutex: remove unnecessary adjust prio Alex Shi
2017-04-21 15:47 ` Peter Zijlstra [this message]
2017-04-24 13:39   ` [PATCH v2 1/3] rtmutex: update rt-mutex-design Alex Shi
2017-04-21 15:57 ` Mathieu Poirier
2017-04-24 13:45   ` Alex Shi

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=20170421154752.n54qikxldxzi4hs2@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=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=mathieu.poirier@linaro.org \
    --cc=mingo@redhat.com \
    --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 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).