From: ebiederm@xmission.com (Eric W. Biederman)
To: David Miller <davem@davemloft.net>
Cc: kaber@trash.net, greearb@candelatech.com, shemminger@vyatta.com,
herbert@gondor.apana.org.au, netdev@vger.kernel.org
Subject: Re: IPv4/IPv6 sysctl unregistration deadlock
Date: Sat, 07 Mar 2009 19:36:53 -0800 [thread overview]
Message-ID: <m1zlfwbs8a.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <20090303.004829.160372230.davem@davemloft.net> (David Miller's message of "Tue\, 03 Mar 2009 00\:48\:29 -0800 \(PST\)")
David Miller <davem@davemloft.net> writes:
> From: Patrick McHardy <kaber@trash.net>
> Date: Tue, 03 Mar 2009 00:03:00 +0100
>
>> David Miller wrote:
>> > From: Patrick McHardy <kaber@trash.net>
>> > Date: Mon, 02 Mar 2009 23:20:49 +0100
>> >
>> >> This looks like its working fine. Despite the non-desirable active
>> >> spinning, this seems like the best fix (actually much simpler than
>> >> I expected to be possible) at this time. If we just could avoid
>> >> the spinning when unnecessary, it would be perfect :)
>> > Could you give that "not actually in-progress" detection a shot?
>> > I don't like the spinning either.
>>
>> I tried this morning, the problem is that its always the sysctl
>> handler which will run into the deadlock first, but there is no
>> reliable indication to avoid it other than that the RTNL is
>> already held. The problem is that the sysctl interface puts the
>> process holding the RTNL to sleep and allows a process requiring
>> it to run. Any different synchronization attempt will have the
>> same problem, it seems you simply can't hold any locks while
>> unregistering sysctls.
>
> Ok, I applied Stephen's patches then...
>From the further brainstorming department...
It appears we are using the wait for the completion
for two distinct purposes.
Waiting until it is safe to free storage.
Blocking module unregistration until the all of the
users of the code are gone.
I'm wondering if we could move the memory freeing.
And consolidate the waiting ultimately moving the
wait for completion into netdev_run_todo after
we drop the lock.
The reason I care is that it looks like to get hotplug
handling sane, I'm going to need to implement a generic
version of what sysfs, proc and sysctl are doing, and I
expect that generic version belongs in the vfs ultimately
giving us the capability to implement revoke.
So I am going to be revisiting how the code works, and if
I can come up with a cleaner solution to the networking
stack it would be a good time to implement it.
Eric
next prev parent reply other threads:[~2009-03-08 3:37 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-25 5:23 IPv4/IPv6 sysctl unregistration deadlock Patrick McHardy
2009-02-25 6:19 ` Herbert Xu
2009-02-25 6:23 ` Patrick McHardy
2009-02-25 7:18 ` Patrick McHardy
2009-02-25 8:43 ` Herbert Xu
2009-02-26 6:06 ` Eric W. Biederman
2009-02-26 6:10 ` Eric W. Biederman
2009-02-26 6:22 ` Herbert Xu
2009-02-26 7:18 ` Eric W. Biederman
2009-02-26 16:49 ` Stephen Hemminger
2009-02-26 19:01 ` Eric W. Biederman
2009-02-26 20:24 ` Stephen Hemminger
2009-02-27 0:59 ` Herbert Xu
2009-02-27 1:25 ` Stephen Hemminger
2009-02-27 18:26 ` Ben Greear
2009-02-27 18:38 ` Stephen Hemminger
2009-03-02 11:07 ` Patrick McHardy
2009-03-02 11:21 ` Patrick McHardy
2009-03-02 22:11 ` Ben Greear
2009-03-02 22:20 ` Patrick McHardy
2009-03-02 22:47 ` David Miller
2009-03-02 23:03 ` Patrick McHardy
2009-03-03 8:48 ` David Miller
2009-03-08 3:36 ` Eric W. Biederman [this message]
2009-02-26 16:55 ` Stephen Hemminger
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=m1zlfwbs8a.fsf@fess.ebiederm.org \
--to=ebiederm@xmission.com \
--cc=davem@davemloft.net \
--cc=greearb@candelatech.com \
--cc=herbert@gondor.apana.org.au \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.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 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).