lkml.org 
[lkml]   [2008]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Improve scalability of epoll_ctl
From
Date
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


\
 
 \ /
  Last update: 2008-01-08 17:59    [W:0.040 / U:5.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site