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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C968CF9C69 for ; Sun, 22 Sep 2024 06:17:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B5FD56B007B; Sun, 22 Sep 2024 02:17:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AE8B26B0082; Sun, 22 Sep 2024 02:17:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 989836B0085; Sun, 22 Sep 2024 02:17:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 7963B6B007B for ; Sun, 22 Sep 2024 02:17:07 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id E562D120C37 for ; Sun, 22 Sep 2024 06:17:06 +0000 (UTC) X-FDA: 82591366452.30.F5D061B Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by imf20.hostedemail.com (Postfix) with ESMTP id 031861C0008 for ; Sun, 22 Sep 2024 06:17:04 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=De1paph8; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf20.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.167.41 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1726985730; a=rsa-sha256; cv=none; b=OlzbLTZJL52gw5LSTY9DXIk+5aCzoz5PMyclZ+jAfOfp7BfxQfnhHVZHlz4fX0pXKAlpit Vj2WKNkhXwI5ehLXK1Ndiunq/J7PU/PJmChAY9rFXK+7gDTzDFTA7qMroPj1wsliLKT2/t 0Pwq86G8FGg/onlpGy3fYFg0EzyaERM= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=De1paph8; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf20.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.167.41 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1726985730; 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=Dn2ictoSHLp+l35mgClPZL8BskA+nsyYSb4MVFpd50Y=; b=zaFhvXSq8hu5oAM/AHdlTXU82yKs1wssZT5yttBFOV95YzBFoJgycSFO8mk5etbzu2lGEh L9BskurPr8mb+OQ//wcdN8AD03DUC3JZzPjJAPP/TNnWM9n6jrb859A73dBWBiIjd7teka lrzoGqE5sxqoN9AXZYlAp1DjHajcg5I= Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-53659867cbdso4675710e87.3 for ; Sat, 21 Sep 2024 23:17:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726985823; x=1727590623; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Dn2ictoSHLp+l35mgClPZL8BskA+nsyYSb4MVFpd50Y=; b=De1paph8U1n5KfMKS3jXgXkEF+Z44hSNLV250kTKCD+VKAISbqJQb0tZM8GefY5JQs tB2vsk6EjTmbb2iaoIV1qGiUanU8fMSHa/pqprzjZvMw3Uiaer4hf++XhnaE5J6y0oXa RM0vWN1B0bkWRphDhKseGoxIBfkGu4Aqzt2JOJQNZHhiOh6HnMYfVDgO4IyfKExBmx+6 I2voBEBNDoidnPS7rA11ckKAecR1lKtQ+miL2bkeRPbHvJnDM8ioZbtDmIT95fg+WKno OVieMeOowAf8r2t/gE7MqvQ18LtMtx82QyvKwDhJ1wDIVs03G7Tf3u0Bc83U89h05nRu Gdmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726985823; x=1727590623; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Dn2ictoSHLp+l35mgClPZL8BskA+nsyYSb4MVFpd50Y=; b=X1sGeZpGWq9FE22d24z3xc8jgX/o3MEgAh4V04uMymi0VPzSp6gSUsuoUOSiiW9WL+ aJrV1U1e5vvo4brIGRTYLn040WLjouoVasp9OAvzOsz91I+Ej/AyZ3Mh08tNk+Dqday6 YgiamkmuKHfzMjQjDJyUzF6CwazZlpj4nFwFS/HUj+Z8dXXkUJYyvEO+iy1r64r4E8x0 QZn5T2uEH8CAKLh5sW2LMCFJEtN8M7eNOYebmzWvlPq1Kxe8eECfI/GL70CEy/pGwCTk NE7GbbQkHjJjYVmXeNG0gw/Pxigtl9FOTVCK14XdLLXQk+NvUC6V/oOA2QrDuonOmCf9 DFoA== X-Forwarded-Encrypted: i=1; AJvYcCXr7uKjCbE008KuWwrnG3b9ljv5OdIYsMdnRwdAZ9FW/evg9hrpghyFVZb/0EdnyW+5Tb/Lxc7ilA==@kvack.org X-Gm-Message-State: AOJu0YxLXbaUZqO953lElI4X1tJq4ZBX0WFeNtbt9enRxVfkxqtGcaTb Pujdaq8e84WAqPr1w25uagWmrwjAsb004lFKbJftZfGFojDJ5sllGCM48GcheGii0tTQfUJW15A 4z5Dk6s0L7iSKE/MjsBN70rbqGXs= X-Google-Smtp-Source: AGHT+IF4dGVz7RZXvuU7SyII+eRSMktamN/N3uSQWpidMLchgA4iceWv6VyclTJtuGP+eZ/1xhxc3P2N1rufYmv/8KE= X-Received: by 2002:a05:6512:6d1:b0:52c:d628:c77c with SMTP id 2adb3069b0e04-536ac32f044mr5163363e87.43.1726985822724; Sat, 21 Sep 2024 23:17:02 -0700 (PDT) MIME-Version: 1.0 References: <20240807-b4-slab-kfree_rcu-destroy-v2-0-ea79102f428c@suse.cz> <20240807-b4-slab-kfree_rcu-destroy-v2-7-ea79102f428c@suse.cz> <6fcb1252-7990-4f0d-8027-5e83f0fb9409@roeck-us.net> <07d5a214-a6c2-4444-8122-0a7b1cdd711f@suse.cz> <73f9e6d7-f5c0-4cdc-a9c4-dde3e2fb057c@roeck-us.net> <474b0519-b354-4370-84ac-411fd3d6d14b@suse.cz> In-Reply-To: <474b0519-b354-4370-84ac-411fd3d6d14b@suse.cz> From: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Sun, 22 Sep 2024 15:16:50 +0900 Message-ID: Subject: Re: [PATCH v2 7/7] kunit, slub: add test_kfree_rcu() and test_leak_destroy() To: Vlastimil Babka Cc: Guenter Roeck , KUnit Development , Brendan Higgins , David Gow , "Paul E. McKenney" , Joel Fernandes , Josh Triplett , Boqun Feng , Christoph Lameter , David Rientjes , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Julia Lawall , Jakub Kicinski , "Jason A. Donenfeld" , "Uladzislau Rezki (Sony)" , Andrew Morton , Roman Gushchin , linux-mm@kvack.org, linux-kernel@vger.kernel.org, rcu@vger.kernel.org, Alexander Potapenko , Marco Elver , Dmitry Vyukov , kasan-dev@googlegroups.com, Jann Horn , Mateusz Guzik Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 031861C0008 X-Stat-Signature: 7cxyj477w7qbsj6f33kseme5fjrrso7n X-Rspam-User: X-HE-Tag: 1726985824-806072 X-HE-Meta: U2FsdGVkX196Bn897xtvn/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yEZskMhvxQGnwFhHlKbxDzZ1XXLQdrQf+hWLFAW9JrtgPK2HBsytkKaV7+OwagiYMilOaobZt1H8A1ap0+sfdXirk3MflAqzhciRzMxXOXLTubL35jqElugMmWBi3uATYZWVOahAGczPj/iFbHEKVGSaoChMs30adlTxkh387s6Gen2Ct1ZP0FzQWjcA6wBHK0tw12lbxfo8xluQpz+oEBRdEE1LxxeWOM0NksiyPG7VECp2oodwJybuIL+u6cq+2Rn0CLzJAfHNgKOKK4IZjEnvLjJyeI+70fLcvZ499g4OLlcaVM0epUD+ZRv5dK5NveFMuS5gF4ZY/L69Q5HUc/9T4xO3Bie04JTVCR2g== 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: On Sun, Sep 22, 2024 at 6:25=E2=80=AFAM Vlastimil Babka wr= ote: > > On 9/21/24 23:08, Guenter Roeck wrote: > > On 9/21/24 13:40, Vlastimil Babka wrote: > >> +CC kunit folks > >> > >> On 9/20/24 15:35, Guenter Roeck wrote: > >>> Hi, > >> > >> Hi, > >> > >>> On Wed, Aug 07, 2024 at 12:31:20PM +0200, Vlastimil Babka wrote: > >>>> Add a test that will create cache, allocate one object, kfree_rcu() = it > >>>> and attempt to destroy it. As long as the usage of kvfree_rcu_barrie= r() > >>>> in kmem_cache_destroy() works correctly, there should be no warnings= in > >>>> dmesg and the test should pass. > >>>> > >>>> Additionally add a test_leak_destroy() test that leaks an object on > >>>> purpose and verifies that kmem_cache_destroy() catches it. > >>>> > >>>> Signed-off-by: Vlastimil Babka > >>> > >>> This test case, when run, triggers a warning traceback. > >>> > >>> kmem_cache_destroy TestSlub_kfree_rcu: Slab cache still has objects w= hen called from test_leak_destroy+0x70/0x11c > >>> WARNING: CPU: 0 PID: 715 at mm/slab_common.c:511 kmem_cache_destroy+0= x1dc/0x1e4 > >> > >> Yes that should be suppressed like the other slub_kunit tests do. I ha= ve > >> assumed it's not that urgent because for example the KASAN kunit tests= all > >> produce tons of warnings and thus assumed it's in some way acceptable = for > >> kunit tests to do. > >> > > > > I have all tests which generate warning backtraces disabled. Trying to = identify > > which warnings are noise and which warnings are on purpose doesn't scal= e, > > so it is all or nothing for me. I tried earlier to introduce a patch se= ries > > which would enable selective backtrace suppression, but that died the d= eath > > of architecture maintainers not caring and people demanding it to be pe= rfect > > (meaning it only addressed WARNING: backtraces and not BUG: backtraces, > > and apparently that wasn't good enough). > > Ah, didn't know, too bad. > > > If the backtrace is intentional (and I think you are saying that it is)= , > > I'll simply disable the test. That may be a bit counter-productive, but > > there is really no alternative for me. > > It's intentional in the sense that the test intentionally triggers a > condition that normally produces a warning. Many if the slub kunit test d= o > that, but are able to suppress printing the warning when it happens in th= e > kunit context. I forgot to do that for the new test initially as the warn= ing > there happens from a different path that those that already have the kuni= t > suppression, but we'll implement that suppression there too ASAP. We might also need to address the concern of the commit 7302e91f39a ("mm/slab_common: use WARN() if cache still has objects on destroy"), the concern that some users prefer WARN() over pr_err() to catch errors on testing systems which relies on WARN() format, and to respect panic_on_warn. So we might need to call WARN() instead of pr_err() if there are errors in slub error handling code in general, except when running kunit tests? Thanks, Hyeonggon