Skip to contentSkip to conversation

kevent: Generic event handling mechanism.

PATCH Jonathan Lemon 3 participants 7 messages Nov 3, 2006 – Nov 6, 2006

lore
Share & tools
lore
#0 lore raw

In article <local.mail.linux-kernel/[email protected]>,

Quoted 23 lines · Evgeniy Polyakov
Quoted 3 lines · Nate Diller

Are you saying that the *only* reason we choose not to be source-compatible with BSD is the 32 bit userland on 64 bit arch problem? I've followed every thread that gmail 'kqueue' search

I.e. do you want that generic event handling mechanism would not work on x86_64? I doubt you do.

Quoted 8 lines

returns, which thread are you referring to? Nicholas Miell, in "The Proposed Linux kevent API" thread, seems to think that there are no advantages over kqueue to justify the incompatibility, an argument you made no effort to refute. I've also read the Kevent wiki at linux-net.osdl.org, but it too is lacking in any direct comparisons (even theoretical, let alone benchmarks) of the flexibility, performance, etc. between the two.

Quoted 5 lines

I'm not arguing that you've done a bad design, I'm asking you to brag about the things you improved on vs. kqueue. Your emphasis on unifying all the different event types into one interface is really cool, fill me in on why that can't be effectively done with the kqueue compatability and I also will advocate for kevent inclusion.

Quoted 8 lines

kqueue just can not be used as is in Linux (_maybe_ *bsd has different types, not those which I found in /usr/include in my FC5 and Debian distro). It will not work on x86_64 for example. Some kind of a pointer or unsigned long in structures which are transferred between kernelspace and userspace is so much questionable, than it is much better even do not see there... (if I would not have so political correctness, I would describe it in a much different words actually).
So, kqueue API and structures can not be usd in Linux.

Let me be a little blunt here: that is just so much bullshit.

Yes, I understand the problem that 32-bit userspace on a 64-bit kernel has. Mea culpa - I didn't forsee this years ago, and none of my many reviewers caught it either. It was designed for 32/32 and 64/64, not 32/64.

However, this is trivially fixed by adding a union to the structure, as pointed out earlier on this list. Code would still be source compatible with any kqueue apps, which is what counts. Even NetBSD and FreeBSD have differing definitions of the kq constants, and nobody notices.

I really have no stake in this matter, so if you want to go invent a better mousetrap, more power to you. But don't claim that "kqueue can not be used on Linux"; this just makes you look foolish - I have code running on x86_64 that trivially disproves your statement.

Signature · 1 line
Jonathan
#1 lore raw

Hi!

Quoted 14 lines · Jonathan Lemon

In article <local.mail.linux-kernel/[email protected]>,

Quoted 9 lines · Evgeniy Polyakov

On Thu, Nov 02, 2006 at 11:40:43AM -0800, Nate Diller
kqueue just can not be used as is in Linux (_maybe_ *bsd has different types, not those which I found in /usr/include in my FC5 and Debian distro). It will not work on x86_64 for example. Some kind of a pointer or unsigned long in structures which are transferred between kernelspace and userspace is so much questionable, than it is much better even do not see there... (if I would not have so political correctness, I would describe it in a much different words actually).
So, kqueue API and structures can not be usd in Linux.

Let me be a little blunt here: that is just so much bullshit.

Quoted 8 lines

Yes, I understand the problem that 32-bit userspace on a 64-bit kernel has. Mea culpa - I didn't forsee this years ago, and none of my many reviewers caught it either. It was designed for 32/32 and 64/64, not 32/64.

However, this is trivially fixed by adding a union to the structure, as pointed out earlier on this list. Code would still be source compatible with any kqueue apps, which is what counts. Even NetBSD and FreeBSD have differing definitions of the kq constants, and nobody notices.

It has been show in this thread that kevent is too different to kqueue as is... but what are the advantages of kevent? Perhaps we should use kqueue on Linux, too (even if it means one more rewrite for you...?)

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#2 lore raw
Quoted 3 lines · Pavel Machek

It has been show in this thread that kevent is too different to kqueue as is... but what are the advantages of kevent? Perhaps we should use kqueue on Linux, too (even if it means one more rewrite for you...?)

Should we use *BSD VMM system when we have superiour Linux one?

P.S. Do not drop Cc: list.

Signature · 1 line
	Evgeniy Polyakov
#3 lore raw
Quoted 6 lines · Evgeniy Polyakov
Quoted 3 lines · Pavel Machek

It has been show in this thread that kevent is too different to kqueue as is... but what are the advantages of kevent? Perhaps we should use kqueue on Linux, too (even if it means one more rewrite for you...?)

Should we use *BSD VMM system when we have superiour Linux one?

Very different question; VMM system is not something that has userland API.

Can you explain why kevent is better than kqueue?

Quoted 1 line

P.S. Do not drop Cc: list.

It was not me who dropped cc list.

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#4 lore raw
Quoted 10 lines · Pavel Machek
Quoted 6 lines · Evgeniy Polyakov
Quoted 3 lines · Pavel Machek

It has been show in this thread that kevent is too different to kqueue as is... but what are the advantages of kevent? Perhaps we should use kqueue on Linux, too (even if it means one more rewrite for you...?)

Should we use *BSD VMM system when we have superiour Linux one?

Very different question; VMM system is not something that has userland API.

So what? We still create new things, which work better than old ones even if it requires 'to reinvent the wheel'.

It was shown too many times already why kqueue api can not be used in Linux.

Btw, if you want someone to rewrite something, you can start with mmaped based malloc for example. Why don't you want to do it - although API is the same, but underlying logic is different.

Quoted 1 line

Can you explain why kevent is better than kqueue?

According to my tests kevent is noticebly faster.
It is already too big flag that old system should not be used. And half of my previous mail to you shows why kevent is better/different from kqueue.

Signature · 1 line
	Evgeniy Polyakov
#5 lore raw

Hi!

Quoted 6 lines
Quoted 1 line

Can you explain why kevent is better than kqueue?

According to my tests kevent is noticebly faster.
It is already too big flag that old system should not be used. And half of my previous mail to you shows why kevent is better/different from kqueue.

You shown why it is _different_. How much faster is "noticebly faster"?

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#6 lore raw
Quoted 11 lines · Pavel Machek

Hi!

Quoted 6 lines
Quoted 1 line

Can you explain why kevent is better than kqueue?

According to my tests kevent is noticebly faster.
It is already too big flag that old system should not be used. And half of my previous mail to you shows why kevent is better/different from kqueue.

You shown why it is _different_. How much faster is "noticebly faster"?

It is different on purpose, don't you think?
If I will put all benchmark results in all mails, no one will read even half of it.

Here is conlusion section on kevent homepage where FreeBSD kqueue is compared with kevent (different NIC than recent Linux kevent tests, but there are links to old kevent benchamrks there):

"After various sysctls have been changed (sysctl -a output is available here) things become slightly better (btw, default FreeBSD installation does not allow such tests at all due to default network parameters), but number of "connection reset" errors is still very high. FreeBSD drops too many connections due to either misconfiguration or lack of resources.

According to FreeBSD and Linux comparison, in Linux number of connection errors is much smaller than in FreeBSD with comparable or bigger requests rate."

Briefly saying, FreeBSD kqueue behaves like Linux epoll, sometimes better (with small request rate), sometimes worse (with 3k simultaneous connections rate), and the latter was shown to behave worse than kevent.

Actually, Pavel, I do not understand your point. Why do you want to use *BSD subsystem even if it is impossible to have the same API? You want me to rewrite kevent so it would look like kqueue, but you did not know how it looks like, likely you did not know it's API (it uses switches of commands which are too much frowned upon in Linux kernel), you did not know what features kevent provides and what is present and what does not exist in kqueue.
So please point me to the magic Bodhi way which can enlighten me to think that completely different system, which works with completely different OS with completely different API, ABI and kernel internals, should be ported to Linux instead of creation new and superior system? When I become as luminous as you I will go and create new sendfile() system call which will have the same parameters as BSD. Or not, I will ask you to do it (actually not, why should we create something new, when there is BSD system which already has everything we want?).

Quoted 1 line

Pavel

Signature · 1 line
	Evgeniy Polyakov