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 9E6CAC71150 for ; Sat, 14 Jun 2025 15:35:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E97DA6B0088; Sat, 14 Jun 2025 11:35:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E21786B0089; Sat, 14 Jun 2025 11:35:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CE91E6B008A; Sat, 14 Jun 2025 11:35:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id BADB76B0088 for ; Sat, 14 Jun 2025 11:35:54 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 64C47121435 for ; Sat, 14 Jun 2025 15:35:54 +0000 (UTC) X-FDA: 83554406628.19.6AA56B8 Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) by imf03.hostedemail.com (Postfix) with ESMTP id 604C920006 for ; Sat, 14 Jun 2025 15:35:52 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=S8qh2trj; spf=pass (imf03.hostedemail.com: domain of urezki@gmail.com designates 209.85.167.44 as permitted sender) smtp.mailfrom=urezki@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1749915352; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=21CiR4XNO29g+j3jUgvLM4rd1CxnhnosKhv5aVJJKQs=; b=4F0fxS+2VAKAWOxDtG5qmwrfjJufN16VP32k5WH85xX8TmVNA8QW7oIggNd2y9ZMyOdPKw zalyEPk8W6ZdBivmT6XRKMIa9DuVrLLytiB1nx0tzsKArhi3ssh082B/Cc7ZMqbkvcoNPM CjsWIRYNsz6uN6MoViR10xqtP7S+P6Y= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1749915352; a=rsa-sha256; cv=none; b=FO4cRXUrSCIMxT+zAROcDQ1jw/EuL7L+ghwCuVJ1YoCngiJhObb9emhFZ8CCrqKV005EBG Brv/83qOtIGkEmQNg24Vh1JN+bKMEyjQafwkWATeUceopV+Uqjep/WGZccD1t+G9ejMf6n 05T3nejmbeMh4mCi9whK92Lac6Zem1w= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=S8qh2trj; spf=pass (imf03.hostedemail.com: domain of urezki@gmail.com designates 209.85.167.44 as permitted sender) smtp.mailfrom=urezki@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-54d98aa5981so3929627e87.0 for ; Sat, 14 Jun 2025 08:35:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749915350; x=1750520150; darn=kvack.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=21CiR4XNO29g+j3jUgvLM4rd1CxnhnosKhv5aVJJKQs=; b=S8qh2trj0f61e9vBEIKzzFD4YSMWhJUHxCDRb8+RCS7ED0hkm5El+dVv29Vq4b/xUV tvSLnLQQLEdWV7WXPGfORCkL/PrXefQdJtbkoAmBcI/MPKNByCnb74PjlAYy79RytkPJ ZsgxX0a4gjqKiaPFakzL7FUBazbcDaBWMakj54JYjjyibIAAtGV74TdaexHxCOayh0dD YD4AdA1O9deyKpmGR0GJUF9sIaelT4AYSKDty/WN3INmOedLwt7FmKjsN7yumzlBdiFR xrEzEwqdGCErPAh0ryggHmI3AsjBRfJA5GG5i+uePLBNaK2fu4sfnN1seCr7CHYxPCHN c/LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749915350; x=1750520150; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=21CiR4XNO29g+j3jUgvLM4rd1CxnhnosKhv5aVJJKQs=; b=DVFrD7N1bGFxp4in+RxI29wOirYQZ7dU7dJ/HlesZOtU/TQFOoB1j+s1g57gUwr3Df 68wjSB63W0f8NAXJs900lqH6JiS4MnUX7jhQh+tK2NRKizQfc831H7Xyn3Bgv/LmUwi4 YGupcZVhxzEdyaPYvwxvXYJ4zSfkSa6n8kq6e85BlSmt/klxyLMOrg20pvynws4PD+7X VrZsFRvq57fM2JR57GIhLHiMLFx2/UvAnDBSFG4jWLvMVQ3f7BpBr0H+pKyMLMJfcAbu zJ+0o6So2YMJEQ3K2JPhu0yZ9SHgevgg7p1pYrJG3e1qFa4vVh4ZDCmNpq5+vzeinHh8 zA0g== X-Forwarded-Encrypted: i=1; AJvYcCXHFimO2LrGILE8DNdBqivYiApPPjA5A78lJdM+TYLyo7K7Ur0qTxlmfJMSHONM8w6+YuSqbXJSzA==@kvack.org X-Gm-Message-State: AOJu0YzI07vUg74Aj4eRke7MOSUV5MxpBo3wDGVCGtSR2ho/ERtJcd3o fZuIiw8FkV/7CCBbHBKRjD1kvU1NuNeteJhhxFzN9+BGn0t0z9UZIjTS X-Gm-Gg: ASbGnctum24kovJqFsT80BS3nUCMFd3/gamCb2/mZiF0Xu49tO99eRSnK3vqNXHK6Qe k7rr2Oq3sq2NX/ZDQmQ5PDcg7a0K1DsHtKEss3kzlMMCl1rpbppMQUYik9WTCk1fJ486/sJtTXU fcyLMXWMwm9ZVBJNKhaOoq+5Z7jwhOQ2LXYj6+5Pf02Anh0soehP8PgBhhKbp2E8K2uRQCVYGN7 7UxVfG66zt7DXThCHRh6pZRKIgFpTBfiJt/g4sGslwTarvByt6bujBSVBFNVqwqXyS8/Bc+Zv3N L2pS5OJw9FzyuGOkQ96cYKXS9s6g X-Google-Smtp-Source: AGHT+IHFBaeLcVckKVW7IHweItTPqSsXeF13zuZ3KJFAYsmL34PaHP5pZrggwwKzPhPo3La6tmqrIQ== X-Received: by 2002:a05:6512:3e23:b0:553:2190:fef8 with SMTP id 2adb3069b0e04-553b6e6d5f2mr686271e87.7.1749915350032; Sat, 14 Jun 2025 08:35:50 -0700 (PDT) Received: from pc636 ([2001:9b1:d5a0:a500::800]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-553ac1aa020sm870851e87.101.2025.06.14.08.35.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Jun 2025 08:35:48 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Sat, 14 Jun 2025 17:35:47 +0200 To: Dev Jain Cc: Uladzislau Rezki , Andrew Morton , linux-mm@kvack.org, LKML , Baoquan He , Christoph Hellwig , Oleksiy Avramchenko , Ryan Roberts Subject: Re: [PATCH 2/4] lib/test_vmalloc.c: Allow built-in execution Message-ID: References: <20250417161216.88318-1-urezki@gmail.com> <20250417161216.88318-2-urezki@gmail.com> <6c6f1cfa-7f1b-4133-ae2a-c6b1ef2d82e8@arm.com> <0a7dd23f-9f6f-46b5-8ef0-b09ea1b3ccd7@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0a7dd23f-9f6f-46b5-8ef0-b09ea1b3ccd7@arm.com> X-Rspam-User: X-Rspamd-Queue-Id: 604C920006 X-Stat-Signature: pncfwfdmctgw6je9pnu6u4yq6uhoxtuo X-Rsp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ULMD9HGEgwVGKyMKrhkf6G8MGJ4Fkckd7d9hPtPhru8P3AIvUKGNJeDoOMr6j63nIofNL0CchkLDDpy/QhFZk7INsBK0SZdNGQXBPNud4BHkGtRgR54kGnoBr05pioOruOHuriraEedEDb0NbTQ6v6to9H+YZ6KitFC1E22sobfU6GAGSBbByA+babvthN9Nkn/+Xa6oT/UCFU0FEy228GgLM+tyGPnj+eCW1lKVKnk6fz4DHlo3qQgmmtDf3RaUDQFGJXr8lnVAEIoL3uMTomvjNCT1MDYfT+qWYnglP/Dwh5l78fcywm6FaABtiHnQHxbRjCOfRTBi1dSxrUFDXNZdEbNxRw5ZGf4jii4kOZx1BL3uQeGsnVnxoK0UakDYkECrdLvt3VKAGb7J2Eb468BLysegyHAQa6xihkkCfi6C50bjVcx1RK 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 Sat, Jun 14, 2025 at 03:57:26PM +0530, Dev Jain wrote: > > On 13/06/25 8:07 pm, Uladzislau Rezki wrote: > > On Fri, Jun 13, 2025 at 07:53:37PM +0530, Dev Jain wrote: > > > On 13/06/25 7:49 pm, Uladzislau Rezki wrote: > > > > Hello, Dev! > > > > > > > > > On 17/04/25 9:42 pm, Uladzislau Rezki (Sony) wrote: > > > > > > This patch removes the dependency on module loading ("m") > > > > > > for the vmalloc test suite, enabling it to be built directly > > > > > > into the kernel, so both ("=m") and ("=y") are supported. > > > > > > > > > > > > Motivation: > > > > > > - Faster debugging/testing of vmalloc code; > > > > > > - It allows to configure the test via kernel-boot parameters. > > > > > > > > > > > > Configuration example: > > > > > > test_vmalloc.nr_threads=64 > > > > > > test_vmalloc.run_test_mask=7 > > > > > > test_vmalloc.sequential_test_order=1 > > > > > > > > > > > > Signed-off-by: Uladzislau Rezki (Sony) > > > > > > --- > > > > > > lib/Kconfig.debug | 3 +-- > > > > > > lib/test_vmalloc.c | 5 +++-- > > > > > > 2 files changed, 4 insertions(+), 4 deletions(-) > > > > > > > > > > > > diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug > > > > > > index f9051ab610d54..166b9d830a85a 100644 > > > > > > --- a/lib/Kconfig.debug > > > > > > +++ b/lib/Kconfig.debug > > > > > > @@ -2574,8 +2574,7 @@ config TEST_BITOPS > > > > > > config TEST_VMALLOC > > > > > > tristate "Test module for stress/performance analysis of vmalloc allocator" > > > > > > default n > > > > > > - depends on MMU > > > > > > - depends on m > > > > > > + depends on MMU > > > > > > help > > > > > > This builds the "test_vmalloc" module that should be used for > > > > > > stress and performance analysis. So, any new change for vmalloc > > > > > > diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c > > > > > > index 4ab23e5e772d0..6d65ef725d42c 100644 > > > > > > --- a/lib/test_vmalloc.c > > > > > > +++ b/lib/test_vmalloc.c > > > > > > @@ -591,10 +591,11 @@ static void do_concurrent_test(void) > > > > > > kvfree(tdriver); > > > > > > } > > > > > > -static int vmalloc_test_init(void) > > > > > > +static int __init vmalloc_test_init(void) > > > > > > { > > > > > > do_concurrent_test(); > > > > > > - return -EAGAIN; /* Fail will directly unload the module */ > > > > > > + /* Fail will directly unload the module */ > > > > > > + return IS_BUILTIN(CONFIG_TEST_VMALLOC) ? 0:-EAGAIN; > > > > > > } > > > > > > module_init(vmalloc_test_init) > > > > > Hi Uladzislau, > > > > > > > > > > Post this patch I am seeing the following problem: while booting the kernel, this test is > > > > > executed and a particular testcase triggers a warning splat from the kernel, then the boot > > > > > gets stuck for 3-4 seconds, then proceeds. I am not an expert on modules so I don't know > > > > > what happened but I am guessing that when the test fails, the delay is due to module > > > > > unloading time...do you suggest a solution? I reverted your patch and then proceeded with > > > > > my work, so apologies for not having the dmesg log, if you need it I'll replicate, although > > > > > there is some subtest which has consistently been spitting out a warning on my Apple M3 Linux > > > > > VM and I have been just ignoring it for long : ) > > > > > > > > > This is because CONFIG_TEST_VMALLOC=y is built-in in your case. > > > Actually, I have a usecase for test_vmalloc :) I wanted to test my > > > patches through the test, but the problem is that the moment it fails, > > > it gets unloaded and then I cannot use the test at runtime. Currently it > > > is set to =m in my .config. > > > > > Ah. It is unloaded itself when tests are done. Do not use the > > test_vmalloc.ko directly. Instead use test_vmalloc.sh script. > > > > It is located here: ./tools/testing/selftests/mm/test_vmalloc.sh > > > > Example: sudo ./test_vmalloc.sh nr_threads=HOW-MANY-CPU-YOU-have(digit) run_test_mask=7 > > This is what I have been doing. Before your patch, I was able to run the test multiple > times, even in case of failure. After the patch, it fails at boot time and unloads. > If it is set as "m" it will not run during boot, because it will be compiled as a kernel module. Unless your system during a boot process loads all modules. But even then you can trigger the test how many times you want. It must be set as "y" in your system. Then yes, it executes only once during the boot. If you want to execute it many times set it as "m". Could you please do below: urezki@pc638:~/data/raid0/coding/linux.git$ cat .config | grep VMALLOC # CONFIG_DEBUG_PERF_USE_VMALLOC is not set CONFIG_HAVE_ARCH_HUGE_VMALLOC=y CONFIG_VIDEOBUF2_VMALLOC=m CONFIG_HAVE_ARCH_KASAN_VMALLOC=y CONFIG_TEST_VMALLOC=y urezki@pc638:~/data/raid0/coding/linux.git$ -- Uladzislau Rezki