lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b3f268590608221214l45bb6ad6meccfba99b89710a0@mail.gmail.com>
Date:	Tue, 22 Aug 2006 21:14:30 +0200
From:	"Jari Sundell" <sundell.software@...il.com>
To:	"Evgeniy Polyakov" <johnpol@....mipt.ru>
Cc:	"Nicholas Miell" <nmiell@...cast.net>,
	lkml <linux-kernel@...r.kernel.org>,
	"David Miller" <davem@...emloft.net>,
	"Ulrich Drepper" <drepper@...hat.com>,
	"Andrew Morton" <akpm@...l.org>, netdev <netdev@...r.kernel.org>,
	"Zach Brown" <zach.brown@...cle.com>,
	"Christoph Hellwig" <hch@...radead.org>
Subject: Re: [take12 0/3] kevent: Generic event handling mechanism.

On 8/22/06, Evgeniy Polyakov <johnpol@....mipt.ru> wrote:
> > Not to mention the name used causes (at least me) some confusion with BSD's
> > kqueue implementation. Skimming over the patches it actually looks somewhat
> > like kqueue with the more interesting features removed, like the ability to
> > pass the filter changes simultaneously with polling.
>
> I do not understand, what do you mean?
> It is obviously allowed to poll and change kevents at the same time.

Changing kevents are done with a separate system call from polling
afaics, thus every change requires a context switch. This in contrast
to BSD's kqueue which allows user-space to pass the changes when
kevent (polling) is called.

It may also choose to update the filters immediately with the same call.

> > Maybe this is a topic that will singe my fur, but what is wrong with the
> > kqueue API? Will I really have to implement support for yet another event
> > API in my program.
>
> Why did I not implemented it like Solaris did?
> Or FreeBSD did?
> It was designed with features mention on AIO homepage in mind, but not
> to be compatible with some other implementation.
> And why should it be?

If it can be, why should it not be? At least, if you reinvent the
wheel its advantages should be obvious.

Considering that kqueue is available on more popular OSes like darwin
it would ease portability greatly if there was a shared event API.
That is, unless you think there's something fundamentally wrong with
their design.

Your interface:

+asmlinkage long sys_kevent_get_events(int ctl_fd, unsigned int min,
unsigned int max,
+               unsigned int timeout, void __user *buf, unsigned flags);
+asmlinkage long sys_kevent_ctl(int ctl_fd, unsigned int cmd, unsigned
int num, void __user *buf);

BSD's kqueue:

struct kevent {
  uintptr_t ident;        /* identifier for this event */
  short     filter;       /* filter for event */
  u_short   flags;        /* action flags for kqueue */
  u_int     fflags;       /* filter flag value */
  intptr_t  data;         /* filter data value */
  void      *udata;       /* opaque user data identifier */
};

int kevent(int kq, const struct kevent *changelist, int nchanges,
struct kevent *eventlist, int nevents, const struct timespec
*timeout);

The only thing missing in BSD's kevent is the min/max parameters, the
various filters in kevent_get_events either have equivalent filters or
could be added as extensions. (I didn't look too carefully through
them)

On the other hand, your API lacks the ability to pass changes when
polling, as mentioned above. It would be preferable if the timeout
parameter was either timespec or timeval.

Rakshasa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ