Message ID | 20221028214325.13496-2-axboe@kernel.dk |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1058934wru; Fri, 28 Oct 2022 14:48:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6nxUXcleX6iYTE2w/D1y4Nu3/050zFHVTglOFR6EPsQgXZ2JiARuDSyB7IciznoYcN3Wh2 X-Received: by 2002:a05:6402:ea8:b0:456:d188:b347 with SMTP id h40-20020a0564020ea800b00456d188b347mr1437979eda.15.1666993696517; Fri, 28 Oct 2022 14:48:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666993696; cv=none; d=google.com; s=arc-20160816; b=yuN35xyxz+29mxgkIqr9xNRFmjm9uPkNd/9oL1ou3ti1Pv7AABlX72OxzXYBWcnsE2 FcuUppEzSJxh+YgexrZOPYdD4y7HpApZp0IHuN+F7HbPqWO53Gv+EP41HEn501jKzaU9 HdX+V765tE/WPDcZ6nOtDHTf83zfx5cCNsglJW14yk5xA4S9RzuTUEcMxf3iLTRfH6k2 iZNuajZcnqGidEC5863URmkmddTUFFw1I9weLKEThCrLZ0JSMBSVifSTRL9kkzwdh53O HISFlbEG7gJICfv4KxbHY2B9/vQ62VeuqeEktOZWWZyxScPKO4UkDe0/FRKUK8PXZpSK CxBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8PHeEQvI03GO1u4arOs5eKGxrrWj+QcJXenB1+d+Ev4=; b=GhCgWBX9pDbWT96ZxcwHNV9fJ7zPzrGJhO56KQT+e/n0s9+qbJ+Ia/kA+9fzjCRCR+ KGY6mkAtp3SYHg+OO+hwX42LOo34CHUGBzoSAMjVrQ6y0oU5vqEx5m4UQ+7l0eeD2STA oC23MMf/NDBXL0N4L1lugq1kH9ztBJ9xaIbystzjBGhIvEPyuElxIWUD2M8lVvIJhpcP VqmvsnQ2aVznGv6cXIp1fNpIBE5kiLYJ0DDe4fzupVSX4n2Fn7N2EXmIRxVnC1ud/QLM yG6voJrDoXnDrpFeJfXsn9BCLtHznbwrW0WqhXpQCTRVYjB6PSSHX7ivqTpgZq3ybDTY 9LXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b="l/6HssGh"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bb6-20020a1709070a0600b007aacd494fe9si6041837ejc.311.2022.10.28.14.47.53; Fri, 28 Oct 2022 14:48:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b="l/6HssGh"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230054AbiJ1Vnk (ORCPT <rfc822;pusanteemu@gmail.com> + 99 others); Fri, 28 Oct 2022 17:43:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229919AbiJ1Vnc (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 28 Oct 2022 17:43:32 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EA5A23B692 for <linux-kernel@vger.kernel.org>; Fri, 28 Oct 2022 14:43:31 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id o7so2538124pjj.1 for <linux-kernel@vger.kernel.org>; Fri, 28 Oct 2022 14:43:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8PHeEQvI03GO1u4arOs5eKGxrrWj+QcJXenB1+d+Ev4=; b=l/6HssGhPRExvh/FxdFaGlFZfok/tFw3IcJbJihU0Wuk8reK2iRnYuAKeLKryPObFk 8+myno8kH2k+Mx/mhpfG6lxbkp75xrFHJBDOoc0Hi+nCjGGX5XPhIzioZiLQHdYG7m+Z zH6qRIKT7+DBebh6PfSCHHRhFyJrVib7ADoS1iUOnw26Fx2qSxnkfWZ15xoHpPi+Cfkc uX4D3Uu/y7LbtcBERELE4v/eGWzbk+A791IJM5YqSq27H4KLResQNlvAYGSZxE6iTCWr J4Bj2quMAldC3LRqMQU5FPn24iu+tqiGbbAVHn1An+yZFSmKvu/tseANxOGiRShg+W+1 BCrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8PHeEQvI03GO1u4arOs5eKGxrrWj+QcJXenB1+d+Ev4=; b=V+MFuoI/ORtSQNDSVam+37Ew8GI9mmxFfq93bZx3nB8lEJfQoT0wayYTBPV/LtR5Z3 58ZmAKu+5UXnTycWVS/yZ0ATGMF+n/R52rnFX6jWf0yalqlqhGe55Ke8H9hBAzMrQiY6 J4+nhvOLw9PSIBbJhxYj/rNZAcpY78rFQrMLR9AYyD1tgfdn1guLEXq8Wv7G3uTsjyl8 6B4D8Egmcsozup2TrutwsbvHBFOqaHmkVRNuqkywhNNyhgpYbus2PlKy21e0BsnsgmVB VwyGyVpDevOcNUKl/tdmtg1Da2MU3xsfKsz02jnQDh0144nutamKNaRX8o1ikXNxFHqZ 7V2w== X-Gm-Message-State: ACrzQf2W19a9SLrctZWKlgcN93DBxrT9OA4lIaMxnDNB291KtD50/fB7 08NU0bPNmrQpixIQ6m1LXw4s6bPKIWj9Tqld X-Received: by 2002:a17:902:f685:b0:186:fa9c:2fdc with SMTP id l5-20020a170902f68500b00186fa9c2fdcmr1086126plg.25.1666993410580; Fri, 28 Oct 2022 14:43:30 -0700 (PDT) Received: from localhost.localdomain ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id u6-20020a17090a1d4600b002130c269b6fsm2993855pju.1.2022.10.28.14.43.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 14:43:30 -0700 (PDT) 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/5] eventpoll: cleanup branches around sleeping for events Date: Fri, 28 Oct 2022 15:43:21 -0600 Message-Id: <20221028214325.13496-2-axboe@kernel.dk> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221028214325.13496-1-axboe@kernel.dk> References: <20221028214325.13496-1-axboe@kernel.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747969582237234331?= X-GMAIL-MSGID: =?utf-8?q?1747969582237234331?= |
Series |
Add support for epoll min_wait
|
|
Commit Message
Jens Axboe
Oct. 28, 2022, 9:43 p.m. UTC
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 52954d4637b5..3061bdde6cba 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); /*