From patchwork Sun Oct 30 22:01:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 13069 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1981836wru; Sun, 30 Oct 2022 15:03:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6STB0WvwAg2vYNgWSDgbN3UaTQqSEplvcgXY53kiumqZzUQ4aiJpav7FyKg7Z8ly7ZsI9U X-Received: by 2002:a63:8643:0:b0:462:9b02:a0c1 with SMTP id x64-20020a638643000000b004629b02a0c1mr9909905pgd.536.1667167439562; Sun, 30 Oct 2022 15:03:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667167439; cv=none; d=google.com; s=arc-20160816; b=cYMMCkarSpo4YagrfH0L3s9hbNOewLSD3QH3g2ipAuHO2ghQspI8p8h64zn1lAjXPI sMMre5nUU0zyhUt325+qCpOt3RcYxcfxPWHt1b4V5+pR5bepSfLZxUAQg4inshmtItTI x+TxEs1zcwIKBWuMRhfu+ZrktmOHzwTo4wnP+vwf8fwvqq6xf6XGibVUKQN3u4euKqz3 KGNWvhrqBMyTX/OnOiTkYGo5+7M6waCw59sGXFUK0MBbQVs5QZyJDLe7354JbqpPPb4V WZAYbbryOx1K9gUg0bjG3DRkED08s1lpHzPqcBB5Xf0gp9hMxa2qoNuiTjWgt+LE2p1n dEyA== 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=TCMSGu8wCAuxi+YEaeqt2Nm6ljarPNoUCebXSLfB1Fw=; b=uvcKrFWF7cAzGogJHiHGqevnoLoUIMLApkPmaebhNKvMaIB+gtFxXEjw87Zio1X7Jk ub+1OGFQKSn1CyaV5hfI6mZKNd/3xvYxIUkPY93uDhgfASWgia6xYdgcZ91rvCFPKXog 6553fJH9416A/F4piqxUL9kQqrsHsYnHZ0i8+6RhKWj2X1bt+audi5EJ+d1rty+GAPYi sikuSR07f1+khe1Q5UeRW0MdDhHnBk1GUshffhYc4qiz3FbbHASkXlnbb/czGFgK0SHa kE8K7NEAEpkBFI5w4GGwL84l8CiYOyffqDGU2FYOtgt1XR7p9XrZaEeXeb92PKtsc0HR tNJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=H1OQbWeL; 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 v70-20020a638949000000b0046ec3bd90bbsi6077622pgd.60.2022.10.30.15.03.41; Sun, 30 Oct 2022 15:03:59 -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=H1OQbWeL; 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 S229996AbiJ3WCe (ORCPT + 99 others); Sun, 30 Oct 2022 18:02:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229954AbiJ3WCQ (ORCPT ); Sun, 30 Oct 2022 18:02:16 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30E1FAE60 for ; Sun, 30 Oct 2022 15:02:10 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id f23so9228740plr.6 for ; Sun, 30 Oct 2022 15:02:10 -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=TCMSGu8wCAuxi+YEaeqt2Nm6ljarPNoUCebXSLfB1Fw=; b=H1OQbWeLIKTClEI0Y18BCREEaUPyB4u9aov6gnRCwP3FMlWoDhoOyrQj9dTUw8f7Rl Lnc+rX7GLGtNIG7+mOPq5mJ218zFKXipmPROig7C1ec18KZ542PUt0JccxGsjh5HO1a0 /z8kUmiSoWowwx6pl7CmnUz6U/WQmRT/NWSJGgn5Kjr93Rcz9iCWvN5ozoSLbcjCLLaW vQSLjW+N399VOHIFg9wUxuq3+NKkDgXzX84jiBotca1ufvXrHs73a7xFaaZLJbSrPgpF kI9+im4ilsx5ns6Kwr6KHXhyinzcJ9zfi1ofygZp48zSk618zFDCdZssNjQg3mnekR5P YICw== 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=TCMSGu8wCAuxi+YEaeqt2Nm6ljarPNoUCebXSLfB1Fw=; b=ZA0ePgo1TNywxC70BsmKi1e1pdahfCqQ1oTLebS2BtlaegboAMN0ZA2BxVxBz7yMeD oOYq9N2BXme3XJ+EEAIO+7KTxFAXyP0JVn2/vcaCKQtyRofikhbv4jGBY2sb8jS+KLaa Tn8h8yDN0XHDqlQQ2x7caAjdpEtcJGwk+ufJRLuRe9t3DxG2zAwI70JisY/c/AEB2ZP3 zjPpAsQkiThCNzKQDS1XexiShSjObJWp3cYE1ZsPEqbbNrH0D+X6oCVLzoBgBLxsgMdU 6ahRKVMucvxgaSGEQ+rA+a7VQAYOEXi8ZB4zfwFWXw0b1i149a38inqLRR1ckgAN4XN3 Y46g== X-Gm-Message-State: ACrzQf15v70fv0u+TjepNY7hi3ob/AyX57YZz81o8vJsEqyeaasAQz1q A+fATDw+zf9B9J4idCsuqjxi9eswrb6NfCAs X-Received: by 2002:a17:90a:ca87:b0:212:d2bd:82f5 with SMTP id y7-20020a17090aca8700b00212d2bd82f5mr11677337pjt.203.1667167329708; Sun, 30 Oct 2022 15:02:09 -0700 (PDT) Received: from localhost.localdomain ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id y3-20020aa79e03000000b0056d73ef41fdsm562852pfq.75.2022.10.30.15.02.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Oct 2022 15:02:09 -0700 (PDT) From: Jens Axboe To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: Jens Axboe Subject: [PATCH 2/6] eventpoll: don't pass in 'timed_out' to ep_busy_loop() Date: Sun, 30 Oct 2022 16:01:59 -0600 Message-Id: <20221030220203.31210-3-axboe@kernel.dk> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221030220203.31210-1-axboe@kernel.dk> References: <20221030220203.31210-1-axboe@kernel.dk> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748151765014090295?= X-GMAIL-MSGID: =?utf-8?q?1748151765014090295?= It's known to be 'false' from the one call site we have, as we break out of the loop if it's not. Signed-off-by: Jens Axboe --- fs/eventpoll.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 3061bdde6cba..64d7331353dd 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -396,12 +396,12 @@ static bool ep_busy_loop_end(void *p, unsigned long start_time) * * we must do our busy polling with irqs enabled */ -static bool ep_busy_loop(struct eventpoll *ep, int nonblock) +static bool ep_busy_loop(struct eventpoll *ep) { unsigned int napi_id = READ_ONCE(ep->napi_id); if ((napi_id >= MIN_NAPI_ID) && net_busy_loop_on()) { - napi_busy_loop(napi_id, nonblock ? NULL : ep_busy_loop_end, ep, false, + napi_busy_loop(napi_id, ep_busy_loop_end, ep, false, BUSY_POLL_BUDGET); if (ep_events_available(ep)) return true; @@ -453,7 +453,7 @@ static inline void ep_set_busy_poll_napi_id(struct epitem *epi) #else -static inline bool ep_busy_loop(struct eventpoll *ep, int nonblock) +static inline bool ep_busy_loop(struct eventpoll *ep) { return false; } @@ -1826,7 +1826,7 @@ static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events, if (timed_out) return 0; - eavail = ep_busy_loop(ep, timed_out); + eavail = ep_busy_loop(ep); if (eavail) continue;