All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: "David S. Miller" <davem@davemloft.net>
Cc: herbert@gondor.apana.org.au, davem@redhat.com,
	linux-kernel@vger.kernel.org
Subject: Re: [lock validator] inet6_destroy_sock(): soft-safe -> soft-unsafe lock dependency
Date: Tue, 31 Jan 2006 12:21:54 +0100	[thread overview]
Message-ID: <20060131112154.GA21099@elte.hu> (raw)
In-Reply-To: <20060131.024323.83813817.davem@davemloft.net>


* David S. Miller <davem@davemloft.net> wrote:

> From: Herbert Xu <herbert@gondor.apana.org.au>
> Date: Tue, 31 Jan 2006 21:27:58 +1100
> 
> > tcp_close is only called from process context.  The rule for sk_dst_lock
> > is that it must also only be obtained in process context.  On the other
> > hand, it is true that sk_lock can be obtained in softirq context.
> > 
> > In this particular case, sk_dst_lock is obtained by tcp_close with
> > softirqs disabled.  This is not a problem in itself since we're not
> > trying to get sk_dst_lock from a real softirq context (as opposed to
> > process context with softirq disabled).
> > 
> > I believe this warning comes about because the validator creates a
> > dependency between sk_lock and sk_dst_lock.  It then infers from this
> > dependency that in softirq contexts where sk_lock is obtained the code
> > may also attempt to obtain sk_dst_lock.
> > 
> > This inference is where the validator errs.  sk_dst_lock is never
> > (or should never be, and as far as I can see none of the traces show
> > it to do so) obtained in a real softirq context.
> 
> Herbert's analysis is correct.  This unique locking strategy is used 
> by tcp_close() because at this point it knows that every single 
> reference to this socket in the system is gone once it takes the 
> socket lock with BH disabled.
> 
> And that known invariant is why this is correct, and the locking 
> validator has no way to figure this out.

ok, thanks for the analysis! I'll fix this with an explicit hint to the 
validator.

	Ingo

  reply	other threads:[~2006-01-31 11:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-27  0:18 [lock validator] net/ipv4/fib_hash.c: illegal {enabled-softirqs} -> {used-in-softirq} usage? Ingo Molnar
2006-01-27  1:41 ` Herbert Xu
2006-01-28 15:22   ` [lock validator] inet6_destroy_sock(): soft-safe -> soft-unsafe lock dependency Ingo Molnar
2006-01-28 15:44     ` Ingo Molnar
2006-01-31 10:27     ` Herbert Xu
2006-01-31 10:43       ` David S. Miller
2006-01-31 11:21         ` Ingo Molnar [this message]
2006-02-01 13:32         ` Ingo Molnar
2006-02-01 20:26           ` Herbert Xu
2006-02-02  7:46             ` Ingo Molnar
2006-02-02  8:48               ` Herbert Xu
2006-02-02  9:04                 ` David S. Miller
2006-02-02 10:54                 ` Ingo Molnar
2006-02-02 11:27                   ` Ingo Molnar
2006-02-02 12:19                     ` Herbert Xu
2006-02-02 12:17                   ` Herbert Xu
2006-02-02 13:54                     ` Ingo Molnar
2006-01-31 21:24       ` Ingo Molnar
2006-01-31 22:06         ` Herbert Xu
2006-02-01 10:42         ` Herbert Xu
2006-02-01 11:13           ` Ingo Molnar
2006-02-03  1:01           ` David S. Miller

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=20060131112154.GA21099@elte.hu \
    --to=mingo@elte.hu \
    --cc=davem@davemloft.net \
    --cc=davem@redhat.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-kernel@vger.kernel.org \
    /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.