lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091109132830.GF26740@basil.fritz.box>
Date:	Mon, 9 Nov 2009 14:28:30 +0100
From:	Andi Kleen <andi@...stfloor.org>
To:	"Eric W. Biederman" <ebiederm@...ssion.com>
Cc:	Andi Kleen <andi@...stfloor.org>,
	Arjan van de Ven <arjan@...radead.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 22/23] sysctl arm: Remove binary sysctl support

On Mon, Nov 09, 2009 at 04:41:44AM -0800, Eric W. Biederman wrote:
> >> >> The glibc pthread code that uses sysctl has no problems if sys_sysctl
> >> >> is gone.  It both falls back to reading /proc/sys and it just controls
> >> >> an optimization and the code works with either result.  Been there,
> >> >> done that.
> >> >
> >> > /proc/sys is much slower than sysctl though. So you made program startup
> >> > slower.
> >> 
> >> 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.

> >
> > a) all
> > b) common ones used by glibc and perhaps a few others only
> > c) none
> >
> > I suspect most users would use (b), in fact (c) might be redundant
> > if (b) is cheap enough (which it should be)
> 
> Next year I expect b == c.

Only if you ignore ABI compatibility.

> 
> 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)

> > 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.

> >> 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.

-Andi
-- 
ak@...ux.intel.com -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ