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]
Date:	Mon, 11 Jan 2010 17:06:53 -0800
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Benjamin LaHaise <bcrl@...et.ca>
Cc:	Tejun Heo <tj@...nel.org>, Greg Kroah-Hartman <gregkh@...e.de>,
	Kay Sievers <kay.sievers@...y.org>,
	linux-kernel@...r.kernel.org,
	Cornelia Huck <cornelia.huck@...ibm.com>,
	linux-fsdevel@...r.kernel.org,
	Eric Dumazet <eric.dumazet@...il.com>,
	Serge Hallyn <serue@...ibm.com>,
	"Eric W. Biederman" <ebiederm@...stanetworks.com>
Subject: Re: [PATCH 3/7] sysfs: Keep an nlink count on sysfs directories.

Benjamin LaHaise <bcrl@...et.ca> writes:

> On Tue, Jan 12, 2010 at 09:46:59AM +0900, Tejun Heo wrote:
>> Hello,
>> 
>> On 01/12/2010 05:21 AM, Eric W. Biederman wrote:
>> > On large directories sysfs_count_nlinks can be a significant
>> > bottleneck, so keep a count in sysfs_dirent.
>> 
>> I was about to suggest changing s_flags to ushort too.  Hmmm... adding
>> a new field to sysfs_dirent somewhat worries me but this doesn't add
>> to the size of the structure.  How significant bottlenect are we
>> talking about?
>
> 100,000 entries in a sysfs directory is a requirement for network devices.

I haven't limited that.

>> > If we exceed the maximum number of directory entries we can store
>> > return nlink of 1.  An nlink of 1 matches what reiserfs does in this
>> > case, and it let's find and similar utlities know that we have a the
>> > directory nlink can not be used for optimization purposes.
>> 
>> Hmmm... what's the limit on reiserfs?  Is it 64k too?
>
> 64k is too small.  10 gig interfaces can currently service 50-100k users, 
> each of which requires their own network device.

64k is the point at which I stop returning a userful nlink number to
userspace, sysfs directories can still scale to any size.

I could legitimately always return nlink == 1, and all userspace
utilities that I know of would be fine, but I am trying to be a bit
more polite than that.

I don't see the link count as interesting enough to store more than
16bits for it.  Even with 32bits of storage for nlink sysfs would have
to have to handle the rollover case as I am doing now.  So I don't
see any advantage to storing more bits.

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