mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kirill Tkhai <ktkhai@virtuozzo.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: davem@davemloft.net, vyasevic@redhat.com,
	kstewart@linuxfoundation.org, pombredanne@nexb.com,
	vyasevich@gmail.com, mark.rutland@arm.com,
	gregkh@linuxfoundation.org, adobriyan@gmail.com, fw@strlen.de,
	nicolas.dichtel@6wind.com, xiyou.wangcong@gmail.com,
	roman.kapl@sysgo.com, paul@paul-moore.com, dsahern@gmail.com,
	daniel@iogearbox.net, lucien.xin@gmail.com,
	mschiffer@universe-factory.net, rshearma@brocade.com,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	ebiederm@xmission.com, avagin@virtuozzo.com,
	gorcunov@virtuozzo.com
Subject: Re: [PATCH] net: Convert net_mutex into rw_semaphore and down read it on net->init/->exit
Date: Tue, 14 Nov 2017 20:25:41 +0300	[thread overview]
Message-ID: <a15d43b5-6806-9f12-6b5e-d17c44bd953c@virtuozzo.com> (raw)
In-Reply-To: <1510679257.2849.170.camel@edumazet-glaptop3.roam.corp.google.com>

On 14.11.2017 20:07, Eric Dumazet wrote:
> On Tue, 2017-11-14 at 16:53 +0300, Kirill Tkhai wrote:
>> Curently mutex is used to protect pernet operations list. It makes
>> cleanup_net() to execute ->exit methods of the same operations set,
>> which was used on the time of ->init, even after net namespace is
>> unlinked from net_namespace_list.
>>
> ...
> 
>> The solution is to convert net_mutex to the rw_semaphore. Then,
>> pernet_operations::init/::exit methods, modifying the net-related data,
>> will require down_read() locking only, while down_write() will be used
>> for changing pernet_list.
>>
> ...
> 
>> This patch requires commit 76f8507f7a64 "locking/rwsem: Add down_read_killable()"
>> from Linus tree (not in net-next yet).
> 
> 
> Looks great, thanks for doing this.
> 
> I wonder if the down_read_killable() is really needed, maybe a
> down_read() would not be blocking the thread too long after this change.

I'm afraid there are spin_unlock() or similar actions leading to preempt_enable(),
which are made under the mutex/new rw_sem. They may be preempted and leave a cpu
for some time. So the possibility to break the wait may be useful in some way...

  reply	other threads:[~2017-11-14 17:25 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-14 13:53 Kirill Tkhai
2017-11-14 17:07 ` Eric Dumazet
2017-11-14 17:25   ` Kirill Tkhai [this message]
2017-11-14 17:44 ` Andrei Vagin
2017-11-14 18:00   ` Eric Dumazet
2017-11-14 22:15     ` Andrei Vagin
2017-11-14 18:04   ` Kirill Tkhai
2017-11-14 18:38     ` Andrei Vagin
2017-11-14 20:43       ` Kirill Tkhai
2017-11-14 18:11 ` Stephen Hemminger
2017-11-14 19:07   ` Eric Dumazet
2017-11-14 18:39 ` Cong Wang
2017-11-14 19:58   ` Kirill Tkhai
2017-11-15  3:19     ` Eric W. Biederman
2017-11-15  9:51       ` Kirill Tkhai
2017-11-15 12:36         ` Kirill Tkhai
2017-11-15 16:31           ` Eric W. Biederman
2017-11-17 18:36             ` Kirill Tkhai
2017-11-17 18:52               ` Eric W. Biederman
2017-11-17 20:16                 ` Kirill Tkhai
2017-11-15  6:25 ` Eric W. Biederman
2017-11-15  9:49   ` Kirill Tkhai
2017-11-15 16:29     ` Eric W. Biederman
2017-11-16  9:13       ` Kirill Tkhai
2017-11-17 16:46       ` Kirill Tkhai
2017-11-17 18:54         ` Eric W. Biederman
2017-11-17 20:12           ` Kirill Tkhai

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=a15d43b5-6806-9f12-6b5e-d17c44bd953c@virtuozzo.com \
    --to=ktkhai@virtuozzo.com \
    --cc=adobriyan@gmail.com \
    --cc=avagin@virtuozzo.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=ebiederm@xmission.com \
    --cc=eric.dumazet@gmail.com \
    --cc=fw@strlen.de \
    --cc=gorcunov@virtuozzo.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kstewart@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=mark.rutland@arm.com \
    --cc=mschiffer@universe-factory.net \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=paul@paul-moore.com \
    --cc=pombredanne@nexb.com \
    --cc=roman.kapl@sysgo.com \
    --cc=rshearma@brocade.com \
    --cc=vyasevic@redhat.com \
    --cc=vyasevich@gmail.com \
    --cc=xiyou.wangcong@gmail.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

all inboxes | Powered by JetHome®