From patchwork Mon Nov 21 22:05:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khalid Elmously X-Patchwork-Id: 1707565 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=uh9cKz3I; 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 4NGM0L62Nzz23nk for ; Tue, 22 Nov 2022 09:05:54 +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 1oxEvE-0003DS-8q; Mon, 21 Nov 2022 22:05:48 +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 1oxEvB-0003Bu-8C for kernel-team@lists.ubuntu.com; Mon, 21 Nov 2022 22:05:45 +0000 Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) (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 AAFCE3F333 for ; Mon, 21 Nov 2022 22:05:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1669068344; bh=D4Lt7YBkbQt7eiDJa7ESm6d8Qj89ht5W5EY3dYnC4TM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=uh9cKz3IVUlc4Ez1ZUc+yQg9SUwDVDEfGsscDVXnACS+apBR008Z0HULvFBOHKQTx Uu6Bz/AvYyTJ9tqpOdUjBjGQWY2rOsxynmKv+D/o2NkzO9NuvL5Xm3ucpVw9ar28hr xgVlDZDxXIN5XYvVBADfrftE/qkcTkvSAriRz1S+KzOBWp6k9xt6gYs0JMmlZFLqgb X9gZISBD4RUDpB65C+b4cYbvGvEcJklGPvKfFfpXAWy/iygcCZrSde5iY7D2+fez6K pKPsZv3vFxfTbheHfLd/OfnIkSo+6W0PHkm03PYz3WffEiUu6T7BBlUXIAKVWEoZaS Lb9XnAmE3agxQ== Received: by mail-qt1-f197.google.com with SMTP id i4-20020ac813c4000000b003a5044a818cso13133452qtj.11 for ; Mon, 21 Nov 2022 14:05:44 -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=D4Lt7YBkbQt7eiDJa7ESm6d8Qj89ht5W5EY3dYnC4TM=; b=o0E4hoNMgflOcAs0rvfJtu8p4YN4n+ZBgrxpnS46B78odRRbbUAXFohkebwCIoGuCP L+nTTsshx/b+EGt27Acf6bvoHyB8Pu9jrtMPiLDOTzsxKkt85Kx3I4KHYov2oWWbLclK w+95R2g2PiReh0hVfbm+Csyk0rr1jVqCSjyjWe+3mbRtlUJbY7bdBZXkK9z6phJUk1FW tSC61nXIkVZV71kO1Hqe/N0oSH4d+w2QRYnVi1EgfrNU584YXoNaP4A+WUsI2p2+pGJ4 tnNs1AnIWhecsQK5O+Z4YLSlMe3LxG+XXpAtjpj4siqzsfj9TIdacGTl8JaJILjHG5LR 2ORA== X-Gm-Message-State: ANoB5pnKYGo1+ufDtHax5YS4W2QZIF4IZ9lQ2NK1DmJWNySE6pcWILIn Fp6MWYg7yCePRfBShNtPxHfY8+AgXS/AdkKI0mypdC3TCOiTmrTwz0AThV2RmSNHg+K94Sg36J/ GXMkOhVzyZJQt/XdYFkyKFjBLIFo0Zhl8ZUis37+pUw== X-Received: by 2002:a0c:ff28:0:b0:4b8:6953:aed6 with SMTP id x8-20020a0cff28000000b004b86953aed6mr4287524qvt.47.1669068343629; Mon, 21 Nov 2022 14:05:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf7UrtwfxfgO3c5GERnDMhf1jXMVTHoGytRpI8OasOhYecbLUaVxv0nTvyaaQGxjxXKjwrWEiQ== X-Received: by 2002:a0c:ff28:0:b0:4b8:6953:aed6 with SMTP id x8-20020a0cff28000000b004b86953aed6mr4287475qvt.47.1669068343114; Mon, 21 Nov 2022 14:05:43 -0800 (PST) Received: from k2.fuzzbuzz.org ([38.147.253.164]) by smtp.gmail.com with ESMTPSA id bq30-20020a05620a469e00b006ef1a8f1b81sm9072600qkb.5.2022.11.21.14.05.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Nov 2022 14:05:42 -0800 (PST) From: Khalid Elmously To: kernel-team@lists.ubuntu.com Subject: [SRU][Jammy][PATCH 1/1] Revert "epoll: autoremove wakers even more aggressively" Date: Mon, 21 Nov 2022 17:05:33 -0500 Message-Id: <20221121220534.87601-3-khalid.elmously@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221121220534.87601-1-khalid.elmously@canonical.com> References: <20221121220534.87601-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 697e78d7d185f0fa4b3c97c5119dd266094a1e70. Signed-off-by: Khalid Elmously --- fs/eventpoll.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/fs/eventpoll.c b/fs/eventpoll.c index cf326c53db0f..06f4c5ae1451 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -1740,21 +1740,6 @@ static struct timespec64 *ep_timeout_to_timespec(struct timespec64 *to, long ms) return to; } -/* - * 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. @@ -1836,15 +1821,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); /*