From nobody Thu Sep 18 23:12:12 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5FF17C4321E for ; Thu, 1 Dec 2022 18:12:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229705AbiLASMZ (ORCPT ); Thu, 1 Dec 2022 13:12:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230218AbiLASMI (ORCPT ); Thu, 1 Dec 2022 13:12:08 -0500 Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BA7AA1C0A for ; Thu, 1 Dec 2022 10:12:08 -0800 (PST) Received: by mail-io1-xd2e.google.com with SMTP id n188so1570042iof.8 for ; Thu, 01 Dec 2022 10:12:08 -0800 (PST) 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=+7XieXpcJrzhapQHtWCNoW0rQy5yiKhkq34SDOyw0xw=; b=rCV2KahuRSA2UomgHjcLL2MPSHWQzvEOZHnqXl9CNih1pE+gZRpjzdYg3AGoNxGtH/ lrwbTserdKCot3tq/5ePqPYHCEDByLsr5EJeyAa3WUpPRYldyDwDb72H4U+e7EULEDfX YOz044AliNTRJSeVBbissUP76TH1dDpAxrwe5pgd94G4wvCJ4IeVnDfJhMx47sKWeWPs 0C7kWE1xTeT+Dx73CkQ/oLdCov1SSDwhGCyL0CKWRohvyTJvqo4qo5nur82aLKeNrnxf rQRbX7ukSMrqtcrZIvRHBe9oddDEKsDHVoB5vCoS6H8vIAXT8EF6vPM5WVzceR1ifqHH kwow== 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=+7XieXpcJrzhapQHtWCNoW0rQy5yiKhkq34SDOyw0xw=; b=ECi0HhtZe8LEBgsi6nEXZ2dzxsh3uzYYE7KRVome7IhNOqEutPwIdNHRjHihNtaILC GukkJjarid8/Sq/bRhfOxqlVMYLZWzTQ39wAMTrnrQp26nnAmG6YQvbhAIRZSd5bAh3e s+OA1K8DH/z2lG2jdpLQXz4gdhAtWAPiviJGSBH4Sv1zrlPSUtaueM9vkZsw4aCdCLWQ +iYFIvSIRtquRc80ZwWpH6uxMZ/JUFkm4DUJ8Wgs6XQtISGIPhpWwGStOuD/EZ4WjIg+ VhTRlCJKWQnkDkpFgMGvIk3lbtzZLIucBQ3FZthHauWelHI8pPbAv9QmHAyZq+LHl2U+ +aVA== X-Gm-Message-State: ANoB5plKH2CiAggMn5sW2lsOfyuajFY+c5i1S66NkZZDPWbxcvbFLNqI JeBlwhz+YwE6EoDYBJk7c9kbfcO96Knf9rLM X-Google-Smtp-Source: AA0mqf74WtcWLOBknC51Eqq2LhOOyGElfDAy+jSdzXDD60HRlSEZEkNsL3iTmtYnZTNrl5XL3BCV9A== X-Received: by 2002:a02:a710:0:b0:389:d089:4233 with SMTP id k16-20020a02a710000000b00389d0894233mr12448957jam.18.1669918327697; Thu, 01 Dec 2022 10:12:07 -0800 (PST) Received: from m1max.localdomain ([207.135.234.126]) by smtp.gmail.com with ESMTPSA id y21-20020a027315000000b00374fe4f0bc3sm1842028jab.158.2022.12.01.10.12.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 10:12:07 -0800 (PST) From: Jens Axboe To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: soheil@google.com, willemdebruijn.kernel@gmail.com, stefanha@redhat.com, Jens Axboe Subject: [PATCH 4/7] eventpoll: move expires to epoll_wq Date: Thu, 1 Dec 2022 11:11:53 -0700 Message-Id: <20221201181156.848373-5-axboe@kernel.dk> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221201181156.848373-1-axboe@kernel.dk> References: <20221201181156.848373-1-axboe@kernel.dk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This makes the expiration available to the wakeup handler. No functional changes expected in this patch, purely in preparation for being able to use the timeout on the wakeup side. Signed-off-by: Jens Axboe --- fs/eventpoll.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 888f565d0c5f..0994f2eb6adc 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -1765,6 +1765,7 @@ static int ep_autoremove_wake_function(struct wait_qu= eue_entry *wq_entry, struct epoll_wq { wait_queue_entry_t wait; struct hrtimer timer; + ktime_t timeout_ts; bool timed_out; }; =20 @@ -1825,7 +1826,7 @@ static int ep_poll(struct eventpoll *ep, struct epoll= _event __user *events, { int res, eavail; u64 slack =3D 0; - ktime_t expires, *to =3D NULL; + ktime_t *to =3D NULL; struct epoll_wq ewq; =20 lockdep_assert_irqs_enabled(); @@ -1834,7 +1835,7 @@ static int ep_poll(struct eventpoll *ep, struct epoll= _event __user *events, =20 if (timeout && (timeout->tv_sec | timeout->tv_nsec)) { slack =3D select_estimate_accuracy(timeout); - to =3D &expires; + to =3D &ewq.timeout_ts; *to =3D timespec64_to_ktime(*timeout); } else if (timeout) { /* --=20 2.35.1