[Devel] Re: Performance of netns with sysfs

Eric W. Biederman ebiederm at xmission.com
Thu Jan 15 20:35:28 PST 2009


Guenter Roeck <groeck at redback.com> writes:

> There are two key elements affecting performance when creating large
> numbers of interfaces:
> - full_name_hash() doesn't do a good job in selecting hash buckets
> - sysfs uses a linked list to store directory entries, and strcmp() to
> compare entries.
>
> The sysfs problem may be solved with Eric's sysfs upcoming changes; if
> not, there are (at least) two ways to improve sysfs performance: 

I have not addressed the slowdown problem.  But it is good to hear
that it exists and that people care.  I thought sysfs was going to
slow things down.

My immediate goal is to reduce the locking complexity to that found
within /proc.

> 1) store a name hash with each entry, and compare the hash result before
> comparing the entire name
> 2) create a per-directory hash table.
>
> full_name_hash() can be improved by replacing the hash, for example as
> follows. 
> Old:
> 	return (prevhash + (c << 4) + (c >> 4)) * 11;
> New:
> 	return (prevhash + c) * 41;

At least with the sanity checking turned on.  sysctl will also have
slowdowns that are more significant than sysfs when creating network
devices.  So that should be addressed as well.

Eric
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list