Messages in this thread |  | | From | "Mike Jagdis" <> | Date | Mon, 30 Oct 2000 22:22:28 -0000 |
| |
Here's something I did last year and then put on ice, partly through lack of time and partly because I thought I'd pick it up for 2.5.
All this talk of event queues misses one thing: we already have an event queue mechanism. They're called wait queues. The only problem is that the only on-event action possible is to wake the process (assuming it was asleep in the first place). This patch firstly extends the wait queue mechanism to allow an arbitrary action to be performed. Then I rewrote the select/poll implementation to use event queueing to avoid rescanning descriptors that had not changed - and restructured the loops to be rather more efficient. This approach doesn't need any changes to driver poll routines, it doesn't need backwards mapping struct files. It should be fairly easy to implement a /dev/poll mechanism using this, although I haven't yet.
Yes, the change to wait queues has a slight cost, but it isn't great and the main part of it only happens if you actually sleep.
Performance graphs and the lmbench derived test programs I used are at http://www.purplet.demon.co.uk/linux/select/ (bounce in and out of the index page 'cos the next and prev buttons aren't wired up :-) )
Oh, and I updated this patch for 2.4.0-test9.
Comments and opinions are, as always, welcome :-).
Mike [unhandled content-type:application/octet-stream] |  |