All of lore.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: "Pavel Emelyanov" <xemul@parallels.com>,
	"Sjur Brændeland" <sjur.brandeland@stericsson.com>,
	"levinsasha928@gmail.com" <levinsasha928@gmail.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"davej@redhat.com" <davej@redhat.com>,
	"sjurbren@gmail.com" <sjurbren@gmail.com>
Subject: Re: [PATCH] netns: fix net_alloc_generic()
Date: Thu, 26 Jan 2012 22:54:07 -0800	[thread overview]
Message-ID: <m1k44d8wkw.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <1327644547.2919.11.camel@edumazet-laptop> (Eric Dumazet's message of "Fri, 27 Jan 2012 07:09:07 +0100")

Eric Dumazet <eric.dumazet@gmail.com> writes:

> Le jeudi 26 janvier 2012 à 14:57 -0800, Eric W. Biederman a écrit :
>
>> It is not a chicken and egg problem.  It is a bug in caif.
>> caif is claiming to be a network device when it is acting as a subsytem.
>> That means it is being initialized too late.
>> 
>
> Ah ok !
>
>> Untested but this should trivially fix the problem, and a bunch
>> of others of the same ilk.
>> 
>
> Hmm, please refrain from using "trivially" or "trivial", you're not
> fooling anyone.

All I meant is that the change was trivial.

> Truth is this netns layer is horribly complex, since this CAIF bug
> needed no more than four patch attempts and lastly your own work before
> finding the root cause.

As for the complexity I don't know that it is noticeably worse than the
initialization complexity of the network stack in general.

I do think that it is non-obvious that serious initialization ordering
problems can be caused by such a small difference.  The non-locality
and of cause and effect, combined with unfamiliarity of the code seems
to be what hides problems like this.

Once you know that initialization ordering problems tend to registering
the wrong way.  Aka as a device instead of a subsys the solution to
problems like this tend to jump out at you.

Now the common plumbing in net/core/net_namespace.c does count as
complex.  The fact we missed such an obvious optimization opportunity
for so long seems to confirm that.

I am open for ideas on how to simply things.  

Eric

  reply	other threads:[~2012-01-27  6:51 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-24  7:30 [PATCH] net: caif: Don't act on notification for non-caif devices Sasha Levin
2012-01-24 10:52 ` Sjur Brændeland
2012-01-24 14:49   ` Sasha Levin
2012-01-24 15:06     ` Sjur Brændeland
2012-01-24 15:23       ` Sasha Levin
2012-01-24 22:27         ` [PATCH net] caif: Fix crash due to uninitialized net name-space Sjur Brændeland
2012-01-24 22:44           ` David Miller
2012-01-25 16:13           ` Sasha Levin
2012-01-25 20:33             ` Sjur Brændeland
2012-01-26  6:14               ` Eric Dumazet
2012-01-26 10:41               ` [PATCH] netns: fix net_alloc_generic() Eric Dumazet
2012-01-26 10:44                 ` Pavel Emelyanov
2012-01-26 10:51                   ` Eric Dumazet
2012-01-26 22:57                     ` Eric W. Biederman
2012-01-26 23:07                       ` David Miller
2012-01-26 23:57                         ` Eric W. Biederman
2012-01-27  0:02                         ` [PATCH 1/2] netns: Fail conspicously if someone uses net_generic at an inappropriate time Eric W. Biederman
2012-01-27  0:04                           ` [PATCH 2/2] net caif: Register properly as a pernet subsystem Eric W. Biederman
2012-01-27 13:24                             ` Sasha Levin
2012-01-27 14:48                               ` Sjur BRENDELAND
2012-01-28  2:07                             ` David Miller
2012-01-28  2:07                           ` [PATCH 1/2] netns: Fail conspicously if someone uses net_generic at an inappropriate time David Miller
2012-01-27  6:09                       ` [PATCH] netns: fix net_alloc_generic() Eric Dumazet
2012-01-27  6:54                         ` Eric W. Biederman [this message]
2012-01-27  7:07                           ` Eric Dumazet
2012-01-26 14:40                 ` Sasha Levin
2012-01-26 18:37                 ` David 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=m1k44d8wkw.fsf@fess.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=davej@redhat.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=levinsasha928@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sjur.brandeland@stericsson.com \
    --cc=sjurbren@gmail.com \
    --cc=xemul@parallels.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.