mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de
Subject: Re: [patch] lock validator: rtmutex unlock order annotation
Date: Thu, 22 Jun 2006 18:40:25 -0700	[thread overview]
Message-ID: <20060622184025.3110879c.akpm@osdl.org> (raw)
In-Reply-To: <20060622085706.GA29136@elte.hu>

On Thu, 22 Jun 2006 10:57:06 +0200
Ingo Molnar <mingo@elte.hu> wrote:

> rtmutex.c does a tricky piece of 'lock chain' logic spiced with trylock,
> which has one particular codepath where we intentionally release the
> locks in a different order as acquired. Annotate this for the lock
> validator to not complain if CONFIG_DEBUG_NON_NESTED_UNLOCKS=y.
> 
> Signed-off-by: Ingo Molnar <mingo@elte.hu>
> ---
>  kernel/rtmutex.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> Index: linux/kernel/rtmutex.c
> ===================================================================
> --- linux.orig/kernel/rtmutex.c
> +++ linux/kernel/rtmutex.c
> @@ -243,7 +243,8 @@ static int rt_mutex_adjust_prio_chain(ta
>  	plist_add(&waiter->list_entry, &lock->wait_list);
>  
>  	/* Release the task */
> -	spin_unlock_irqrestore(&task->pi_lock, flags);
> +	spin_unlock_non_nested(&task->pi_lock);
> +	local_irq_restore(flags);

y'know, if an innocent civilian were to stumble across this code he or she
would wonder "wtf is that doing"?

He or she would then go to the definition of spin_unlock_non_nested() and
would find it to be 100% comment-free.

IOW, hasty hackery is flying in all directions and the kernel is getting
crappier as a result.

And that's OK for now, because at some stage I'll be dropping the whole lot
so you can redo the series.  But I just don't know what's in there any more
and we'll need to re-changelog, re-document, re-comment and re-review
everything in the for-real patch series.  (ISTR having some minor comments
and questions against the initial patch series?)

We'll need to review it for comprehensibility (hence maintainability).

We'll need to measure the configged-off code size increase.

I think we have quite a long way to go yet on this stuff.

  reply	other threads:[~2006-06-23  1:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-22  8:57 Ingo Molnar
2006-06-23  1:40 ` Andrew Morton [this message]
2006-06-23  7:11   ` Ingo Molnar

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=20060622184025.3110879c.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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

all inboxes | Powered by JetHome®