Zbr's days.

About :: TODO :: Blog :: RSS :: Old blog :: Projects :: GIT :: Gallery :: Notes

Wed, 08 Nov 2006

Kevent updates.


Some kevent fixes for misteriously lived in the tree errors.
poll/select notifications were completely broken, which I was pointed to by Davide Libenzi.
I do not know, how it could happen, but probably during tree changes from old one, which contained network and FS AIO, to current I dropped some file updates.
I've fixed it and also changed a bit logic behind poll/select notifications - they are called with newly introduced KEVENT_REQ_LAST_CHECK flag, which if set allows to perform the last check on kevent (call appropriate callback) when kevent is marked as ready and has been removed from ready queue. If it will be confirmed that kevent is ready (k->callbacks.callback(k) returns true) then kevent will be copied to userspace, otherwise it will be requeued back to storage. Second (checking) call is performed with this bit _cleared_ so callback can detect when it was called from kevent_storage_ready() - bit is set, or kevent_dequeue_ready() - bit is cleared. If kevent will be requeued, bit will be set again.

Benchmarks compared to epoll() shows sightly better results, but it can be fluctuation and can be unrelated to that change.

I also created pipe/fifo notifications, but have not aggressively tested it yet, will do it tomorrow as long as release new kevent patchset with poll/select notifications fix.

/devel/kevent :: Link / Comments ()