lkml.org 
[lkml]   [2020]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 1/2] epoll: add nsec timeout support with epoll_pwait2
On Thu, Nov 19, 2020 at 09:19:35AM -0500, Willem de Bruijn wrote:
> But for epoll, this is inefficient: in ep_set_mstimeout it calls
> ktime_get_ts64 to convert timeout to an offset from current time, only
> to pass it to select_estimate_accuracy to then perform another
> ktime_get_ts64 and subtract this to get back to (approx.) the original
> timeout.
>
> How about a separate patch that adds epoll_estimate_accuracy with
> the same rules (wrt rt_task, current->timer_slack, nice and upper bound)
> but taking an s64 timeout.
>
> One variation, since it is approximate, I suppose we could even replace
> division by a right shift?
>
> After that, using s64 everywhere is indeed much simpler. And with that
> I will revise the new epoll_pwait2 interface to take a long long
> instead of struct timespec.

I think the userspace interface should take a struct timespec
for consistency with ppoll and pselect. And epoll should use
poll_select_set_timeout() to convert the relative timeout to an absolute
endtime. Make epoll more consistent with select/poll, not less ...

\
 
 \ /
  Last update: 2020-11-19 15:32    [W:1.071 / U:0.984 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site