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 2B47A3876BD for ; Fri, 3 Apr 2026 10:01:20 +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=1775210481; cv=none; b=MdjsMNrV1D+3GPTQdw2nt+s0ibOzOOWgiORItigMtE9BdcmyETNSHk5CXKPIX8LZDDawHP6UYM2krCrSZsVDrevkse81tlUy1NrLV+tskq/vei2AIKyrxMe3AaGPd2pz/pzwZAP7fCKToyxwOoCFCqYkhqtr8L62x63f2khdFi8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775210481; c=relaxed/simple; bh=nSCRqLQnM6uFzcHt8+OMxjPYivIsJJkDMf1sy24GPZ8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Uk5u87AnGXYE+4C5L0htsGkpabrqpxi/Qi5ZDQM22AfFWmKVHeFcO3OGyb+5xIcLBFSm5RqD0vNicYIpYZ9oH2CveHlok+nqFZedCnC42ZnWgykAEyNpBlpFnvhyI4P0Mb0Nlc9e7zpX/k2ZJuozDCkWN9cZLtD3CeL8jrK8pHM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oKH8v1zs; 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="oKH8v1zs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 478CEC4CEF7; Fri, 3 Apr 2026 10:01:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775210479; bh=nSCRqLQnM6uFzcHt8+OMxjPYivIsJJkDMf1sy24GPZ8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oKH8v1zsyhD+mcjNRFIOjLFDK0MSXlNzvKI9BgeiburBCk1IfEIhL668l8xWeVVmc P7xneHP5f9vcfK5kggJAmFrMRb40j9kE0/sW63ZEiu1fJs+iGDBOKyhRfYbhpNKIgp gOsNTLqbrYhW77uNHbbyJq0jYfyEPeIIv+K4hem8g0wNT/RuEB4xMyb7tk6vRUT6qu 3ctZXOD5mKvnBgbeprlsZraJhajIsPZTPUHGGA0eoIPz+ODcC1GIH+4Ol0otJugL0Q cRpWUSnhiHqsoUQTeaGZxnPaBxODyTA2bQYtTPZYBzUVQgqRRq3z15GJVaNKBk4rT0 G1wCEj7k+DqLw== Date: Fri, 3 Apr 2026 19:01:16 +0900 From: "Harry Yoo (Oracle)" To: "Vlastimil Babka (SUSE)" Cc: Andrew Morton , Hao Li , Christoph Lameter , David Rientjes , Roman Gushchin , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Alexei Starovoitov Subject: Re: [PATCH V1 2/2] lib/tests/slub_kunit: add a test case for {kmalloc,kfree}_nolock Message-ID: References: <20260330120517.104743-1-harry@kernel.org> <20260330120517.104743-3-harry@kernel.org> <26e81ffe-08ad-4c3f-a360-d45c3cb32ee2@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <26e81ffe-08ad-4c3f-a360-d45c3cb32ee2@kernel.org> On Thu, Apr 02, 2026 at 04:36:59PM +0200, Vlastimil Babka (SUSE) wrote: > On 3/30/26 2:05 PM, Harry Yoo (Oracle) wrote: > > Testing invocation of {kmalloc,kfree}_nolock() during kmalloc() or > > kfree() is tricky, and it is even harder to ensure that slowpaths are > > properly tested. Lack of such testing has led to late discovery of > > the bug fixed by commit a1e244a9f177 ("mm/slab: use prandom if > > !allow_spin"). > > > > Add a slub_kunit test that allocates and frees objects in a tight loop > > while a perf event triggers NMIs on the same task, invoking > > {kmalloc,kfree}_nolock() from the NMI handler. > > > > Signed-off-by: Harry Yoo (Oracle) > > perf_event_create_kernel_counter() seems to only exist with > CONFIG_PERF_EVENTS, Thanks for catching that! > there's not even some "return -EINVAL" skeleton > otherwise, AFAICS. Right. > Didn't check the various other definitions, but guess > we'll need to put some/all of this behind #ifdef's then? I'll make sure it builds w/o CONFIG_PERF_EVENTS and send v2. -- Cheers, Harry / Hyeonggon