From: Jens Axboe <axboe@kernel.dk>
To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Cc: Jens Axboe <axboe@kernel.dk>
Subject: [PATCH 1/4] eventpoll: cleanup branches around sleeping for events
Date: Fri, 7 Oct 2022 10:56:34 -0600 [thread overview]
Message-ID: <20221007165637.22374-2-axboe@kernel.dk> (raw)
In-Reply-To: <20221007165637.22374-1-axboe@kernel.dk>
Rather than have two separate branches here, collapse them into a single
one instead. No functional changes here, just a cleanup in preparation
for changes in this area.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
fs/eventpoll.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 8b56b94e2f56..8a75ae70e312 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -1869,14 +1869,15 @@ static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events,
* important.
*/
eavail = ep_events_available(ep);
- if (!eavail)
+ if (!eavail) {
__add_wait_queue_exclusive(&ep->wq, &wait);
-
- write_unlock_irq(&ep->lock);
-
- if (!eavail)
+ write_unlock_irq(&ep->lock);
timed_out = !schedule_hrtimeout_range(to, slack,
HRTIMER_MODE_ABS);
+ } else {
+ write_unlock_irq(&ep->lock);
+ }
+
__set_current_state(TASK_RUNNING);
/*
--
2.35.1
next prev parent reply other threads:[~2022-10-07 16:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-07 16:56 [PATCHSET RFC 0/4] Add support for epoll min_wait Jens Axboe
2022-10-07 16:56 ` Jens Axboe [this message]
2022-10-07 16:56 ` [PATCH 2/4] eventpoll: split out wait handling Jens Axboe
2022-10-07 16:56 ` [PATCH 3/4] eventpoll: move expires to epoll_wq Jens Axboe
2022-10-07 16:56 ` [PATCH 4/4] eventpoll: add support for min-wait Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221007165637.22374-2-axboe@kernel.dk \
--to=axboe@kernel.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).