From nobody Fri Jun 12 15:39:12 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 70BEE1F131A; Thu, 14 May 2026 05:06:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778735212; cv=none; b=GFo+I09kwUgBiCn3c4O6HG/cRQG69OtYeaS9JtejOMcXcoHOe8g6MEN3AG7LF/obzDGk2rNggy4PVaDswUOptzClbGy7Rtpzzoqgzuni+5DFjK+S6Qxtvt895o5JZ+3n+xeZCQTgdzdVM7ri30AlnzMULLZylAREqSyqtC1/BrI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778735212; c=relaxed/simple; bh=bamNddKdXVgxZqutIBQo9gEmJk9kTncPd0EXZfEgTdE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ggp3LJiLLCUhY3TZhftZywbBSJvvXN5FRP1EGvcqWCWVTcZHrU+E1bB1GetR3udHF3Qp4qacDx6OIDBUmmXcR8jkfAMmaxbaTciFQgC7kkY7LDQKChk3p8QBEhw0Dq8UNSMqblHqvo7dYOOTbEI5vU6OtanBStFVf9colNrbD9g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=b673L7Bl; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="b673L7Bl" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AE14F34E9; Wed, 13 May 2026 22:06:43 -0700 (PDT) Received: from entos-yitian-01.Arm.com (unknown [10.168.197.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id BBDE73F7B4; Wed, 13 May 2026 22:06:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1778735208; bh=bamNddKdXVgxZqutIBQo9gEmJk9kTncPd0EXZfEgTdE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b673L7Blg3xg5L8WNcH7Zu5Qed2gjayMHfkv11+YttJp8eNSGYY+dy8l8+bWF+x3d GlV5mp0EmcKddlaO/ogQAMiO2Nji6JgHdJUq+fZ1MI3eFkgo3FhjlM0/0ipeiPA3gT pRAhQbybLcIUmVcUZ1v2H5Kk8WOLYxSe6HEv6GMA= From: Jia He To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, kasan-dev@googlegroups.com, linux-mm@kvack.org Cc: Arnd Bergmann , Greg Kroah-Hartman , Alexander Viro , Christian Brauner , Jan Kara , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Brendan Higgins , David Gow , Rae Moar , Alexander Potapenko , Marco Elver , Dmitry Vyukov , Andrew Morton , Jia He , "Paul E. McKenney" , Petr Mladek , Kees Cook , David Disseldorp Subject: [PATCH 1/7] init/initramfs_test: wait_for_initramfs() before running Date: Thu, 14 May 2026 05:04:49 +0000 Message-Id: <20260514050455.2954509-2-justin.he@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260514050455.2954509-1-justin.he@arm.com> References: <20260514050455.2954509-1-justin.he@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" initramfs_test_extract() and friends call unpack_to_rootfs() from a kunit kthread while do_populate_rootfs() may still be running asynchronously from rootfs_initcall. unpack_to_rootfs() keeps its parser state in module-static variables (victim, byte_count, state, this_header, header_buf, name_buf, ...), so the two writers corrupt each other. On arm64 v7.0-rc5+ this oopses early in boot: Unable to handle kernel paging request at virtual address ffff80018f9f0ffc pc : do_reset+0x3c/0x98 Call trace: do_reset initramfs_test_extract kunit_try_run_case Initramfs unpacking failed: junk within compressed archive do_reset() faults because 'victim' was overwritten by the boot-time unpacker; the boot unpacker meanwhile logs the bogus "junk within compressed archive" on the real initrd because the test wrecked its state machine. Add a suite .init that calls wait_for_initramfs() so the async unpack is quiescent before the first case runs. To: Alexander Viro To: Christian Brauner To: Jan Kara To: David Disseldorp Cc: linux-fsdevel@vger.kernel.org Fixes: 83c0b27266ec ("initramfs_test: kunit tests for initramfs unpacking") Signed-off-by: Jia He Reviewed-by: David Disseldorp --- init/initramfs_test.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/init/initramfs_test.c b/init/initramfs_test.c index 2ce38d9a8fd0..eb76f63f302e 100644 --- a/init/initramfs_test.c +++ b/init/initramfs_test.c @@ -3,7 +3,9 @@ #include #include #include +#include #include +#include #include #include #include "initramfs_internal.h" @@ -510,8 +512,21 @@ static struct kunit_case __refdata initramfs_test_case= s[] =3D { {}, }; =20 -static struct kunit_suite initramfs_test_suite =3D { +static int __init initramfs_test_init(struct kunit *test) +{ + /* + * unpack_to_rootfs() uses module-static state (victim, byte_count, + * state, ...). The boot-time async do_populate_rootfs() may still be + * running, so wait for it to finish before we call unpack_to_rootfs() + * from the test thread, otherwise the two writers race and crash. + */ + wait_for_initramfs(); + return 0; +} + +static struct kunit_suite __refdata initramfs_test_suite =3D { .name =3D "initramfs", + .init =3D initramfs_test_init, .test_cases =3D initramfs_test_cases, }; kunit_test_init_section_suites(&initramfs_test_suite); --=20 2.34.1 From nobody Fri Jun 12 15:39:12 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AF6D63B95F0; Thu, 14 May 2026 05:07:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778735229; cv=none; b=KuY7AfiqVHQKJQFmDJ7k7NAs9cV5sIVBVluZRxCrFNsHo5BHUNPYyjdxU4N3EQ5bml+wVq5sWFDOhQQQfBVnFf5hw9KvzUUvhny1qxTzL8+2x4P0mBg+0A7dWs60f8ZHHKjOoQawim8vmS5i5cVuuJPHRUhMdgZ19ZQ35Zgm28I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778735229; c=relaxed/simple; bh=BANIRIqsq1p4Sc4QnkiivpJhCJpebYuZdrDjdfih8k8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jTZ6S8/8G9A6dR1OH/hAYV3C8IBYYAi9R5S4XCPRwbEtXJ97CMJPMNKFqfRd8taz06XwMAjJbYgLKkZ3yFsYu+ebBNue7CiJ+su6B3pcf5IYl6ZFEj2uF8JzqMwFz7LwLY7Tg72svLGonLtsTSH626Q5w/+FgUha+wvECM+BuFA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=u6aPQJ7B; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="u6aPQJ7B" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A2A8634FE; Wed, 13 May 2026 22:06:59 -0700 (PDT) Received: from entos-yitian-01.Arm.com (unknown [10.168.197.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A3BAE3F7B4; Wed, 13 May 2026 22:06:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1778735224; bh=BANIRIqsq1p4Sc4QnkiivpJhCJpebYuZdrDjdfih8k8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u6aPQJ7BZumqfz7tiHCCZ5t+ueVed1AOrEwtNEyTCj+4NwgHp4vP4fA6JCwowBPef g040pef32i4nOIkeFUYUReBkJGPP7GNHe9Ep2/337vVuPkKKUbMnw/ebiHUnzEX17l UJMfvVR4OtpSKlNBiTseH8qZl1SU/yS+4JiOqAK4= From: Jia He To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, kasan-dev@googlegroups.com, linux-mm@kvack.org Cc: Arnd Bergmann , Greg Kroah-Hartman , Alexander Viro , Christian Brauner , Jan Kara , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Brendan Higgins , David Gow , Rae Moar , Alexander Potapenko , Marco Elver , Dmitry Vyukov , Andrew Morton , Jia He , "Paul E. McKenney" , Petr Mladek , Kees Cook , David Disseldorp Subject: [PATCH 2/7] kfence: kunit: skip when no pool is available Date: Thu, 14 May 2026 05:04:50 +0000 Message-Id: <20260514050455.2954509-3-justin.he@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260514050455.2954509-1-justin.he@arm.com> References: <20260514050455.2954509-1-justin.he@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When KFENCE is compiled in but disabled at boot (KFENCE_SAMPLE_INTERVAL=3D0) or __kfence_pool is not allocated, every kfence kunit case fails with -EINVAL. Use kunit_skip() so they are reported as skipped instead. To: Alexander Potapenko To: Marco Elver To: Dmitry Vyukov To: Andrew Morton Cc: kasan-dev@googlegroups.com Cc: linux-mm@kvack.org Signed-off-by: Jia He Acked-by: Marco Elver --- mm/kfence/kfence_test.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mm/kfence/kfence_test.c b/mm/kfence/kfence_test.c index 5725a367246d..e376329dd621 100644 --- a/mm/kfence/kfence_test.c +++ b/mm/kfence/kfence_test.c @@ -822,8 +822,10 @@ static int test_init(struct kunit *test) unsigned long flags; int i; =20 - if (!__kfence_pool) - return -EINVAL; + if (!__kfence_pool) { + kunit_skip(test, "kfence pool not allocated or kfence not enabled"); + return 0; + } =20 spin_lock_irqsave(&observed.lock, flags); for (i =3D 0; i < ARRAY_SIZE(observed.lines); i++) --=20 2.34.1 From nobody Fri Jun 12 15:39:12 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 88B4C1F131A; Thu, 14 May 2026 05:07:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778735243; cv=none; b=IpP2eyquLCC3StFXiIRXmQf/nnjwHX5lzgIxkTTOuZk3pb42u9e5/Y2d9+UwrjcQ910nWPcSJjvZWdZ1n3en/wb/1L2SfWCXhyF/QeAYHR44Wp5Emnk3ty1WlZALTeblP4FCKps1Hjn7IQSm0mKSZArjL2X2V78IiIKtLAIatOk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778735243; c=relaxed/simple; bh=m1VX1+Cs1y6NAynCJMAnljF2dh+IIFzjeI0LtRTOziM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qgrT7Q6jEIKbv1WXFzN4jWN4XjboXOm+IgYl2GPuYigRHQwv/wM0hDHymdMYavKpKMidlMMEMNdg+eT7baceNnFR6madekh43vMKbEpbx/TzE8gaty3kj1tSg/kZ/NcTkgqJjQeX6kU+MALtcLMLbpIuBpMumETNvHMaZZJgj/w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=E/oh4tN/; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="E/oh4tN/" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7ADC51655; Wed, 13 May 2026 22:07:15 -0700 (PDT) Received: from entos-yitian-01.Arm.com (unknown [10.168.197.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 951093F7B4; Wed, 13 May 2026 22:07:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1778735240; bh=m1VX1+Cs1y6NAynCJMAnljF2dh+IIFzjeI0LtRTOziM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E/oh4tN/nyhRAFt0FylqFv26rxNYr0RLbwJycvUtCBR5EOuw4xnrNUwGQFUl8Fdnr aMaaYdqq9tcsYZ8Usbbj9Jd4MTN28+Kac6h6lxa7WKAFMWPWsLaVF2fDlTou0GExN0 K25/GUzhMJfdsgdFVJlXBsG+2zTNhbDSt5LZ5Ziw= From: Jia He To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, kasan-dev@googlegroups.com, linux-mm@kvack.org Cc: Arnd Bergmann , Greg Kroah-Hartman , Alexander Viro , Christian Brauner , Jan Kara , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Brendan Higgins , David Gow , Rae Moar , Alexander Potapenko , Marco Elver , Dmitry Vyukov , Andrew Morton , Jia He , "Paul E. McKenney" , Petr Mladek , Kees Cook , David Disseldorp Subject: [PATCH 3/7] lib/math/int_log: drop WARN_ON for value == 0 Date: Thu, 14 May 2026 05:04:51 +0000 Message-Id: <20260514050455.2954509-4-justin.he@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260514050455.2954509-1-justin.he@arm.com> References: <20260514050455.2954509-1-justin.he@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" intlog2(0) and intlog10(0) already return 0, and the math-int_log kunit suite passes {0, 0} as a valid input. The leftover WARN_ON(1) on that path produces a backtrace per test run. Just remove it. Signed-off-by: Jia He --- lib/math/int_log.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/math/int_log.c b/lib/math/int_log.c index 8f9da3a2ad39..8585207cbe7f 100644 --- a/lib/math/int_log.c +++ b/lib/math/int_log.c @@ -59,10 +59,8 @@ unsigned int intlog2(u32 value) unsigned int significand; unsigned int interpolation; =20 - if (unlikely(value =3D=3D 0)) { - WARN_ON(1); + if (unlikely(value =3D=3D 0)) return 0; - } =20 /* first detect the msb (count begins at 0) */ msb =3D fls(value) - 1; @@ -116,10 +114,8 @@ unsigned int intlog10(u32 value) */ u64 log; =20 - if (unlikely(value =3D=3D 0)) { - WARN_ON(1); + if (unlikely(value =3D=3D 0)) return 0; - } =20 log =3D intlog2(value); =20 --=20 2.34.1 From nobody Fri Jun 12 15:39:12 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1460B3AD538; Thu, 14 May 2026 05:07:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778735257; cv=none; b=eNJWVvRnFedErohL/PczgRefFyxULseBjRZUkWCWpRMXF0KctxnlCQX8C+FGANn/ML9jZ5U+YpzqGNMEJGXB8XvG+0u35aIo+e/bTjToWMRfpjoAA8HLz7d1cD/2+ML4hSjFLu76D6gx2epdW1KuUPRQH092bakoAc1PQoNl5QQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778735257; c=relaxed/simple; bh=czAmxYpsET1Yh9/oz4/+53pPQLCrLQvlifYICwLtv+c=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kIvusrLqoJQch1yxgap8nQw1KoVK9YN2AiBfAhc9zztCayITnafUiDYArMWKU7xury5GViESiGzNS53Bx+ep75W7nQJ1PeAg1skOBR5HqTXqVkA4jdiev6Q3Lbx7GN3Tyw9n+fJkjNto6XZVX/TpvTYVNqMVswqHWGHXl4CmE5k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=o0FHpsW6; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="o0FHpsW6" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F2CF51655; Wed, 13 May 2026 22:07:29 -0700 (PDT) Received: from entos-yitian-01.Arm.com (unknown [10.168.197.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 725C53F7B4; Wed, 13 May 2026 22:07:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1778735255; bh=czAmxYpsET1Yh9/oz4/+53pPQLCrLQvlifYICwLtv+c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o0FHpsW6gdbF86tmY2ETArYqOqWqOOY1GNI2kiRdvM0pm7oBhmWbI0Z0X6+EHPNZl qQBBP5fVos0FOErmjWVY5uBrA7RJCxa2iqP47kzzSkryHXE/vBAHPK+Hyo+H+t3yN/ GRfD9Ykf4sHrnO+EeU80Z+AFYPlWekU7W7R3aPKc= From: Jia He To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, kasan-dev@googlegroups.com, linux-mm@kvack.org Cc: Arnd Bergmann , Greg Kroah-Hartman , Alexander Viro , Christian Brauner , Jan Kara , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Brendan Higgins , David Gow , Rae Moar , Alexander Potapenko , Marco Elver , Dmitry Vyukov , Andrew Morton , Jia He , "Paul E. McKenney" , Petr Mladek , Kees Cook , David Disseldorp Subject: [PATCH 4/7] kunit: platform: catch duplicate (name, id) in kunit_platform_device_add() Date: Thu, 14 May 2026 05:04:52 +0000 Message-Id: <20260514050455.2954509-5-justin.he@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260514050455.2954509-1-justin.he@arm.com> References: <20260514050455.2954509-1-justin.he@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" kunit_platform_device_add_twice_fails_test registers the same device twice and expects failure. Without an early check the second platform_device_add() reaches sysfs_create_dir_ns() and dumps a backtrace via sysfs_warn_dup() on every run. Walk the platform bus for a device with matching name and id and return -EEXIST. PLATFORM_DEVID_AUTO assigns its id inside add() and can't collide, so skip it. To: Brendan Higgins To: David Gow To: Rae Moar Cc: linux-kselftest@vger.kernel.org Cc: kunit-dev@googlegroups.com Signed-off-by: Jia He --- lib/kunit/platform.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/lib/kunit/platform.c b/lib/kunit/platform.c index 0b518de26065..515f7c859014 100644 --- a/lib/kunit/platform.c +++ b/lib/kunit/platform.c @@ -7,6 +7,7 @@ #include #include #include +#include =20 #include #include @@ -80,6 +81,20 @@ kunit_platform_device_alloc_match(struct kunit *test, =20 KUNIT_DEFINE_ACTION_WRAPPER(platform_device_unregister_wrapper, platform_device_unregister, struct platform_device *); + +struct kunit_pdev_dup_match { + const char *name; + int id; +}; + +static int kunit_pdev_dup_match_fn(struct device *dev, void *data) +{ + struct kunit_pdev_dup_match *m =3D data; + struct platform_device *p =3D to_platform_device(dev); + + return p->id =3D=3D m->id && p->name && !strcmp(p->name, m->name); +} + /** * kunit_platform_device_add() - Register a KUnit test managed platform de= vice * @test: test context @@ -95,6 +110,22 @@ int kunit_platform_device_add(struct kunit *test, struc= t platform_device *pdev) struct kunit_resource *res; int ret; =20 + /* + * Detect duplicate (name, id) registrations early, before + * platform_device_add() reaches sysfs_create_dir_ns() and + * unconditionally dumps a stack trace via sysfs_warn_dup(). This keeps + * tests that intentionally exercise the duplicate-add failure path + * (e.g. kunit_platform_device_add_twice_fails_test) quiet without + * losing the negative return value they assert on. + */ + if (pdev->name && pdev->id !=3D PLATFORM_DEVID_AUTO) { + struct kunit_pdev_dup_match m =3D { pdev->name, pdev->id }; + + if (bus_for_each_dev(&platform_bus_type, NULL, &m, + kunit_pdev_dup_match_fn)) + return -EEXIST; + } + ret =3D platform_device_add(pdev); if (ret) return ret; --=20 2.34.1 From nobody Fri Jun 12 15:39:12 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2DBA03B8D7B; Thu, 14 May 2026 05:07:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778735272; cv=none; b=jqQddBb9zdwSAC6PHJLgmy/sGyqOcB0HI+WJqG4K8gMh4YJnSvBC2WwqlV/VIL/CUNHEJ49MeqGDatGA5NXJbac47O/lVdLZl0PY3reMNHRKSrK2Tfkd4V28Nr641maOtmMYxIj2l2YARtnSf2fBBQZlELrCge+K2/EDXbE2qCc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778735272; c=relaxed/simple; bh=ce3AeHJV8yA0xKyUjIxramcUgkGMSx1azmaa1bteAa0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RHoNAShzKDHM3roKOQN3E43j76jzB4EbcdFYEfXD3ApRqS+1lehLLH7jB0/2ZLnmgZ50sqLvyV7oPBaeP42xKnWaJiBAAK9uT3atlH+sQMAyOQYezsJt0maGmiWXeJGuvME3s/dFN0oG30DqJ+jQUSVdUeWS8zBVGrf04Gy4+Ck= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=KgHc+bOn; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="KgHc+bOn" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EF4261655; Wed, 13 May 2026 22:07:44 -0700 (PDT) Received: from entos-yitian-01.Arm.com (unknown [10.168.197.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id E43C13F7B4; Wed, 13 May 2026 22:07:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1778735270; bh=ce3AeHJV8yA0xKyUjIxramcUgkGMSx1azmaa1bteAa0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KgHc+bOn9lgikGgIomgvWGL7kqneuNOKKQ+fOrKWE/NieiqN2IOjN5N29xio9U/Gs tBlE8ab9OSGUZFsIgarUDezyF9gM9cPeTqnwWlC2UBGo0zeYocjDsihl89fxbt8ze6 h1nNyx74R72oscuS5m7ZFFQvmtdjAxbza+RG+LqQ= From: Jia He To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, kasan-dev@googlegroups.com, linux-mm@kvack.org Cc: Arnd Bergmann , Greg Kroah-Hartman , Alexander Viro , Christian Brauner , Jan Kara , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Brendan Higgins , David Gow , Rae Moar , Alexander Potapenko , Marco Elver , Dmitry Vyukov , Andrew Morton , Jia He , "Paul E. McKenney" , Petr Mladek , Kees Cook , David Disseldorp Subject: [PATCH 5/7] misc: reject duplicate names in misc_register() Date: Thu, 14 May 2026 05:04:53 +0000 Message-Id: <20260514050455.2954509-6-justin.he@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260514050455.2954509-1-justin.he@arm.com> References: <20260514050455.2954509-1-justin.he@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The miscdev kunit suite registers two miscdevices with the same name and expects -EEXIST. The second call currently goes all the way to sysfs_create_dir_ns(), which prints "cannot create duplicate filename" with a backtrace on every run. Walk misc_list under misc_mtx, return -EEXIST on a name collision and free the just-allocated minor before returning. To: Arnd Bergmann To: Greg Kroah-Hartman Signed-off-by: Jia He --- drivers/char/misc.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/char/misc.c b/drivers/char/misc.c index 726516fb0a3b..d6ffa21ac495 100644 --- a/drivers/char/misc.c +++ b/drivers/char/misc.c @@ -248,6 +248,28 @@ int misc_register(struct miscdevice *misc) } } =20 + /* + * Detect duplicate names up-front so the subsequent + * device_create_with_groups() does not trip + * sysfs_create_dir_ns()->sysfs_warn_dup(), which unconditionally + * dumps a stack trace. Both the existing miscdev kunit suite + * (miscdev_test_duplicate_name) and any caller racing on the same + * name would otherwise pollute dmesg on every -EEXIST. + */ + { + struct miscdevice *c; + + list_for_each_entry(c, &misc_list, list) { + if (strcmp(c->name, misc->name) =3D=3D 0) { + misc_minor_free(misc->minor); + if (is_dynamic) + misc->minor =3D MISC_DYNAMIC_MINOR; + err =3D -EEXIST; + goto out; + } + } + } + dev =3D MKDEV(MISC_MAJOR, misc->minor); =20 misc->this_device =3D --=20 2.34.1 From nobody Fri Jun 12 15:39:12 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0A06C3AD538; Thu, 14 May 2026 05:08:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778735287; cv=none; b=GxRvlO+Tkr+zdOR9qm8W/xK/h3qrgFSTs7UYQ6exML+Ohm/bFuxXn+Jn5YsrKKmpiaGO3qrh1TjUhvCPya98FVcbknSaLIQUsRrbSMvuuYpTFe3uvvbCP/8rw+L/cUUEOLjNi6TE2fopDa/Ni9uxP7SXia+FDyK7tqNx+Dlc8RM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778735287; c=relaxed/simple; bh=i4bByhR3/GFn5EdsOuSs2aNtMnt37PAf+rz4tzgOO5w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CUco6YYjgYweEiJlnKEKBzRQ6jIOun1TPUfC3kAEqUYiMECQ5bSc2t8ihAC9vnaI5+SU+MhViuKQpEnfXep6VTkEyIN6i8M4e5bsMe9EG6HCeP0WuN0cddJ0hoDQJEGbD8AfZuZ7Nd7U/HZltmJ+woMwBxqqUcQrx1pLJAER+Yo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=cJgfkrqj; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="cJgfkrqj" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0CCA61655; Wed, 13 May 2026 22:08:00 -0700 (PDT) Received: from entos-yitian-01.Arm.com (unknown [10.168.197.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id E2E9F3F7B4; Wed, 13 May 2026 22:07:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1778735285; bh=i4bByhR3/GFn5EdsOuSs2aNtMnt37PAf+rz4tzgOO5w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cJgfkrqjF4tm9WRMUGgxzSWx/aIjRhFMv+ZZmwwkUccWMLOjzt+2qB/zt9dbgQKnT VFVuNrhwmSE2wQVt7y+3ZuYXRDIB5w+f3SKI5bKovaizZe7rdeyjGhvmf0WxlXiRVm U9BO0xWYArD/yhGbOFKPq0eNKZMHnjJbZ7Tn/0fM= From: Jia He To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, kasan-dev@googlegroups.com, linux-mm@kvack.org Cc: Arnd Bergmann , Greg Kroah-Hartman , Alexander Viro , Christian Brauner , Jan Kara , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Brendan Higgins , David Gow , Rae Moar , Alexander Potapenko , Marco Elver , Dmitry Vyukov , Andrew Morton , Jia He , "Paul E. McKenney" , Petr Mladek , Kees Cook , David Disseldorp Subject: [PATCH 6/7] hw_breakpoint_test: fix test_many_cpus failure on large systems Date: Thu, 14 May 2026 05:04:54 +0000 Message-Id: <20260514050455.2954509-7-justin.he@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260514050455.2954509-1-justin.he@arm.com> References: <20260514050455.2954509-1-justin.he@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" On systems with many CPUs (e.g. 128 cores x 4 HW breakpoint slots =3D 512 =3D MAX_TEST_BREAKPOINTS), test_many_cpus() advances idx to MAX_TEST_BREAKPOINTS after the last fill_bp_slots(). The subsequent register_test_bp() call hits WARN_ON(idx >=3D MAX_TEST_BREAKPOINTS), returns NULL, and the -ENOSPC expectation fails. Bail out of the loop when idx reaches the limit. Earlier iterations already validate the NOSPC path on other CPUs. To: Peter Zijlstra To: Ingo Molnar To: Arnaldo Carvalho de Melo To: Namhyung Kim To: Mark Rutland To: Alexander Shishkin To: Jiri Olsa To: Ian Rogers To: Adrian Hunter To: James Clark Cc: linux-perf-users@vger.kernel.org Signed-off-by: Jia He Reviewed-by: Marco Elver --- kernel/events/hw_breakpoint_test.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/events/hw_breakpoint_test.c b/kernel/events/hw_breakpoi= nt_test.c index 2cfeeecf8de9..943d040d2224 100644 --- a/kernel/events/hw_breakpoint_test.c +++ b/kernel/events/hw_breakpoint_test.c @@ -137,6 +137,9 @@ static void test_many_cpus(struct kunit *test) for_each_online_cpu(cpu) { bool do_continue =3D fill_bp_slots(test, &idx, cpu, NULL, 0); =20 + if (idx >=3D MAX_TEST_BREAKPOINTS) + break; + TEST_EXPECT_NOSPC(register_test_bp(cpu, NULL, idx)); if (!do_continue) break; --=20 2.34.1 From nobody Fri Jun 12 15:39:12 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D20683BA222; Thu, 14 May 2026 05:08:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778735306; cv=none; b=KlBVpWtRWCxMZdoRcJH4k+4AFxWWYIHq70muVZzjN8Wgx9bgQekeHevnBNxZ9VB3zJrygi2un0WulMqxxsD1wyki5OpYQBgoDBcUyGM7exH8vFv+vqAt15sU4VFc9pUDhUhD2P3rmYtj9Zi0UbpQ4qT6KrS0pJq5kDVIKfMk+0A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778735306; c=relaxed/simple; bh=pDv1PUPolI9yQCaKV1T3osAxs2BPPEuIIJYZ+6qnyXo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ueWbhY/Rr1GRwMbLA1c/HXpZiPzyXPFc7bAnQ2PK6oaqp+pPZwLrKahCNz5DVERbyRoZVcRCrVNR3z0JZ48zs+/GckvH4B9MRXjj0jYsvwi04jkgHFurNWLZSLdQ77Ei6oiaKVhyWTZjW+XKATMSgfil7s6eYmgTVSr+ew4F11k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=C0FOIuVq; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="C0FOIuVq" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E208C1655; Wed, 13 May 2026 22:08:16 -0700 (PDT) Received: from entos-yitian-01.Arm.com (unknown [10.168.197.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0871F3F7B4; Wed, 13 May 2026 22:08:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1778735302; bh=pDv1PUPolI9yQCaKV1T3osAxs2BPPEuIIJYZ+6qnyXo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C0FOIuVqM3n4lVlgYpvHk8RRPKzDD5+SduOW3q83jwCz6q2il5Md6IfZb/iTGZ+os oKQNS84VmZM5y6W3KgNvgdeqB3HnAzkFR8cCydg4B+9Xw5pvpjyQwls0oktpX798tq tl5eo8RIyC5bwHKsuNhKjV/dYBNj9pKBlY3VZbvY= From: Jia He To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, kasan-dev@googlegroups.com, linux-mm@kvack.org Cc: Arnd Bergmann , Greg Kroah-Hartman , Alexander Viro , Christian Brauner , Jan Kara , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Brendan Higgins , David Gow , Rae Moar , Alexander Potapenko , Marco Elver , Dmitry Vyukov , Andrew Morton , Jia He , "Paul E. McKenney" , Petr Mladek , Kees Cook , David Disseldorp Subject: [PATCH 7/7] lib/tests: test_ratelimit: fix stress test thread lifecycle and leak Date: Thu, 14 May 2026 05:04:55 +0000 Message-Id: <20260514050455.2954509-8-justin.he@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260514050455.2954509-1-justin.he@arm.com> References: <20260514050455.2954509-1-justin.he@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The kthread return value was checked against the wrong variable (sktp instead of sktp[i].tp), so WARN_ON_ONCE(!sktp->tp) fired at line 87. Replace kthread_run() with kthread_create()+wake_up_process() so the return value can be validated before assigning to sktp[i].tp. On creation failure, jump to a common cleanup path that signals doneflag, stops all already-started threads, and frees sktp. This avoids leaving orphan kthreads and leaked memory when a mid-loop failure occurs. Also reset doneflag before spawning threads so back-to-back test invocations don't race on stale state. To: "Paul E. McKenney" To: Petr Mladek To: Kees Cook Signed-off-by: Jia He --- lib/tests/test_ratelimit.c | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/lib/tests/test_ratelimit.c b/lib/tests/test_ratelimit.c index 33cea5f3d28b..64f26260c0d8 100644 --- a/lib/tests/test_ratelimit.c +++ b/lib/tests/test_ratelimit.c @@ -105,26 +105,44 @@ static void test_ratelimit_stress(struct kunit *test) const int n_stress_kthread =3D cpumask_weight(cpu_online_mask); struct stress_kthread skt =3D { 0 }; struct stress_kthread *sktp =3D kzalloc_objs(*sktp, n_stress_kthread); + int n_started =3D 0; =20 - KUNIT_EXPECT_NOT_NULL_MSG(test, sktp, "Memory allocation failure"); + KUNIT_ASSERT_NOT_NULL_MSG(test, sktp, "Memory allocation failure"); + WRITE_ONCE(doneflag, 0); for (i =3D 0; i < n_stress_kthread; i++) { - sktp[i].tp =3D kthread_run(test_ratelimit_stress_child, &sktp[i], "%s/%i= ", - "test_ratelimit_stress_child", i); - KUNIT_EXPECT_NOT_NULL_MSG(test, sktp, "kthread creation failure"); + struct task_struct *tp; + + tp =3D kthread_create(test_ratelimit_stress_child, &sktp[i], + "%s/%i", "test_ratelimit_stress_child", i); + if (IS_ERR(tp)) { + KUNIT_FAIL(test, "kthread_create failed: %ld", PTR_ERR(tp)); + goto out_stop; + } + + sktp[i].tp =3D tp; + wake_up_process(tp); + n_started++; pr_alert("Spawned test_ratelimit_stress_child %d\n", i); } schedule_timeout_idle(stress_duration); + +out_stop: WRITE_ONCE(doneflag, 1); - for (i =3D 0; i < n_stress_kthread; i++) { + for (i =3D 0; i < n_started; i++) { kthread_stop(sktp[i].tp); skt.nattempts +=3D sktp[i].nattempts; skt.nunlimited +=3D sktp[i].nunlimited; skt.nlimited +=3D sktp[i].nlimited; skt.nmissed +=3D sktp[i].nmissed; } - KUNIT_ASSERT_EQ_MSG(test, skt.nunlimited + skt.nlimited, skt.nattempts, - "Outcomes not equal to attempts"); - KUNIT_ASSERT_EQ_MSG(test, skt.nlimited, skt.nmissed, "Misses not equal to= limits"); + if (n_started =3D=3D n_stress_kthread) { + KUNIT_ASSERT_EQ_MSG(test, skt.nunlimited + skt.nlimited, skt.nattempts, + "Outcomes not equal to attempts"); + KUNIT_ASSERT_EQ_MSG(test, skt.nlimited, skt.nmissed, + "Misses not equal to limits"); + } + + kfree(sktp); } =20 static struct kunit_case ratelimit_test_cases[] =3D { --=20 2.34.1