From patchwork Tue Nov 22 19:57:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khalid Elmously X-Patchwork-Id: 1707985 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=TT3XSvpG; 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 4NGw641Rggz23nn for ; Wed, 23 Nov 2022 06:57:47 +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 1oxZOm-0007x9-NB; Tue, 22 Nov 2022 19:57:40 +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 1oxZOl-0007wP-1C for kernel-team@lists.ubuntu.com; Tue, 22 Nov 2022 19:57:39 +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-1.canonical.com (Postfix) with ESMTPS id CBC3A3F367 for ; Tue, 22 Nov 2022 19:57:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1669147058; bh=GEICd4saiRDXES/dQn0EXQ/Ew3gMn1th5B5VFWGOf50=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TT3XSvpG1mmRMb1ummKVNA8EVUQ8QmIEtyWPsYZK/CRKJkK2LoYdTjxmBv5Y9kMWs 29zax0tjkm9IkRA6VeOXY8m04YxhzHqz6iYUVWD78yBV0J/7vZPGYEAjqQpcnzP/B/ ML0pAglSkFgIyzVwLDPxO3lCwOTGPQVsKSUZR5Zh+H+ziY9Q1keF6oGVtjU/Ev1spR 0U5BwmaQjo22BKnr0AUVV4/+3J3pWfSDunI6RU+sqmgk2aPHdXhF2ZKwoxTXkOtoe3 5zpJRgDwJoE4aETYC63wDbuC/rgezeB/yphVRyIyal+jFJOs6T3vMrMOlqsrhco69t f6cNyBIgdxbbg== Received: by mail-qk1-f198.google.com with SMTP id bs7-20020a05620a470700b006fac7447b1cso20232816qkb.17 for ; Tue, 22 Nov 2022 11:57:38 -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=GEICd4saiRDXES/dQn0EXQ/Ew3gMn1th5B5VFWGOf50=; b=z4oxikNpx37o0Q1caeBM3edY7OYlI6Bn3F/44d8HoZ73coQDdioNMXzppi1ho5DOWL kEvN0qyk8NaGRyZD9DDTrDdVDIB9+9o+G4nQWqh4dTTuw+t0VqX3n+WnYO4woW136bcO 36S2X637+9504yTBSwSzGhghWMGUBJBNtgK3TZ7Fa14k7Q1wp5sXYdtgp3RUSCDBBOgL C3rDGEh3skVJ01wjVmtc198DCjGWEamCJ6EGANVoXlA2URcZe1NkaFO4qlo9yAy8kVX0 CTlByiOXr6qMYk6DbULgWJeBFm6C7eARRUguWcB3kF1sQiSYB26oiCX4ecm/n6TaC0PG Q/3Q== X-Gm-Message-State: ANoB5plwJHYRK6TWPJzontRqm/WzGebMrO08oaFTkhIg/KATgoqx2bQv wNzPigqtRY5/HibdiGPxpwZ3iBVvMaONoS0Y5wTsjpxG9Qrprb0em9i/9kLNTB++x704rN/vWag jhl/YyLORL2OtJ/+JlfAU116zoOH+ogI998HZKQO8pw== X-Received: by 2002:a05:620a:c8e:b0:6fa:2bd2:897f with SMTP id q14-20020a05620a0c8e00b006fa2bd2897fmr5177153qki.87.1669147057811; Tue, 22 Nov 2022 11:57:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf5C7W/JUzGdTwI5T6BMX0xVZzp6jqmnULjM7t1rXubracvbK6tgC4YZNcTAHYFu8nQEfWxjsQ== X-Received: by 2002:a05:620a:c8e:b0:6fa:2bd2:897f with SMTP id q14-20020a05620a0c8e00b006fa2bd2897fmr5177131qki.87.1669147057425; Tue, 22 Nov 2022 11:57:37 -0800 (PST) Received: from k2.fuzzbuzz.org ([38.147.253.164]) by smtp.gmail.com with ESMTPSA id dt18-20020a05620a479200b006ea7f9d8644sm10728892qkb.96.2022.11.22.11.57.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Nov 2022 11:57:36 -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: Tue, 22 Nov 2022 14:57:25 -0500 Message-Id: <20221122195726.104087-3-khalid.elmously@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221122195726.104087-1-khalid.elmously@canonical.com> References: <20221122195726.104087-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. 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 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); /*