All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Christian Brauner <christian.brauner@ubuntu.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
	Kirill Tkhai <ktkhai@virtuozzo.com>,
	akpm@linux-foundation.org, viro@zeniv.linux.org.uk,
	adobriyan@gmail.com, davem@davemloft.net,
	linux-kernel@vger.kernel.org, avagin@gmail.com, serge@hallyn.com,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH 0/8] namespaces: Introduce generic refcount
Date: Tue, 4 Aug 2020 14:38:29 -0700	[thread overview]
Message-ID: <202008041421.E8F1A404A@keescook> (raw)
In-Reply-To: <20200804145714.rcz6vg3bo6chsuoh@wittgenstein>

On Tue, Aug 04, 2020 at 04:57:14PM +0200, Christian Brauner wrote:
> On Tue, Aug 04, 2020 at 08:21:51AM -0500, Eric W. Biederman wrote:
> > This change is not as trivial as a spelling change so it is not ok to
> > say it is just a cleanup and move on.  A change in the reference
> > counting can be noticable.  This needs at least to be acknowledged in
> > the change log and at a minimum a hand wavy reason put forth why it is
> > ok.
> > 
> > 
> > Instead what I am seeing as justification is this is a trivial cleanup
> > and no one will notice or care.   And it is not that trivial so I
> > object to the patchset.
> 
> The "not seeing a motivation for this" is a suprising argument to me to
> which I honestly can only respond that I don't see a motivation for not
> doing this. It unifies and simplifies code and removes variance.

Thanks for the CC! Ironically I had noticed this series yesterday at the
end of my day and thought to myself, "that's great; I need to go Ack
that tomorrow" and added it to my TODO list. :P

> > So I am opposed because the patchset does not explain at all why it
> > makes sense to do, nor what tradeoffs were considered, nor what
> > testing was done.

This is a reasonable concern; to me the rationale is clear, but you have
a point that it's not very well spelled out. From my perspective I see
the following benefits:

- The code is simplified because now there is a single lifetime counter
  and it goes in the right place: ns_common ... because it's common to
  all of the namespaces. (Yes there are other counters, but the lifetime
  count is common to all of them.) And the stats on the refactoring
  seems to support it with "51 insertions(+), 72 deletions(-)" which,
  while not "proof" that it's correct, is a positive signal that it's
  going in the right direction, implying a reduced maintenance cost.

- refcount_t is safer than atomic_t, and just as fast[1].

- This reduces the atomic_t -> refcount_t delta[2] that is still pending
  from Elena's efforts started in 2017.

So, while the commit logs could perhaps be clarified (and maybe include
a "in preparation for showing namespaces in ..." prefix describing the
work that triggered this clean-up), I think this is a good idea. Please
consider the whole series:

Reviewed-by: Kees Cook <keescook@chromium.org>

-Kees

[1] https://git.kernel.org/linus/dcb786493f3e48da3272b710028d42ec608cfda1
[2] https://lore.kernel.org/lkml/1511954324-14414-1-git-send-email-elena.reshetova@intel.com/

-- 
Kees Cook

      reply	other threads:[~2020-08-04 21: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
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 [this message]

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=202008041421.E8F1A404A@keescook \
    --to=keescook@chromium.org \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=avagin@gmail.com \
    --cc=christian.brauner@ubuntu.com \
    --cc=davem@davemloft.net \
    --cc=ebiederm@xmission.com \
    --cc=hch@lst.de \
    --cc=ktkhai@virtuozzo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=serge@hallyn.com \
    --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.