mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: "Albert Cahalan" <acahalan@gmail.com>
Cc: ak@suse.de, tytso@mit.edu, drepper@redhat.com,
	arjan@infradead.org, rdunlap@xenotime.net, akpm@osdl.org,
	linux-kernel@vger.kernel.org, libc-alpha@sourceware.org
Subject: Re: [PATCH] Use uname not sysctl to get the kernel revision
Date: Thu, 13 Jul 2006 00:38:02 -0600	[thread overview]
Message-ID: <m164i257sl.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <787b0d920607122200m4785f7ddmddf40c079a7460cb@mail.gmail.com> (Albert Cahalan's message of "Thu, 13 Jul 2006 01:00:38 -0400")

"Albert Cahalan" <acahalan@gmail.com> writes:

> Andi Kleen writes:
>> On Thursday 13 July 2006 01:24, Theodore Tso wrote:
>
>>> P.S.  I happen to be one those developers who think the binary
>>> interface is not so bad, and for compared to reading from /proc/sys,
>>> the sysctl syscall *is* faster.  But at the same there, there really
>>> isn't anything where really does require that kind of speed, so that
>>> point is moot.  But at the same time, what is the cost of leaving
>>> sys_sysctl in the kernel for an extra 6-12 months, or even longer,
>>> starting from now?
>>
>> The numerical namespace for sysctl is unsalvagable imho. e.g.
>> distributions regularly break it because there is no central
>> repository of numbers so it's not very usable anyways in practice.
>
> Huh? How exactly is this different from system call numbers,
> ioctl numbers, fcntl numbers, ptrace command numbers, and every
> other part of the Linux ABI?

The only practical difference is that what people use is
/proc/sys so the binary sysctl interface is not seriously maintained
and bugs crop up.

> Normal sysctl works very well for FreeBSD. I'm jealous.
> They also have a few related calls that are very nice.
>
> Here we fight over a few CPU cycles in the syscall entry path,
> then piss away performance by requiring open-read-close and
> marshalling everything through decimal ASCII text. WTF? Let's
> just have one system call (make_XML_SOAP_request) and be done.

There is a cost to open-read-close.  But as a simple benchmark
against a file will show reading data from /proc/sys is much slower
than reading data from a file.

>From what I have been able to measure so far, open-read-close only
seems to double the cost over sysctl, and access can do the filename
resolution about as quickly as sysctl can deal with a binary path.  So
I suspect it is the allocation of struct file that makes
open-read-close more expensive.  Reading the data is in the noise.

sysfs current does a lot better than /proc/sys I think it was only
60% heavier than performing the same operation on a real file.

Part of the problem with /proc/sys and other data in proc is
that we deliberately kill the drop everything out of the dcache
as soon as we have found it.  Which is terrible performance wise.

All of those measurements were with string data that I don't
interpret on either side.

Performance wise there does seem to be a problem with the
implementation.  How to fix it I don't yet know.  But I have
yet to see ascii text be implicated.

Eric

  parent reply	other threads:[~2006-07-13  6:39 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-13  5:00 Albert Cahalan
2006-07-13  5:42 ` H. Peter Anvin
2006-07-13  6:09   ` Albert Cahalan
2006-07-13  6:13     ` Albert Cahalan
2006-07-13  6:38 ` Eric W. Biederman [this message]
2006-07-13 16:15   ` Albert Cahalan
2006-07-13 16:53     ` Eric W. Biederman
2006-07-13 17:06       ` Albert Cahalan
2006-07-13 15:20 ` Eric W. Biederman
  -- strict thread matches above, loose matches on Subject: below --
2006-07-10 22:39 [PATCH] sysctl: Document that sys_sysctl will be removed Eric W. Biederman
2006-07-10 22:50 ` Randy.Dunlap
2006-07-11  4:10   ` Eric W. Biederman
2006-07-11  7:07     ` Arjan van de Ven
2006-07-12 16:25       ` [PATCH] Use uname not sysctl to get the kernel revision Eric W. Biederman
2006-07-12 16:50         ` Ulrich Drepper
2006-07-12 17:42           ` Eric W. Biederman
2006-07-12 23:24             ` Theodore Tso
2006-07-12 23:31               ` Andi Kleen
2006-07-13  0:12                 ` Theodore Tso
2006-07-13  2:33                   ` Eric W. Biederman
2006-07-13 12:15                   ` Andi Kleen
2006-07-12 23:44               ` Steve Munroe
2006-07-14 18:49                 ` Benjamin Herrenschmidt
2006-07-14 19:09                   ` Andi Kleen
2006-07-13  0:19               ` Eric W. Biederman
2006-07-12 18:44           ` Roland McGrath
2006-07-12 19:33             ` Ulrich Drepper
2006-07-12 19:53               ` Jakub Jelinek
2006-07-12 20:09                 ` H. Peter Anvin
2006-07-12 21:23                   ` Eric W. Biederman
2006-07-12 21:29                     ` Arjan van de Ven
2006-07-12 21:56                       ` Eric W. Biederman
2006-07-12 22:01                         ` Arjan van de Ven
2006-07-12 22:02                           ` H. Peter Anvin
2006-07-12 22:26                             ` Eric W. Biederman
2006-07-12 22:31                               ` H. Peter Anvin
2006-07-12 23:07                               ` Alan Cox
2006-07-12 23:19                                 ` H. Peter Anvin
2006-07-13 11:15                                   ` Alan Cox
2006-07-14 18:45                                 ` Benjamin Herrenschmidt
2006-07-14 19:11                                   ` H. Peter Anvin
2006-07-12 21:29                     ` H. Peter Anvin
2006-07-12 21:33                     ` Michael Tokarev
2006-07-13  5:17                     ` Ulrich Drepper
2006-07-13  6:27                       ` Ian Wienand
2006-07-13 14:39                       ` Eric W. Biederman
2006-07-13 15:05                         ` Arjan van de Ven

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=m164i257sl.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=acahalan@gmail.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=arjan@infradead.org \
    --cc=drepper@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    --cc=tytso@mit.edu \
    /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

Powered by JetHome