Thread (5 messages) 5 messages, 5 authors, 2021-09-16

Re: [PATCH 16/20] futex: Implement sys_futex_waitv()

flat view

From: Arnd Bergmann <arnd@arndb.de>
Date: 2021-09-15 18:48:13
Also in: lkml

On Wed, Sep 15, 2021 at 5:39 PM Peter Zijlstra [off-list ref] wrote:
On Wed, Sep 15, 2021 at 04:07:26PM +0200, Peter Zijlstra wrote:
quoted
+SYSCALL_DEFINE4(futex_waitv, struct futex_waitv __user *, waiters,
+             unsigned int, nr_futexes, unsigned int, flags,
+             struct __kernel_timespec __user *, timo)
So I utterly detest timespec.. it makes no sense what so ever.

Can't we just, for new syscalls, simply use a s64 nsec argument and call
it a day?

Thomas, Arnd ?
Do you mean passing the nanoseconds by value instead of a pointer?
I think that would be worse, since that means having incompatible calling
conventions between 32-bit and 64-bit architectures, and even
between 32-bit architectures that have different requirements for 64-bit
function arguments.

If we pass it by reference, there is much less to gain from changing the
timespec to plain nanoseconds. I wouldn't object to that, but I don't
see it helping much either. It would work for relative timeouts, but the
general trend seems to be to specify timeouts as absolute times,
and that would force each caller to read the time using clock_gettime()
and then convert it to nanoseconds before adding the timeout.

Specifying the timeout in terms of 32-bit relative milliseconds would the
way that epoll() does would be really simple, but that still feels odd.

        Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help