All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: "Akkipeddi, Srinivas" <sakkiped@starentnetworks.com>
Cc: <netdev@vger.kernel.org>,
	"Johnson, David" <djohnson@starentnetworks.com>
Subject: Re: Deadlock in IPv6 code while garbage collection on the rwlock protecting the routing tree.
Date: Tue, 22 Dec 2009 14:36:38 -0800	[thread overview]
Message-ID: <20091222143638.37513a94@nehalam> (raw)
In-Reply-To: <4D35478224365146822AE9E3AD4A26660E89A49E@exchtewks3.starentnetworks.com>

On Tue, 22 Dec 2009 16:57:05 -0500
"Akkipeddi, Srinivas" <sakkiped@starentnetworks.com> wrote:

> I came across a deadlock scenario in the latest IPv6 code. I am trying
> to fix this and any inputs are really appreciated. 
> 
> The deadlock happens when ROUTER-PREF is configured. This happens when
> trying to do a write_lock_bh on the rwlock protecting the routing tree
> during garbage collection.
> 
> The routing tree is read protected (read_lock_bh(&table->tb6_lock))
> using the rwlock when performing a ip6_route_input or  ip6_route_output
> ( "ip6_pol_route"). During route selection (rt6_select), if a neighbor
> solicit is sent (ndisc_send_ns), a dst_entry is allocated
> (icmp6_dst_alloc calls dst_alloc). 
> The garbage collection (fib6_run_gc) will be triggered if the number of
> dst-entries is more than the threshold (dst_alloc). During garbage
> collection, all the routing trees are cleaned up (fib6_clean_all). Here
> we try to take write protect each routing tree (
> write_lock_bh(&table->tb6_lock)). But one of the trees is already read
> protected. 
> 
> The garbage collection is anyways triggered from "icmp6_dst_alloc" with
> the call to fib6_force_start_gc. Since it is triggered, we might not
> want to call the "fib6_run_gc" from dst_alloc for this case but there is
> no way to figure this out in the "dst_alloc" routine.

Might just be easier to convert to spinlock and RCU.

-- 

  reply	other threads:[~2009-12-22 22:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-22 21:57 Deadlock in IPv6 code while garbage collection on the rwlock protecting the routing tree Akkipeddi, Srinivas
2009-12-22 22:36 ` Stephen Hemminger [this message]
2009-12-23 17:44   ` Dave Johnson
2009-12-23 18:13     ` Stephen Hemminger
2010-01-23 10:22       ` David Miller
2010-01-26  9:48         ` Jarek Poplawski
2010-01-26 10:35           ` Jarek Poplawski
2010-01-27  9:59             ` [PATCH] ipv6: Fix possible NULL dereference in icmp6_dst_alloc Jarek Poplawski
2010-01-27 10:14               ` David Miller
2010-01-27 10:34                 ` Jarek Poplawski
2010-01-27 11:04                   ` David Miller
2010-01-27 12:17                     ` Jarek Poplawski
2010-01-27 12:23                       ` David Miller
2010-01-27 12:43                         ` Jarek Poplawski
2010-01-27 13:14                           ` David Miller
2010-01-27 13:28                             ` Jarek Poplawski
2010-01-27 12:35                       ` Atis Elsts

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=20091222143638.37513a94@nehalam \
    --to=shemminger@vyatta.com \
    --cc=djohnson@starentnetworks.com \
    --cc=netdev@vger.kernel.org \
    --cc=sakkiped@starentnetworks.com \
    /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.