From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8441C3148DC for ; Mon, 6 Apr 2026 09:09:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775466551; cv=none; b=JPIe9K9LmAx3///FEvRaBmByhMuzSlvFmQVCZUmhqGlejQeyX5t8dqVlrVWXvSBLh7dxMlrR2s/spUqxujhxnwM4n3HShSM7ODMpUdFvLFex9ropyMXN0J61i0IQPnP+5/i/0HY25Z9okC9KYr0FOmGPVuxNSZ98D/9nXGs57Fk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775466551; c=relaxed/simple; bh=TmavGANFAIOMlKVXwFFcm00j/9jYR4IU51JHihFbE4w=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=WTnEFgJQWPI+LNRP7yWxZ2FSfIlAYNczkMVG4flSwUl6nomO20PHBWcqwTB+xo9Yu08DJs/shrayJ6mG4XToxzethYrKS7cYxprDQDvOC5kt9W2/QMztky/NXfTh6IqC1ZNij2w8WSQ5oO08XMansfvQaaiNkeUFz3jaTgbU8N8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rQ5GDOnL; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rQ5GDOnL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AAB37C19425; Mon, 6 Apr 2026 09:09:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775466551; bh=TmavGANFAIOMlKVXwFFcm00j/9jYR4IU51JHihFbE4w=; h=From:To:Cc:Subject:Date:From; b=rQ5GDOnLY7Sf03uQ6SNcVFIcEUzX7QpwBj1PMB6AKwEewkW7HSxfY1lVHvexIiVHC FfPoZKEDOf9FYwQVYhULkEDEB3iSub7kkmyxXZDtX++8sL+VqzR9WMvfEcHWZDunen zhAlirxmcRTVDG2p+Eo4DNZ2brKaGPu6Heq5yAg8GpVXMA+o+vCGU3mQiiX9OkpTgx wghBxmaUT7lI24+UvrbX5P/ecS7W1IMDxo4QcG48ugy81sgP/Y47+ahKEgYGlEQUDb VrxdCbmnxeDm9tBGqgt4+YewEJcA+nPUJRhooUBsJIOn3tjRGpaqMkOzoo+Jafu+yC iL+J8oLpGGAPg== From: "Harry Yoo (Oracle)" To: Vlastimil Babka , Andrew Morton Cc: Hao Li , Christoph Lameter , David Rientjes , Roman Gushchin , Alexei Starovoitov , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH V2 0/2] slub_kunit: add a test case for {kmalloc,kfree}_nolock Date: Mon, 6 Apr 2026 18:09:05 +0900 Message-ID: <20260406090907.11710-1-harry@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Test bots don't seem to test kmalloc_nolock() and kfree_nolock(), so subtle bugs are discovered late. To make it easier to test, add a kunit test case that stresses these paths by combining a tight alloc/free loop with perf-triggered interrupts that invoke {kmalloc,kfree}_nolock() from the overflow handler. While at it, also add the missing MAINTAINERS entry for slub_kunit.c. v1->v2: - Fix build errors on arches without CONFIG_PERF_EVENTS (Thanks Vlastimil) - Rename some identifiers - Use GFP_KERNEL_ACCOUNT or GFP_KERNEL for kmalloc(), instead of 0 or __GFP_ACCOUNT (that was unnecessarily restrictive). p.s. I was writing this test while developing kvfree_rcu_nolock(), let's add a test case in advance. Probably a similar test case for the page allocator is worth adding but I'm not sure where the right place would be. v1: https://lore.kernel.org/linux-mm/20260330120517.104743-1-harry@kernel.org Harry Yoo (Oracle) (2): MAINTAINERS: add lib/tests/slub_kunit.c to SLAB ALLOCATOR section lib/tests/slub_kunit: add a test case for {kmalloc,kfree}_nolock MAINTAINERS | 1 + lib/tests/slub_kunit.c | 92 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) base-commit: dbc785fb4d9cfa0115e69e614fe20b4ab90f8366 -- 2.43.0