From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 896D2EEB560 for ; Fri, 8 Sep 2023 18:00:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245516AbjIHSA0 (ORCPT ); Fri, 8 Sep 2023 14:00:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245489AbjIHSAZ (ORCPT ); Fri, 8 Sep 2023 14:00:25 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD27E1FF6; Fri, 8 Sep 2023 11:00:17 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03017C433C7; Fri, 8 Sep 2023 18:00:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694196017; bh=oiCBIEZY60tSkOgWmSR8mY0q64KgwOAVwN8avxxJu5w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AlyqwGrQiqsYvut+HO5Stpl9yphW7tcR5FNbmzT9X6qQUvqLqHCXamMl2B2W3X/y1 Vq4QoKzInrWdLrcMhV4rAaR/84wbNwfQlaa6YdmxsgrppPjlQrTuhk0sKnIyAvxpgJ 9o+sdlrQpqhgIA6a8P4jW7uWOkpVWyV9tfUsMulpREnm0+spnuFtJ2jX45GcR6iUMs 7e7TUD8ieHYKd24wV8ymAGkVFw51LZb9tbToP1RAF/I1GERBaVlIxA+bW5CKfwMStg IqM/ceH2gYNmJtbrywxUER9VW9MRXLRfdhfdwbJPnQBRsyhEkOGp/Hik5yTaY1QT2l VbtXbh/31Bdkw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "Paul E. McKenney" , Sasha Levin Subject: [PATCH AUTOSEL 6.5 04/16] scftorture: Forgive memory-allocation failure if KASAN Date: Fri, 8 Sep 2023 13:59:41 -0400 Message-Id: <20230908175953.3457942-4-sashal@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230908175953.3457942-1-sashal@kernel.org> References: <20230908175953.3457942-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.5.2 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Paul E. McKenney" [ Upstream commit 013608cd0812bdb21fc26d39ed8fdd2fc76e8b9b ] Kernels built with CONFIG_KASAN=y quarantine newly freed memory in order to better detect use-after-free errors. However, this can exhaust memory more quickly in allocator-heavy tests, which can result in spurious scftorture failure. This commit therefore forgives memory-allocation failure in kernels built with CONFIG_KASAN=y, but continues counting the errors for use in detailed test-result analyses. Signed-off-by: Paul E. McKenney Signed-off-by: Sasha Levin --- kernel/scftorture.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/scftorture.c b/kernel/scftorture.c index 5d113aa59e773..83c33ba0ca7e0 100644 --- a/kernel/scftorture.c +++ b/kernel/scftorture.c @@ -171,7 +171,8 @@ static void scf_torture_stats_print(void) scfs.n_all_wait += scf_stats_p[i].n_all_wait; } if (atomic_read(&n_errs) || atomic_read(&n_mb_in_errs) || - atomic_read(&n_mb_out_errs) || atomic_read(&n_alloc_errs)) + atomic_read(&n_mb_out_errs) || + (!IS_ENABLED(CONFIG_KASAN) && atomic_read(&n_alloc_errs))) bangstr = "!!! "; pr_alert("%s %sscf_invoked_count %s: %lld resched: %lld single: %lld/%lld single_ofl: %lld/%lld single_rpc: %lld single_rpc_ofl: %lld many: %lld/%lld all: %lld/%lld ", SCFTORT_FLAG, bangstr, isdone ? "VER" : "ver", invoked_count, scfs.n_resched, @@ -323,7 +324,8 @@ static void scftorture_invoke_one(struct scf_statistics *scfp, struct torture_ra preempt_disable(); if (scfsp->scfs_prim == SCF_PRIM_SINGLE || scfsp->scfs_wait) { scfcp = kmalloc(sizeof(*scfcp), GFP_ATOMIC); - if (WARN_ON_ONCE(!scfcp)) { + if (!scfcp) { + WARN_ON_ONCE(!IS_ENABLED(CONFIG_KASAN)); atomic_inc(&n_alloc_errs); } else { scfcp->scfc_cpu = -1; -- 2.40.1