Welcome to Soft32 Linux Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

[PATCH 1/3] sysfs directory scaling: rbtree for dirent nam..

 
Goto page Previous  1, 2
   Soft32 Home -> Linux -> Kernel RSS
Next:  [GIT PULL] perf events fixes  
Author Message
Benjamin LaHaise

External


Since: Nov 01, 2009
Posts: 7



(Msg. 16) Posted: Tue Nov 03, 2009 5:20 pm
Post subject: Re: [PATCH 1/3] sysfs directory scaling: rbtree for dirent name lookups [Login to view extended thread Info.]
Archived from groups: linux>kernel (more info?)

On Tue, Nov 03, 2009 at 01:32:33PM -0800, Eric W. Biederman wrote:
> Are your numbers from your application and are they real world?
> In which case they are interesting, but it would be good if
> we could also have microbenchmark numbers that just measure
> the sysfs costs. If nothing else I am seeing a big startup
> overhead that isn't being subtracted out that makes it hard
> to see the real costs here.

They're application based, so there's a bunch of other overhead included
that won't show up on a microbenchmark. Each interface requires a round
trip between 2 L2TP daemons, so there are lots of syscalls and other cache
polluting effects that won't show up on a microbenchmark. One of the L2TP
daemons is configured not to instantiate any kernel state -- running in
this mode, it has very little overhead.

The other thing to note is that the costs posted are how long it takes to
add an additional 5,000 interfaces in the given range, not the total time
to add say 35,000 interfaces (I didn't feel like waiting that long).

-ben
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo DeleteThis @vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Login to vote
Benjamin LaHaise

External


Since: Nov 01, 2009
Posts: 7



(Msg. 17) Posted: Tue Nov 03, 2009 5:20 pm
Post subject: Re: [PATCH 1/3] sysfs directory scaling: rbtree for dirent name lookups [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Tue, Nov 03, 2009 at 01:43:43PM -0800, Eric W. Biederman wrote:
> I guess in particular what I would expect is that if we can do 35000
> interfaces in 63s with an O(N^2) algorithm. Then we should be able to
> do 35000 interfaces with an O(NlogN) algorithm in under a second.
> Which for your application should make the time essentially flat in
> the number of interfaces.

That's the wrong way to interprete the numbers. The 35000 number of 63s is
the time that it takes 63s to add 5000 more interfaces in the 30,000 to
35,000 range. This includes the time required to add a point to point ip
route on the interface and bring the interface up.

-ben
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.TakeThisOut@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Login to vote
Eric W. Biederman

External


Since: Nov 04, 2006
Posts: 795



(Msg. 18) Posted: Tue Nov 03, 2009 5:20 pm
Post subject: Re: [PATCH 1/3] sysfs directory scaling: rbtree for dirent name lookups [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Benjamin LaHaise <bcrl.DeleteThis@lhnet.ca> writes:

> On Tue, Nov 03, 2009 at 01:32:33PM -0800, Eric W. Biederman wrote:
>> Are your numbers from your application and are they real world?
>> In which case they are interesting, but it would be good if
>> we could also have microbenchmark numbers that just measure
>> the sysfs costs. If nothing else I am seeing a big startup
>> overhead that isn't being subtracted out that makes it hard
>> to see the real costs here.
>
> They're application based, so there's a bunch of other overhead included
> that won't show up on a microbenchmark. Each interface requires a round
> trip between 2 L2TP daemons, so there are lots of syscalls and other cache
> polluting effects that won't show up on a microbenchmark. One of the L2TP
> daemons is configured not to instantiate any kernel state -- running in
> this mode, it has very little overhead.
>
> The other thing to note is that the costs posted are how long it takes to
> add an additional 5,000 interfaces in the given range, not the total time
> to add say 35,000 interfaces (I didn't feel like waiting that long).

Ok. That makes a lot more sense. The times you posted ideally would be flat
but they go up from 12s to 60s.

Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.DeleteThis@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Login to vote
Eric W. Biederman

External


Since: Nov 04, 2006
Posts: 795



(Msg. 19) Posted: Tue Nov 03, 2009 5:20 pm
Post subject: Re: [PATCH 1/3] sysfs directory scaling: rbtree for dirent name lookups [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Greg KH <greg RemoveThis @kroah.com> writes:

> On Tue, Nov 03, 2009 at 07:14:33AM +0100, Eric Dumazet wrote:
>> Greg KH a ?crit :
>> > On Sun, Nov 01, 2009 at 11:31:30AM -0500, Benjamin LaHaise wrote:
>> >> Use an rbtree in sysfs_dirent to speed up file lookup times
>> >>
>> >> Systems with large numbers (tens of thousands and more) of network
>> >> interfaces stress the sysfs code in ways that make the linear search for
>> >> a name match take far too long. Avoid this by using an rbtree.
>> >
>> > What kind of speedups are you seeing here? And do these changes cause a
>> > memory increase due to the structure changes which outweigh the
>> > speedups?
>> >
>> > What kind of test are you doing to reproduce this?
>> >
>>
>> Its curious because in my tests the biggest problems come from
>> kernel/sysctl.c (__register_sysctl_paths) consuming 80% of cpu
>> in following attempt to create 20.000 devices
>>
>> (disable hotplug before trying this, and ipv6 too !)
>> modprobe dummy numdummies=20000
>>
>> I believe we should address __register_sysctl_paths() scalability
>> problems too.
>
> But registering 20000 devices is a far different problem from using
> those 20000 devices Smile
>
> I think the "use the device" path should be the one we care the most
> about fixing up, as that is much more common than the register path for
> all users.

Definitely. Of the three proc sysctl and sysfs. sysctl tends to have
the worst costs across the board. They are all rarely used so a lot
of what gets hit when scaling are rare path events that even the most
horrible code works fine on small systems.

Usually slow registration times indicate an O(N^2) or worse data
structure for filename lookup.

Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo RemoveThis @vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Login to vote
Display posts from previous:   
Related Topics:
[PATCH 1/2] sysfs: Shadow directory support - The problem. When implementing a network namespace I need to be able to have multiple network devices with the same..

[PATCH 0/5] On to usable sysfs shadow directory support... - The following patchset has been tested on 2.6.21-rc6 + Kay's..

[PATCH] Documentation/rbtree.txt - Signed-off-by: Rob Landley <rob@landley.net> Documentation for lib/rbtree.c. -- I'm not an expert on this but ...

[RFC][PATCH -mm] swsusp: Use rbtree for tracking allocated.. - Hi, Some time ago we discussed the possibility of simplifying the swsusp's approach towards tracking the swap pages..

[PATCHSET 2.6.22-rc4-mm2] sysfs: make directory dentries/i.. - This patchset makes directory dentries and inodes reclaimable and is consisted of the following eleven patches. #01:..

[PATCHSET 2.6.22-rc2-mm1 REVIEW] sysfs: make directory den.. - Hello, again. THIS PATCHSET NEEDS MORE REVIEW AND TESTING. PLEASE DO NOT APPLY YET. This patchset makes directory..
       Soft32 Home -> Linux -> Kernel All times are: Pacific Time (US & Canada) (change)
Goto page Previous  1, 2
Page 2 of 2

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Categories:
 Windows
  Linux
 Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]