From: Andi Kleen <andi@firstfloor.org>
To: Changli Gao <xiaosuo@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Improve scalability of epoll_ctl
Date: Tue, 08 Jan 2008 17:56:18 +0100 [thread overview]
Message-ID: <p73k5mkqmrx.fsf@bingen.suse.de> (raw)
In-Reply-To: <478397F7.1030005@gmail.com> (Changli Gao's message of "Tue\, 08 Jan 2008 23\:34\:15 +0800")
Changli Gao <xiaosuo@gmail.com> writes:
> Replace the epitem rbtree with a dynamic array to get the constant insertion/deletion/modification time of the file descriptors. Reuse the size argument of epoll_create, however the size must be smaller than the max file descriptor number: ether the resource limitation or the compiling time limitation.
Numbers, numbers, numbers on the improvement missing?
> + if (size < PAGE_SIZE / sizeof(struct epitem*)) {
> + ep->epi_array = kmalloc(msize, GFP_KERNEL);
> + ep->epi_array_size = size;
> + } else {
> + msize = PAGE_ALIGN(msize);
> + ep->epi_array = vmalloc(msize);
Are you sure it's faster? vmalloc/vfree can be quite slow because
they have to change the MMU state of the kernel and take global
locks.
The other problem is that on 32bit systems vmalloc space is somewhat
limited -- you might have added an unintended scaling limit.
-Andi
next prev parent reply other threads:[~2008-01-08 16:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-08 15:34 [PATCH] Improve scalability of epoll_ctl Changli Gao
2008-01-08 16:26 ` Eric Dumazet
2008-01-08 20:30 ` Davide Libenzi
2008-01-08 16:56 ` Andi Kleen [this message]
2008-01-09 1:20 ` Changli Gao
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=p73k5mkqmrx.fsf@bingen.suse.de \
--to=andi@firstfloor.org \
--cc=linux-kernel@vger.kernel.org \
--cc=xiaosuo@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox