From patchwork Mon Nov 21 20:50:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khalid Elmously X-Patchwork-Id: 1707553 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=rHQcyiKl; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NGKKP5y1Qz23nl for ; Tue, 22 Nov 2022 07:50:32 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1oxDkD-0006EK-Od; Mon, 21 Nov 2022 20:50:21 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1oxDkC-0006Du-B0 for kernel-team@lists.ubuntu.com; Mon, 21 Nov 2022 20:50:20 +0000 Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 0B2D23F328 for ; Mon, 21 Nov 2022 20:50:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1669063818; bh=cGRwdTPeoE7xwrUDTemkWBSP1y9DZrlGQQDyTBn+Suk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rHQcyiKlnBj5AIyCosvYn3C6vR6iHhk60RHTlst8YFGWaXTrq6okqZkEVzWqwlMgU OfyeJ+p27kdZZHbVfQqUhV1j8rld0b4EMGf9vArOXE2HemNjGeBoFmAmfxni++6WF4 fCnFOw4G1alhN9go+x91/47E9Di0gdXnHT3jYBMxKtr4y6OcqvqtXFYnm1VaYWB44x 8Dabhg6M18c6sx9ZEC0WJrMVKkT/cMCL2opu2N5oyzPjmNQbzRBJHFcWmL39hVyonm Es2XR+jU67Oa2Siqtd8SxF8+7gkl9yGbPdxctqzNJraJOgNa/QDxTjq7TOx+MI8fN5 doP1hBPPTpPGw== Received: by mail-qv1-f69.google.com with SMTP id g15-20020ad4510f000000b004c6ad31b146so3406346qvp.1 for ; Mon, 21 Nov 2022 12:50:18 -0800 (PST) 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=cGRwdTPeoE7xwrUDTemkWBSP1y9DZrlGQQDyTBn+Suk=; b=76LrmKlBPiMGZ/7U6fXfeZbGRJQIxZu/cZewSQrcgTRyvm+E2125zPzZZS7xwCct3a Gk9wNgEb5kc4B8BFhws5ZeOFvEfC46dvXE4s/8GkN9eeFAVFF2/OrIh3MfFw65RHLj/y tQ80+cuc+ViSXPPhxWGWMWFYIvFOYh4fEgVrgI6UhFYSk6fb7wEmYodqCC3+Il/fUZMa gUpiqcdCBl7vrGq9AAvGbOX9wshiZm7U+eNP01y1OhH9N0aciwmigRrqOtamCWG/IYWt JHulMMAgPHUUe2uod3aSxHpHBy1iN069acKNSyDVYWk57lk1K0qMjdkhYhlVSPuB73+i iTXw== X-Gm-Message-State: ANoB5plR9ryZ0ZZFHU45gJhQf2yibTGoMjEt1/4tDhdIeE44xaSPA8bV A/RXb/fFC3R6JHhUFf3OtTvVD51dMYsu9jwv7fv0Wxf5NyoVA57EGQIr0/tD9CLRJVPoE5B7N63 2y/IocRAuOLaXM1hEsSMBAaFDN0GWGs7AY4R0XIN3fg== X-Received: by 2002:ad4:4482:0:b0:4b1:9daa:b53e with SMTP id m2-20020ad44482000000b004b19daab53emr19278188qvt.79.1669063817089; Mon, 21 Nov 2022 12:50:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf5GTatinaq+CfCsOp6pMGjB3FkvWHZvO6Shr+aQO65EZjueCobdp4SkK1oFDie4COhtB9HCJg== X-Received: by 2002:ad4:4482:0:b0:4b1:9daa:b53e with SMTP id m2-20020ad44482000000b004b19daab53emr19278165qvt.79.1669063816770; Mon, 21 Nov 2022 12:50:16 -0800 (PST) Received: from k2.fuzzbuzz.org ([38.147.253.164]) by smtp.gmail.com with ESMTPSA id cb7-20020a05622a1f8700b0039cc0fbdb61sm7239673qtb.53.2022.11.21.12.50.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Nov 2022 12:50:16 -0800 (PST) From: Khalid Elmously To: kernel-team@lists.ubuntu.com Subject: [SRU][Focal][PATCH] Revert "epoll: autoremove wakers even more aggressively" Date: Mon, 21 Nov 2022 15:50:03 -0500 Message-Id: <20221121205005.86011-2-khalid.elmously@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221121205005.86011-1-khalid.elmously@canonical.com> References: <20221121205005.86011-1-khalid.elmously@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1996678 This reverts commit bcf91619e32fe584ecfafa49a3db3d1db4ff70b2. --- fs/eventpoll.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 7e11135bc915c..339453ac834cc 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -1803,21 +1803,6 @@ static inline struct timespec64 ep_set_mstimeout(long ms) return timespec64_add_safe(now, ts); } -/* - * autoremove_wake_function, but remove even on failure to wake up, because we - * know that default_wake_function/ttwu will only fail if the thread is already - * woken, and in that case the ep_poll loop will remove the entry anyways, not - * try to reuse it. - */ -static int ep_autoremove_wake_function(struct wait_queue_entry *wq_entry, - unsigned int mode, int sync, void *key) -{ - int ret = default_wake_function(wq_entry, mode, sync, key); - - list_del_init(&wq_entry->entry); - return ret; -} - /** * ep_poll - Retrieves ready events, and delivers them to the caller supplied * event buffer. @@ -1895,15 +1880,8 @@ static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events, * normal wakeup path no need to call __remove_wait_queue() * explicitly, thus ep->lock is not taken, which halts the * event delivery. - * - * In fact, we now use an even more aggressive function that - * unconditionally removes, because we don't reuse the wait - * entry between loop iterations. This lets us also avoid the - * performance issue if a process is killed, causing all of its - * threads to wake up without being removed normally. */ init_wait(&wait); - wait.func = ep_autoremove_wake_function; write_lock_irq(&ep->lock); __add_wait_queue_exclusive(&ep->wq, &wait); write_unlock_irq(&ep->lock);