Skip to content

Add support for epoll min_wait

Jens Axboe lkml netdev 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest7 patches 0 repliesNew
  2. v30 of 5 patches 23 repliesSuperseded
  3. v2 RFC5 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v1 RFC4 patches0 repliesSuperseded

Changes in v4 from the cover letter

- Split the ctl addition into separate patch
- Gate setup of min_wait on !ewq.timed_out
- Add comment on calling ctl with wait == 0 is a no-op

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7eventpoll: cleanup branches around sleeping for eventsfs/eventpoll.c+6 -50 replies
2/7eventpoll: don't pass in 'timed_out' to ep_busy_loop()fs/eventpoll.c+4 -40 replies
3/7eventpoll: split out wait handlingfs/eventpoll.c+55 -130 replies
4/7eventpoll: move expires to epoll_wqfs/eventpoll.c+3 -20 replies
5/7eventpoll: move file checking earlier for epoll_ctl()fs/eventpoll.c+16 -100 replies
6/7eventpoll: add support for min-waitfs/eventpoll.c+71 -130 replies
7/7eventpoll: add method for configuring minimum wait on epoll contextfs/eventpoll.c include/linux/eventpoll.h include/uapi/linux/eventpoll.h+14 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCHSET v4 0/7] Add support for epoll min_wait

Hi,

tldr - we saw a 6-7% CPU reduction with this patch. See patch 6 for full numbers.

This adds support for EPOLL_CTL_MIN_WAIT, which allows setting a minimum time that epoll_wait() should wait for events on a given epoll context. Some justification and numbers are in patch 6, patches 1-5 are really just prep patches or cleanups, and patch 7 adds the API to set min_wait.

I've decided against adding a syscall for this due to the following reasons:

1) We, Meta, don't need the syscall variant.
2) It's unclear how best to do a clean syscall interface for this. We're already out of arguments with the pwait/pwait2 variants.

With the splitting of the API into a separate patch, anyone who wishes to have/use a syscall interface would be tasked with doing that themselves.

No real changes in this release, just minor tweaks. Would appreciate some review on this so we can get it moving forward. I obviously can't start real deployments at Meta before I have the API upstream, or at least queued for upstream. So we're currently stuck in limbo with this.

Also available here:

https://git.kernel.dk/cgit/linux-block/log/?h=epoll-min_ts

Since v3:
- Split the ctl addition into separate patch
- Gate setup of min_wait on !ewq.timed_out
- Add comment on calling ctl with wait == 0 is a no-op

Signature · 1 line
Jens Axboe