From: ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org (Eric W. Biederman)
To: groeck-gvzKVTG1yJJBDgjK7y7TUQ@public.gmane.org
Cc: "containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org"
<containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org>,
Tejun Heo <htejun-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: Performance of netns with sysfs
Date: Thu, 15 Jan 2009 20:35:28 -0800 [thread overview]
Message-ID: <m1sknjvpf3.fsf@frodo.ebiederm.org> (raw)
In-Reply-To: <1232055472.6398.100.camel@groeck-laptop> (Guenter Roeck's message of "Thu, 15 Jan 2009 13:37:52 -0800")
Guenter Roeck <groeck-gvzKVTG1yJJBDgjK7y7TUQ@public.gmane.org> 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
prev parent reply other threads:[~2009-01-16 4:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-15 20:57 Performance of netns with sysfs Dan Smith
[not found] ` <87ocy8thhj.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
2009-01-15 21:37 ` Guenter Roeck
2009-01-15 21:48 ` Dan Smith
2009-01-16 4:35 ` Eric W. Biederman [this message]
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=m1sknjvpf3.fsf@frodo.ebiederm.org \
--to=ebiederm-as9lmozglivwk0htik3j/w@public.gmane.org \
--cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
--cc=groeck-gvzKVTG1yJJBDgjK7y7TUQ@public.gmane.org \
--cc=htejun-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/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