From patchwork Tue Nov 22 20:02:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khalid Elmously X-Patchwork-Id: 1707988 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=fK7rcC8x; 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 4NGwCt33Mhz23nt for ; Wed, 23 Nov 2022 07:02:50 +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 1oxZTh-0000qC-7z; Tue, 22 Nov 2022 20:02:45 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1oxZTf-0000p4-I3 for kernel-team@lists.ubuntu.com; Tue, 22 Nov 2022 20:02:43 +0000 Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) (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-0.canonical.com (Postfix) with ESMTPS id 49D443F45D for ; Tue, 22 Nov 2022 20:02:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1669147363; bh=8zXwZewVrSoeA0YJbdzixOq5x/WJIJuLRn02W+VAQNU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fK7rcC8x2+6tK0sO0/OL+jqHpkIPG9IC2Wjj6M1JemitZuWZ2G733fAKLuKkziZ4Z 4sh7LxiYZIu66bC8ZWIiH6dTvNrUu/PFPrfg/eF0kMTvfwaJ/X+i2Kj+5vgnn+HZuY ezeqSHJ/QT2Qabpf+OgnPA0zDIFiKtOeuVMWJuJ+4X74J2cTm8DemkxJCNm3z9or7Z VxweXGjfSojUnlthSn4OD2HoMYsKU+EKzxrhg290trrDi9xWeCIb1oOS08MwfsDzXG MoDhsnpMWpgjOK9y9hvYTZWtxwGQbXoU04IKrcNVUimMjJMGxzqyZuy066OcC6m+qM P5GgDgp9G8vfQ== Received: by mail-qk1-f198.google.com with SMTP id w4-20020a05620a444400b006fa24b2f394so20075428qkp.15 for ; Tue, 22 Nov 2022 12:02:43 -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=8zXwZewVrSoeA0YJbdzixOq5x/WJIJuLRn02W+VAQNU=; b=ZIuD0ek8u5m4Fb5dMuAJSVpVw1kducNW8j2oHmvfBkE31wb3wuK4TIFGI3fRAuz+FK tdfaMgG1FlrcGawDPmXWyKAOwP4tV1MappJj2L/2T1unNTqtZNe2FpRDHVpye+QBDt4X Gl9GvFWCeyWAUuBrP8VYtGRElpFaQ/QsU2GDE2NcznSht1m4+NKMy9yJ3Obgz+gq5v0n ImLL3laiM4Bh0fZqagfJ3lkhMZ36MlsbQVc+cmvCYshXEIIK+k+BicCnknAffKRJGAkS /kv96tW4vo+cQfaEoE0doFjww4OjtK2I+zQYAw2X2aqCzrjw2AvQKUs4pUprY7p1+jMh ECAA== X-Gm-Message-State: ANoB5plIGYgHfcGl2aeRkvsYKQvWrl/Pf89frVyuCqt7iu4dnXhEFXZN pSwpPaQKepUfeny89GQnJvZ5ymv7vgnFY0RX6RBNOU+CSecvXj93B1we4FnDrWljmnGRgfQjD0u mti7b6MnQW+mJQwdeL+cpCjje2OcEAgY/g4yje2pmpA== X-Received: by 2002:a37:ae44:0:b0:6fa:2a50:f884 with SMTP id x65-20020a37ae44000000b006fa2a50f884mr6476173qke.741.1669147362284; Tue, 22 Nov 2022 12:02:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf4D5n6JiwV4I3KHTO9cHAtbQL+L3ehfSL07K9WzW5uIQSrp/PbrB8TaBZRQsYzfh31uYcRxYw== X-Received: by 2002:a37:ae44:0:b0:6fa:2a50:f884 with SMTP id x65-20020a37ae44000000b006fa2a50f884mr6476152qke.741.1669147361855; Tue, 22 Nov 2022 12:02:41 -0800 (PST) Received: from k2.fuzzbuzz.org ([38.147.253.164]) by smtp.gmail.com with ESMTPSA id n30-20020ac81e1e000000b003a50b9f099esm8826505qtl.12.2022.11.22.12.02.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Nov 2022 12:02:41 -0800 (PST) From: Khalid Elmously To: kernel-team@lists.ubuntu.com Subject: [SRU][Focal][PATCH] Revert "epoll: autoremove wakers even more aggressively" Date: Tue, 22 Nov 2022 15:02:34 -0500 Message-Id: <20221122200236.104315-2-khalid.elmously@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221122200236.104315-1-khalid.elmously@canonical.com> References: <20221122200236.104315-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. That commit was suspected of causing regressions, like the one reported in the BugLink, as well as other suspected containerd/runc regressions reported on Azure and elsewhere, e.g.: https://canonical.lightning.force.com/lightning/r/Case/5004K00000OnSZDQA3/view https://github.com/opencontainers/runc/issues/3641 https://www.spinics.net/lists/kernel/msg4565924.html Investigation is ongoing but there is a high probability/confidence that bcf91619e32fe584ecfafa49a3db3d1db4ff70b2 is indeed the problem. 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 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);