[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM_iQpUPQVodJRGmf=GYOVK+R_84w-+yDtqyHCJGbCDH0hb44A@mail.gmail.com>
Date: Fri, 27 Feb 2015 09:28:22 -0800
From: Cong Wang <xiyou.wangcong@...il.com>
To: Nicolas Dichtel <nicolas.dichtel@...nd.com>
Cc: Eric Dumazet <eric.dumazet@...il.com>,
Linux Kernel Network Developers <netdev@...r.kernel.org>
Subject: Re: [Patch net] netns: avoid allocating idr when dumping info
On Fri, Feb 27, 2015 at 8:25 AM, Nicolas Dichtel
<nicolas.dichtel@...nd.com> wrote:
> Le 27/02/2015 09:01, Eric Dumazet a écrit :
>
>> On Thu, 2015-02-26 at 22:32 -0800, Cong Wang wrote:
>>>
>>> We can allocate the peer netns id when creating the link
>>> instead of when dumping the link.
>>>
>>> This fixes the following kernel warning:
>>>
>>> ===============================
>>> [ INFO: suspicious RCU usage. ]
>>> 3.19.0+ #805 Tainted: G W
>>> -------------------------------
>>> include/linux/rcupdate.h:538 Illegal context switch in RCU read-side
>>> critical section!
>>>
>>> other info that might help us debug this:
>>
>>
>> This looks very complicated, why even bother ?
>>
>> I gave an obvious patch fixing root cause, I have no idea why you prefer
>> over engineering this.
>>
>> If you believe allocating peer netns id is required at link creation
>> time, you should explain why.
I don't understand why you think this is over engineering,
clearly it is normal to allocate resources in newlink rather than
dumping. Look at other resources we allocate in newlink.
>>
>> BTW, (void)peernet2id(dev_net(dev), src_net) can fail, and your fix is
>> not complete anyway.
>
> That's true. The patch does not cover the following case:
> ip link add foo type bar
> ip link set foo netns netns1
>
> In this case, the second command will call dev_change_net_namespace() and
> the
> id will not be allocated.
Then call it in do_setlink(). This is not a reason we _have to_
allocate it in dumping.
>
> I think Eric's patch is simpler and less error-prone.
>
Sure, he introduced this rcu read lock from the very beginning.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists