Messages in this thread | | | Subject | Re: [PATCH] Improve scalability of epoll_ctl | From | Andi Kleen <> | Date | Tue, 08 Jan 2008 17:56:18 +0100 |
| |
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
| |