[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6eab9340-1e5b-aaec-b9aa-d6e40cb9a9a2@virtuozzo.com>
Date: Wed, 21 Feb 2018 11:30:36 +0300
From: Kirill Tkhai <ktkhai@...tuozzo.com>
To: Cong Wang <xiyou.wangcong@...il.com>
Cc: David Miller <davem@...emloft.net>,
Nicolas Dichtel <nicolas.dichtel@...nd.com>,
vyasevic@...hat.com,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Vladislav Yasevich <vyasevich@...il.com>, mark.rutland@....com,
Greg KH <gregkh@...uxfoundation.org>, leonro@...lanox.com,
avagin@...tuozzo.com, Florian Westphal <fw@...len.de>,
roman.kapl@...go.com,
Linux Kernel Network Developers <netdev@...r.kernel.org>
Subject: Re: [PATCH 2/3] net: Make cleanup_list and net::cleanup_list of llist
type
On 20.02.2018 22:42, Cong Wang wrote:
> On Mon, Feb 19, 2018 at 1:58 AM, Kirill Tkhai <ktkhai@...tuozzo.com> wrote:
>> void __put_net(struct net *net)
>> {
>> /* Cleanup the network namespace in process context */
>> - unsigned long flags;
>> -
>> - spin_lock_irqsave(&cleanup_list_lock, flags);
>> - list_add(&net->cleanup_list, &cleanup_list);
>> - spin_unlock_irqrestore(&cleanup_list_lock, flags);
>> -
>> + llist_add(&net->cleanup_list, &cleanup_list);
>> queue_work(netns_wq, &net_cleanup_work);
>> }
>
> Is llist safe against IRQ too?
Yes, it's safe and it's aimed for the cases like this. There is no "locked"
state like spinlock has, there is single cmpxchg().
You may find examples it's used in ./kernel directory.
Kirill
Powered by blists - more mailing lists