All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kirill Tkhai <ktkhai@virtuozzo.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: christian.brauner@ubuntu.com, akpm@linux-foundation.org,
	viro@zeniv.linux.org.uk, adobriyan@gmail.com,
	davem@davemloft.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/8] ns: Add common refcount into ns_common add use it as counter for net_ns
Date: Tue, 4 Aug 2020 17:36:52 +0300	[thread overview]
Message-ID: <6f6f9989-9cde-f93a-ad0a-311f264398f0@virtuozzo.com> (raw)
In-Reply-To: <87sgd2o6vt.fsf@x220.int.ebiederm.org>

On 04.08.2020 16:52, Eric W. Biederman wrote:
> Kirill Tkhai <ktkhai@virtuozzo.com> writes:
> 
>> On 04.08.2020 15:21, Eric W. Biederman wrote:
>>> Kirill Tkhai <ktkhai@virtuozzo.com> writes:
>>>
>>>> Currently, every type of namespaces has its own counter,
>>>> which is stored in ns-specific part. Say, @net has
>>>> struct net::count, @pid has struct pid_namespace::kref, etc.
>>>>
>>>> This patchset introduces unified counter for all types
>>>> of namespaces, and converts net namespace to use it first.
>>>
>>> And the other refcounts on struct net?
>>>
>>> How do they play into what you are trying to do?
>>
>> I just don't understand you. Different refcounters are related to different
>> problems, they are introduced to solve. This patchset changes only one refcounter,
>> and it does not touch other of them. What do you want to know about others?
>>
> 
> Why net::count not net::passive?  What problem are you trying to solve?

net::count is a counter, which indicates whether net is alive and still
initilized. net::passive does not guarantees that net has not been
deinitialized yet.

The same with another namespaces. All of merged counters indicate
that a namespace is alive and initialized. So, we merge them by this property.

> They both are reference counts on the network namespace.
> 
> I don't understand what you are trying to do, other than take a bunch of
> things that look similar and squash them all together.
> 
> What semantics does this magical common reference count have?
> Why is it better for the count to live in ns_common rather than it
> it's own dedicated field of struct net?

The only visible current effect is better readability and better
debugability with, say, crash on kernel dump.

> Given that decrementing still requires code per namespace to handle
> the count going to zero.  How does this benefit anyone?

Since namespaces are different by type, they require different destructors.
Generic counter can't solve any problem, the namespaces can address.

> Has the effect of cache line placement of the move of the reference
> count been considered?

I don't see any performance impact during namespace creation/destruction
test.

> All I see in the patch in question is switching a location that the
> count lives.  Which does not seem useful to me.
> 
> I am not fundamentally oppossed but I don't see the point.  At this
> point it looks like you are making things harder to maintain by making
> things common that are merely similar

  reply	other threads:[~2020-08-04 14:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-03 10:16 [PATCH 0/8] namespaces: Introduce generic refcount Kirill Tkhai
2020-08-03 10:16 ` [PATCH 1/8] ns: Add common refcount into ns_common add use it as counter for net_ns Kirill Tkhai
2020-08-04 12:21   ` Eric W. Biederman
2020-08-04 12:48     ` Kirill Tkhai
2020-08-04 13:52       ` Eric W. Biederman
2020-08-04 14:36         ` Kirill Tkhai [this message]
2020-08-03 10:16 ` [PATCH 2/8] uts: Use generic ns_common::count Kirill Tkhai
2020-08-03 10:16 ` [PATCH 3/8] ipc: " Kirill Tkhai
2020-08-03 10:16 ` [PATCH 4/8] pid: " Kirill Tkhai
2020-08-03 10:16 ` [PATCH 5/8] user: " Kirill Tkhai
2020-08-03 10:16 ` [PATCH 6/8] mnt: " Kirill Tkhai
2020-08-03 10:16 ` [PATCH 7/8] cgroup: " Kirill Tkhai
2020-08-03 10:17 ` [PATCH 8/8] time: " Kirill Tkhai
2020-08-04 11:56 ` [PATCH 0/8] namespaces: Introduce generic refcount Christian Brauner
2020-08-04 12:11   ` Eric W. Biederman
2020-08-04 12:30     ` Christian Brauner
2020-08-04 13:21       ` Eric W. Biederman
2020-08-04 14:57         ` Christian Brauner
2020-08-04 21:38           ` Kees Cook

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=6f6f9989-9cde-f93a-ad0a-311f264398f0@virtuozzo.com \
    --to=ktkhai@virtuozzo.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=christian.brauner@ubuntu.com \
    --cc=davem@davemloft.net \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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.