All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Andi Kleen <andi@firstfloor.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
	Arjan van de Ven <arjan@infradead.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 22/23] sysctl arm: Remove binary sysctl support
Date: Mon, 9 Nov 2009 16:28:46 +0100	[thread overview]
Message-ID: <200911091628.47003.arnd@arndb.de> (raw)
In-Reply-To: <20091109132830.GF26740@basil.fritz.box>

On Monday 09 November 2009, Andi Kleen wrote:
> On Mon, Nov 09, 2009 at 04:41:44AM -0800, Eric W. Biederman wrote:

> > >> Not much slower, but slower. I just measured it in a case that favors
> > >> sysctl and the ration is about 5:2.  Or sysctl is about 2.5x faster.
> > >> About 49usec for open/read/close on proc and 19usec for sysctl.
> > >> In my emulation it is a bit slower than that.
> > >
> > > That's not good.
> > 
> > Why?
> 
> Because it slows down a very common path.

Can you name one binary sysctl value that gets accessed more
than a few times during the execution of a vaguely common
application? We're talking about microseconds for typically
write-once or read-once settings.

> > If you think we need something better additional patches to sysctl_binary.c
> > are welcome.  Just add your custom fast path before the through the
> > VFS.
> 
> I think sysctl_binary should be just stripped down for common sysctls
> (at least with a CONFIG)

It would technically be the same result, whether you add a fast
path for common ones, or leave the current code in place or leave
out the uncommon ones. In both cases, we'd still need the emulation
code that Eric did.

The question is just how many sysctl values you regard as both
common and performance critical.
Eric was implying 'none to very few', and that seems highly likely
to me. If you can come up with proof for the opposite (e.g. in form
of a list), that might make it sensible that stripping the current
code down would be easier.

Even then, Eric is likely the only person willing to do that job,
so he should be allowed to choose the implementation between
functionally equivalent solutions.

> > > Hmm? There's plenty of glibc code that uses the binary sysctl.
> > 
> > Where?  I grepped glibc today.  The only use in a recent glibc is
> > in glibc-ports for the support of arm inb/outb.  The only other
> > use in older glibc was checking to see if we ran on an SMP kernel.
> 
> That older glibc is widely deployed. And it won't go away next year.

So? Most users of old glibc are also using old kernels, and they
can still use the  config option for the compatibility code.
There wouldn't even be a performance penalty over new glibc with
new kernels which already use procfs.

> > >> Ultimately what drives me most is that people are still accidentally
> > >> adding binary sysctls, which no one uses or tests.  For a recent
> > >> example see:
> > >
> > > Yes I agree new binary sysctls should just be deprecated right now.
> > 
> > Good.  The only way to keep new ones from showing up is to that I know
> > of is to move everything into an emulation layer.  I have done the heavy
> > lifting there and everything is emulated using the exact same code.
> 
> I agree with that.
> 
> I just think you should have two flavours of emulation layer:
> full and "common sysctls". This can be probably done with the same
> code and some strategic ifdefs.

If it's just about code size, I totally wouldn't bother. Just put the
emulation code in loadable module and add a 'printk("Warning, %s is
using sysctl %s, wasting %d kb of kernel memory")' to it's module_init
function.

	Arnd <><

  reply	other threads:[~2009-11-09 15:28 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-08 12:16 [PATCH 00/23] Removal of binary sysctl support Eric W. Biederman
2009-11-08 12:21 ` [PATCH 01/23] sysctl: Remove the unused frv sysctl unumbers Eric W. Biederman
2009-11-08 12:21 ` [PATCH 02/23] sysctl: Stop using binary sysctl numbers in arlan Eric W. Biederman
2009-11-11 21:07   ` John W. Linville
2009-11-08 12:21 ` [PATCH 03/23] sysctl: Reduce sys_sysctl to a compatibility wrapper around /proc/sys Eric W. Biederman
2009-11-08 12:21 ` [PATCH 04/23] sysctl: Neuter the generic sysctl strategy routines Eric W. Biederman
2009-11-08 12:21 ` [PATCH 05/23] sysctl: Remove dead code from sysctl_check Eric W. Biederman
2009-11-08 12:21 ` [PATCH 06/23] sysctl: Remove references to ctl_name and strategy from the generic sysctl table Eric W. Biederman
2009-11-08 12:21 ` [PATCH 07/23] sysctl: Don't look at ctl_name and strategy in the generic code Eric W. Biederman
2009-11-08 12:21 ` [PATCH 08/23] sysctl ipc: Remove dead binary sysctl support code Eric W. Biederman
2009-11-08 12:21 ` [PATCH 09/23] sysctl net: Remove unused binary sysctl code Eric W. Biederman
2009-11-08 12:21 ` [PATCH 10/23] sysctl fs: Remove dead binary sysctl support Eric W. Biederman
2009-11-08 12:21 ` [PATCH 11/23] sysctl kernel: Remove binary sysctl logic Eric W. Biederman
2009-11-08 12:21 ` [PATCH 12/23] sysctl security/keys: Remove dead binary sysctl support Eric W. Biederman
2009-11-08 12:22 ` [PATCH 13/23] sysctl crypto: " Eric W. Biederman
2009-11-08 15:44   ` Herbert Xu
2009-11-08 12:22 ` [PATCH 14/23] sysctl drivers: " Eric W. Biederman
2009-11-09  8:17   ` Clemens Ladisch
2009-11-08 12:22 ` [PATCH 15/23] sysctl mips/lasat: " Eric W. Biederman
2009-11-09 14:10   ` Ralf Baechle
2009-11-08 12:22 ` [PATCH 16/23] sysctl frv: " Eric W. Biederman
2009-11-08 12:22 ` [PATCH 17/23] sysctl s390: Remove dead sysctl binary support Eric W. Biederman
2009-11-08 12:22 ` [PATCH 18/23] sysctl ia64: Remove dead binary sysctl support Eric W. Biederman
2009-11-08 12:22 ` [PATCH 19/23] sysctl powerpc: " Eric W. Biederman
2009-11-08 20:44   ` Benjamin Herrenschmidt
2009-11-08 12:22 ` [PATCH 20/23] sysctl sh: " Eric W. Biederman
2009-11-08 12:22 ` [PATCH 21/23] sysctl x86: " Eric W. Biederman
2009-11-08 12:22 ` [PATCH 22/23] sysctl arm: Remove " Eric W. Biederman
2009-11-08 12:34   ` Russell King
2009-11-08 22:45     ` Eric W. Biederman
2009-11-08 22:56       ` Russell King
2009-11-08 23:31         ` Eric W. Biederman
2009-11-08 23:34           ` Russell King
2009-11-08 23:05       ` Eric W. Biederman
2009-11-09  0:48         ` Arjan van de Ven
2009-11-09  3:27           ` Eric W. Biederman
2009-11-09  4:57             ` Arjan van de Ven
2009-11-09  5:37               ` Eric W. Biederman
2009-11-09  9:38                 ` Andi Kleen
2009-11-09 11:45                   ` Eric W. Biederman
2009-11-09 12:04                     ` Andi Kleen
2009-11-09 12:41                       ` Eric W. Biederman
2009-11-09 13:28                         ` Andi Kleen
2009-11-09 15:28                           ` Arnd Bergmann [this message]
2009-11-09 15:46                             ` Andi Kleen
2009-11-09 16:23                               ` Arnd Bergmann
2009-11-10  4:42                                 ` Eric W. Biederman
2009-11-10  8:01                               ` Eric W. Biederman
2009-11-11  2:31                               ` Eric W. Biederman
2009-11-09 12:42                       ` Eric W. Biederman
2009-11-08 12:22 ` [PATCH 23/23] sysctl: Remove the last of the generic " Eric W. Biederman
2009-11-08 13:06 ` [PATCH 00/23] Removal of " Arnd Bergmann
2009-11-09  3:44   ` 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=200911091628.47003.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=andi@firstfloor.org \
    --cc=arjan@infradead.org \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    /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.