Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Apr 2012 10:54:32 +0400
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        Ryan Stone <rysto32@gmail.com>
Cc:        freebsd-net@FreeBSD.org
Subject:   Re: kern/165863
Message-ID:  <20120410065432.GJ9391@glebius.int.ru>
In-Reply-To: <CAFMmRNwWZFzbqG7ejdEqsMTKzxxZv-ZbGGJGr98mYcE_ku7xMQ@mail.gmail.com>
References:  <201203090930.q299UCPX057950@freefall.freebsd.org> <CAFMmRNwWZFzbqG7ejdEqsMTKzxxZv-ZbGGJGr98mYcE_ku7xMQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
  Thanks, Ryan!

On Thu, Mar 29, 2012 at 05:59:38PM -0400, Ryan Stone wrote:
R> Ok, I think that I have an approach that will work.  This is heavily
R> based off of glebius' proposal.  The big difference is that instead of
R> initializing the arptimer callout with the ll_entry's lock, I
R> initialize it with the if_afdata_lock.  This eliminates the LOR
R> problem in arptimer.  It also nicely prevents any races between
R> arptimer and in_lltable_prefix_free.  Either arptimer will run and
R> ensure that prefix_free can never see an entry that arptimer is in the
R> process of destroying, or prefix_free will stop the callout before
R> arptimer gets a chance to start.
R> 
R> I'll admit that it feels a bit dirty to be doing anything if the ifp
R> at this level, but I'd argue that is an artifact of using a lock in
R> the ifp to protect the lltable.
R> 
R> The patch below is not yet complete; it doesn't fix the IPv6 case.
R> IPv6 is looking much trickier as when an NDP entry is timed out
R> nd6_free() will drop the LLE_WLOCK, acquire the IF_AFDATA_LOCK and
R> then re-acquire the LLE_WLOCK.  It's not immediately clear to me what
R> the best way to handle the race between in6_lltable_prefix_free and
R> nd6_llinfo_timer is.  Holding the afdata_lock across all of
R> nd6_llinfo_timer feels like overkill.
R> 
R> Any comments on this approach?  Am I going in the wrong direction?

Looks okay from my viewpoint. Have you stress tested it? My snap patch
definitely had problems, AFAIR.

If this patch fixes panics observed by kern/165863 and passes stress
testing, then it should be committed ASAP, and shouldn't depend on
IPv6 part.

-- 
Totus tuus, Glebius.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120410065432.GJ9391>