public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Kay Sievers <kay.sievers@vrfy.org>
Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	linux-kernel@vger.kernel.org, Nick Piggin <npiggin@kernel.dk>,
	Al Viro <viro@zeniv.linux.org.uk>, Christoph Hellwig <hch@lst.de>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Howells <dhowells@redhat.com>,
	"Serge E. Hallyn" <serge.hallyn@canonical.com>,
	Daniel Lezcano <daniel.lezcano@free.fr>,
	Jiri Slaby <jslaby@suse.cz>, Greg Kroah-Hartman <gregkh@suse.de>,
	James Morris <jmorris@namei.org>
Subject: Re: [PATCH] sysctl: add support for poll()
Date: Sun, 12 Jun 2011 08:34:31 -0700	[thread overview]
Message-ID: <m14o3vukqg.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <BANLkTin5P8P_HR78qo0oyzeu9hpWazZqTw@mail.gmail.com> (Kay Sievers's message of "Thu, 2 Jun 2011 19:32:49 +0200")

Kay Sievers <kay.sievers@vrfy.org> writes:

> On Thu, Jun 2, 2011 at 15:56, Eric W. Biederman <ebiederm@xmission.com> wrote:
>> Lucas De Marchi <lucas.demarchi@profusion.mobi> writes:
>
>>> With this patch in, if anyone wants to manage a file under /proc/sys
>>> there's really a small amount of code to write. He only has to define
>>> the new poll struct for that file.
>>
>> The support currently appears cumbersome to add, and it adds what appear
>> to be unnecessary wake ups (say when the hostname in another uts
>> namespace changes).
>
> Yeah, *possibly* waking up once a day compared to *unconditionally*
> waking up every second in every namespace and check if something has
> changed. If that *possibly* should be optimized, which I think isn't
> necessary at all, I guess the logic could be moved down to the
> namespaced data.

Unless you happen to be on a system, where someone has decided that it
has a daemon that likes creating a new set of namespaces per connection
to reduce the effect of code bugs.  At which point you could be talking
much more than a wake up per second.

>> There is no explanation at all of why you care about the nis domainname.
>
> Just the same reason as the hostname, we need to know when the
> kernel's internal state changes. regardless who did it and why, system
> services need to follow it.

So the problem is that you have a system where userspace can't get it's
act together?

>> Since there does not appear to be a specific problem that this problem
>> is being aimed at, since the code just looks like extra maintenance and
>> since the code needed to support this appears to be unnecessarily
>> cumbersome I am going to nack the patch for now.
>>
>> Nacked-by: "Eric W. Biederman" <ebiederm@xmission.com>
>
> Please provide solid technical reasons, why we can't to the same we do
> everywhere else since years, or provide working alternatives. Until
> then:
>
> Acked-By: Kay Sievers <kay.sievers@vrfy.org>

Looking a little closer the patch is broken.

It changes the return of poll for every file under /proc/sys reporting
no file under /proc/sys is writable unless it implements the new poll
method.

Also with having the wait_queue owned by the calling code either I am
mistake or this breaks hotplug type situations.  How do you get things
off of your wait queue when you remove a file from /proc/sys.  This
infrastructure as written looks like a setup for use after free
problems.

> I think poll() is the natural interface if you care about the data in
> a file. It's the same an single fd you care, and not some iniotify
> watch, fd, pathname to register, and filter for whatever comes out
> there.

Sort of.  poll is really designed for socket and pipe data.

The problem with poll is there is no POLLUPDATED.

> We already use exactly the same semantics for quite some years for
> /proc/mounts, /proc/swaps, /proc/mdstat, ... and all over /sys. The
> patch just provides the missing pieces that /proc provides, but
> /proc/sys is missing.

Good point.

There is still the problem that the infrastructure code for the proc
sysctl files are in much worse shape than the sysfs files.

> I don't disagree, it might be nice to have generic inotify support on
> /proc for this or other problems. But unless you want to work on it
> now, and it would solve these problems, I don't see how we can get the
> functionality we need, and that seems to solved with this patch.
> Besides the fact that I think poll() is the simple and better
> solution.

Which is a question that has never been answered.  What functionality
do you need?  To me this all looks like a bad science experiment.

Eric

  parent reply	other threads:[~2011-06-12 15:34 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-01 12:14 [PATCH] sysctl: add support for poll() Lucas De Marchi
2011-06-02  2:51 ` Lucas De Marchi
2011-06-02  3:31   ` Eric W. Biederman
2011-06-02 12:06     ` Kay Sievers
2011-06-02 12:43       ` Alan Cox
2011-06-02 13:01         ` Kay Sievers
2011-06-02 13:02         ` Lucas De Marchi
2011-06-02 13:12           ` Alan Cox
2011-06-02 13:24             ` Kay Sievers
2011-06-02 13:56           ` Eric W. Biederman
2011-06-02 17:32             ` Kay Sievers
2011-06-08 22:17               ` Andrew Morton
2011-06-09 13:16                 ` Kay Sievers
2011-06-13 16:05                   ` Kay Sievers
2011-06-14  3:53                     ` Lucas De Marchi
2011-06-14  4:17                     ` NeilBrown
2011-07-26  2:17                     ` Lucas De Marchi
2011-08-02 22:53                       ` Kay Sievers
2011-08-02 23:16                         ` Greg KH
2011-08-03  1:12                           ` Lucas De Marchi
2011-08-03  9:40                             ` Eric W. Biederman
2011-08-03 13:17                               ` Lucas De Marchi
2011-08-03 18:08                                 ` Eric W. Biederman
2011-08-03 18:45                                   ` Lucas De Marchi
2011-08-04 18:57                                     ` Lucas De Marchi
2011-08-23 17:57                                       ` Greg KH
2011-08-26 21:06                                       ` Andrew Morton
2011-06-12 15:34               ` Eric W. Biederman [this message]
2011-06-13 14:28                 ` Kay Sievers
2011-06-02 14:16         ` Eric W. Biederman

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=m14o3vukqg.fsf@fess.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=daniel.lezcano@free.fr \
    --cc=dhowells@redhat.com \
    --cc=gregkh@suse.de \
    --cc=hch@lst.de \
    --cc=jmorris@namei.org \
    --cc=jslaby@suse.cz \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucas.demarchi@profusion.mobi \
    --cc=npiggin@kernel.dk \
    --cc=serge.hallyn@canonical.com \
    --cc=sfr@canb.auug.org.au \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox