Re: [take12 0/3] kevent: Generic event handling mechanism.

Andrew Morton
2006-08-23T16:10:42Z

On Wed, 23 Aug 2006 11:50:56 +0400
Evgeniy Polyakov <johnpol@2ka.mipt.ru> wrote:

> On Wed, Aug 23, 2006 at 12:07:58AM -0700, Andrew Morton (akpm@osdl.org) wrote:
> > On Wed, 23 Aug 2006 10:56:59 +0400
> > Evgeniy Polyakov <johnpol@2ka.mipt.ru> wrote:
> >
> > > On Wed, Aug 23, 2006 at 02:43:50AM +0200, Jari Sundell (sundell.software@gmail.com) wrote:
> > > > Actually, I didn't miss that, it is an orthogonal issue. A timespec
> > > > timeout parameter for the syscall does not imply the use of timespec
> > > > in any timer event, etc. Nor is there any timespec timer in kqueue's
> > > > struct kevent, which is the only (interface related) thing that will
> > > > be exposed.
> > >
> > > void * in structure exported to userspace is forbidden.
> > > long in syscall requires wrapper in per-arch code (although that
> > > workaround _is_ there, it does not mean that broken interface should
> > > be used).
> > > poll uses millisecods - it is perfectly ok.
> >
> > I wonder whether designing-in a millisecond granularity is the right thing
> > to do. If in a few years the kernel is running tickless with high-res clock
> > interrupt sources, that might look a bit lumpy.
> >
> > Switching it to a __u64 nanosecond counter would be basically free on
> > 64-bit machines, and not very expensive on 32-bit, no?
>
> I can put nanoseconds as timer interval too (with aligned_u64 as David
> mentioned), and put it for timeout value too - 64 bit nanosecods ends up
> with 58 years, probably enough.
> Structures with u64 a really not so good idea.
>

OK. One could do u32 seconds/u32 nsecs, but a simple aligned_u64 will be
better for 64-bit machines, and OK for 32-bit.