From: Li Zefan <lizf@cn.fujitsu.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
containers@lists.linux-foundation.org,
Paul Menage <menage@google.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -mm 1/3] cgroup: use a hash table for css_set finding
Date: Thu, 03 Apr 2008 18:13:13 +0800 [thread overview]
Message-ID: <47F4ADB9.5040606@cn.fujitsu.com> (raw)
In-Reply-To: <47F48C69.2080805@cn.fujitsu.com>
>>> +static struct hlist_head *css_set_hash(struct cgroup_subsys_state *css[])
>>> +{
>>> + int i;
>>> + int index;
>>> + unsigned long tmp = 0UL;
>>> +
>>> + for (i = 0; i < CGROUP_SUBSYS_COUNT; i++)
>>> + tmp += (unsigned long)css[i];
>>> +
>> maybe css[i]'s lower 2-3 bits will be ignored. because thery are always 0.
>>
>> And I don't like "+" for hash. how about
>> ==
>> for (i = 0; i < CGROUP_SUBSYS_COUNT; i++)
>> unsigned long x;
>> x = (unsigned long)css[i];
>> tmp = (x >> 16) ^ (x & 0xffff)
>> ==
>> or some func, which uses full bits.
>>
>
> I'm using hash_long(), which has been proved to be a good one. And I've tested
> css_set_hash(), I run the css_set benchmark with N == 1000, the for loop in
> find_existing_css_set() will break out within 10 iterations for most cases,
> which is the expected result.
>
I just revised the css_set_hash() a bit, and It turned out we can improve the
scalability.
Thanks, KAMEZAWA-san.
next prev parent reply other threads:[~2008-04-03 10:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-03 5:52 [PATCH -mm 1/3] cgroup: use a hash table for css_set finding Li Zefan
2008-04-03 7:24 ` KAMEZAWA Hiroyuki
2008-04-03 7:51 ` Li Zefan
[not found] ` <47F48C69.2080805-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2008-04-03 10:13 ` Li Zefan
2008-04-03 10:17 ` Li Zefan
2008-04-03 10:13 ` Li Zefan [this message]
2008-04-03 10:17 ` Li Zefan
[not found] ` <20080403162459.4a90d574.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2008-04-03 7:51 ` Li Zefan
[not found] ` <47F470AB.2070904-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2008-04-03 7:24 ` KAMEZAWA Hiroyuki
-- strict thread matches above, loose matches on Subject: below --
2008-04-03 5:52 Li Zefan
2008-04-02 2:16 Li Zefan
[not found] ` <47F2EC8D.30805-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2008-04-02 10:23 ` Paul Menage
2008-04-02 10:23 ` Paul Menage
2008-04-02 2:16 Li Zefan
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=47F4ADB9.5040606@cn.fujitsu.com \
--to=lizf@cn.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=containers@lists.linux-foundation.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=menage@google.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.