From patchwork Mon Sep 30 08:37:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 13815599 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10759CF649D for ; Mon, 30 Sep 2024 08:37:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 842458001A; Mon, 30 Sep 2024 04:37:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7CC0380017; Mon, 30 Sep 2024 04:37:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5CF5C8001A; Mon, 30 Sep 2024 04:37:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 3E71380017 for ; Mon, 30 Sep 2024 04:37:56 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id DB5691A09F3 for ; Mon, 30 Sep 2024 08:37:55 +0000 (UTC) X-FDA: 82620751710.02.FB56BE0 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by imf13.hostedemail.com (Postfix) with ESMTP id 83A3D20008 for ; Mon, 30 Sep 2024 08:37:52 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="rjLzb/uw"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="a+fD/IqS"; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=PQ3SPeHb; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=ieXzy1Ws; spf=pass (imf13.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.131 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727685409; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=1H0gPESO/BntkG0B4FSGoHsx0d2Sq64W+wU6e58nb2w=; b=ck8fPc3JuEC1ZqvCCKM/eqNN7BHhBhVTqC5DCq7Jeygo0Q2KuGra9MKwbHLaD4L1EDkqpe VH/T8kIaeKc2i2XurJw3stTVHAMreC/vbfuZm2Q9IKGK8LFpqFFYccVtHELUG8ozF+9KII Dt228Ksg4BeniE27gdxgNXqCR9RMBco= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="rjLzb/uw"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="a+fD/IqS"; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=PQ3SPeHb; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=ieXzy1Ws; spf=pass (imf13.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.131 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727685409; a=rsa-sha256; cv=none; b=kp0B2x68V8qLdU4+zy0iyTSsB0jPHsnG0Zj2Svk3uRjrbYOTck2bbzBJk/6zwBPZi6Z8rU +dEuSvShEGinhmV1WVDHIVEJ6my6hM861wh+28uQuiYjCJ/oKnY4jfEcTttWRN8w9HaBdD pDqPt1v10LrLS4SwXseC7/sjFu7tzPs= Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id ED95F1F7F6; Mon, 30 Sep 2024 08:37:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1727685471; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1H0gPESO/BntkG0B4FSGoHsx0d2Sq64W+wU6e58nb2w=; b=rjLzb/uwGOFEw+Hby88kVfZ6SY9u9G3VwCebC0uBG/wfLFdcGzoLW9/nGKYN8nLJ1IfnoZ 8TsglSwlbyMUSvj1GTFAb3BgQfmECblArMuIo6r0nloHMtOANcBaHUPOswwJ1f7lJUYpFV nJ1vJYemy+HAUJwUw3uBo/VKk2gZ7H8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1727685471; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1H0gPESO/BntkG0B4FSGoHsx0d2Sq64W+wU6e58nb2w=; b=a+fD/IqS8IrfYHbEqPLoSF7McWtLoH9HqjXeNJUxaiKqSH6cDuH23b6cFz6hfCUit1hk0G TCNywWatBwD3/OBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1727685469; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1H0gPESO/BntkG0B4FSGoHsx0d2Sq64W+wU6e58nb2w=; b=PQ3SPeHbkR498u6YpBNmc6BAyZslVulywJ3CcMI9L/dQlwk2vUqvhoB2Jzl3EJZieOv6Gg ryvkLqrkU3fUGjIfyQn7gunbXEvOZuPr+Klak8BBaxSmXULi4k1KX5LfAwEURvBI6jq0f/ ilnq3b8Eo8C3YG+ZHS8o/+uIBMI9NfI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1727685469; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1H0gPESO/BntkG0B4FSGoHsx0d2Sq64W+wU6e58nb2w=; b=ieXzy1WsmRbQR0KOCAAEMkokIjqUT2C3bv/cY+uBLi+lUt9v8imJrWllq5HhG/bAZZtN60 5GxU/9v1G7bU1WBA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id D0C9813AAA; Mon, 30 Sep 2024 08:37:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id ABOwMl1j+mYhHwAAD6G6ig (envelope-from ); Mon, 30 Sep 2024 08:37:49 +0000 From: Vlastimil Babka Date: Mon, 30 Sep 2024 10:37:17 +0200 Subject: [PATCH slab hotfixes 2/2] kunit: move call to kunit_run_all_tests() after rcu_end_inkernel_boot() MIME-Version: 1.0 Message-Id: <20240930-b4-slub-kunit-fix-v1-2-32ca9dbbbc11@suse.cz> References: <20240930-b4-slub-kunit-fix-v1-0-32ca9dbbbc11@suse.cz> In-Reply-To: <20240930-b4-slub-kunit-fix-v1-0-32ca9dbbbc11@suse.cz> To: Andrew Morton , Christoph Lameter , David Rientjes , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Vlastimil Babka Cc: Guenter Roeck , "Paul E. McKenney" , Boqun Feng , Uladzislau Rezki , rcu@vger.kernel.org, David Gow , Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Brendan Higgins X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2159; i=vbabka@suse.cz; h=from:subject:message-id; bh=0WnxLPEui3oDtLBzlhAtJkEteadIcsQlNHVOikq11/s=; b=owEBbQGS/pANAwAIAbvgsHXSRYiaAcsmYgBm+mNb5kW6gBMYJomoCQCnVJVj2vq4E+KW7TR+P v9VoTSjjjuJATMEAAEIAB0WIQR7u8hBFZkjSJZITfG74LB10kWImgUCZvpjWwAKCRC74LB10kWI mmuxCACeREhmlg/rNG4s+kT3WJNgk6FnivDPqNnOL4qEeWBIaPwJLleugyX0FkcYNrF03p70/WB pbKNdzte33X1JZ+yutnxQBs0wb59bq0Cy6NJc2h1MRe/zwbNUPZ8T+SrZwg+RzRYF8uOnmi/Evg PrgWiuYKvoo8av4sqAUo0r1nd3bu88M4blrWPVYYbX7ws1PlO+zA/c73XJUGI4TGo8xwfi1gJDr 1Hc6U6Zsx9qCAVg+8sbG7SVeI1SgqHw4mDqc+Mq7lVU+9fO4r5Wky0LH8loHaH7PJadIY5R/sQD FtUOXqUHggLFkJ8XP/N5cwnK9/61pYbheifxulWZWjhzRjNr X-Developer-Key: i=vbabka@suse.cz; a=openpgp; fpr=A940D434992C2E8E99103D50224FA7E7CC82A664 X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 83A3D20008 X-Stat-Signature: ug6z6sjcesru5p6m31ay8e7tpa9yid3x X-HE-Tag: 1727685472-36625 X-HE-Meta: U2FsdGVkX18LLV2Qs5zBflEjlP7jfqNrBJwf/zkCbOLgY7ocLoJ5MlHmYjlyLFB7/S25/9qD1GviRPtOiTRXIGCMctJCiVRT33MOUr3vVlJ1R0VEGGLj5gJLNDzGXxEBsGEi058IN6fwFX4pJxFjYdlPOfUwHcuqqYXFdNdg46bLE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kFqzZ0iNOI4wKc5+nbYY8EmQEJf/u9daab4zFADkvLnrVajtNzG3nESKlYeZ9drfWf8+22nV4oe9Vzjl80Y3otDjWKYTrAJXvWwdPHA6oudX4kkmKtxBEpFDHDLRy6Waw9vFmZrr2qSQgsv/ddy9TLyRyXaX1Wd87zrRP/BsRrA2wiyJ0GjIwtgp3ekIrIhPi5qL4jJaiB7/sxvH0VwrXYAjtFocNYu00Gli2zDjVPSnhJxbm6BVwj9TOgPaQL5rszARnXUQD9DKsQb9bIFjti5wyhe2RidqfmfwzCvqQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Guenter Roeck reports that the new slub kunit tests added by commit 4e1c44b3db79 ("kunit, slub: add test_kfree_rcu() and test_leak_destroy()") cause a lockup on boot on several architectures when the kunit tests are configured to be built-in and not modules. These tests invoke kfree_rcu() and kvfree_rcu_barrier() and boot sequence inspection showed the runner for built-in kunit tests kunit_run_all_tests() is called before setting system_state to SYSTEM_RUNNING and calling rcu_end_inkernel_boot(), so this seems like a likely cause. So while I was unable to reproduce the problem myself, moving the call to kunit_run_all_tests() a bit later in the boot seems to have fixed the lockup problem according to Guenter's limited testing. No kunit tests should be broken by calling the built-in executor a bit later, as when compiled as modules, they are still executed even later than this. Fixes: 4e1c44b3db79 ("kunit, slub: add test_kfree_rcu() and test_leak_destroy()") Reported-by: Guenter Roeck Closes: https://lore.kernel.org/all/6fcb1252-7990-4f0d-8027-5e83f0fb9409@roeck-us.net/ Cc: "Paul E. McKenney" Cc: Boqun Feng Cc: Uladzislau Rezki Cc: rcu@vger.kernel.org Cc: Brendan Higgins Cc: David Gow Cc: Rae Moar Cc: linux-kselftest@vger.kernel.org Cc: kunit-dev@googlegroups.com Signed-off-by: Vlastimil Babka --- init/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init/main.c b/init/main.c index c4778edae7972f512d5eefe8400075ac35a70d1c..7890ebb00e84b8bd7bac28923fb1fe571b3e9ee2 100644 --- a/init/main.c +++ b/init/main.c @@ -1489,6 +1489,8 @@ static int __ref kernel_init(void *unused) rcu_end_inkernel_boot(); + kunit_run_all_tests(); + do_sysctl_args(); if (ramdisk_execute_command) { @@ -1579,8 +1581,6 @@ static noinline void __init kernel_init_freeable(void) do_basic_setup(); - kunit_run_all_tests(); - wait_for_initramfs(); console_on_rootfs();