From: Jason Gunthorpe <jgg@ziepe.ca>
To: fangyu.yu@linux.alibaba.com
Cc: joro@8bytes.org, will@kernel.org, robin.murphy@arm.com,
joerg.roedel@amd.com, dan@reactivated.net, vasant.hegde@amd.com,
kevin.tian@intel.com, Ankit.Soni@amd.com, iommu@lists.linux.dev,
linux-kernel@vger.kernel.org, guoren@kernel.org
Subject: Re: [PATCH v2] iommupt/kunit: Skip the page-table leak check on SMP
Date: Mon, 16 Nov 2026 15:21:50 -0400 [thread overview]
Message-ID: <20261116192150.GA2452510@ziepe.ca> (raw)
In-Reply-To: <20261031085536.18555-1-fangyu.yu@linux.alibaba.com>
On Sat, Oct 31, 2026 at 04:55:36PM +0800, fangyu.yu@linux.alibaba.com wrote:
> From: Fangyu Yu <fangyu.yu@linux.alibaba.com>
>
> NR_SECONDARY_PAGETABLE is batched per-CPU on SMP, so the global counter
> can change as pending updates are folded, even when a test has freed all
> its page tables. Comparing the global counter before and after a test
> can therefore report a false leak. A failed teardown assertion also
> aborts cleanup, causing subsequent tests to fail because the test driver
> is still registered.
>
> Only perform the leak-check assertion on non-SMP configurations, where
> there are no per-CPU vmstat deltas. Keep the tests and resource cleanup
> enabled on SMP without accessing MM's internal vmstat data structures.
>
> Fixes: bc5233c0904e ("iommupt: Add a kunit test for the IOMMU implementation")
> Signed-off-by: Fangyu Yu <fangyu.yu@linux.alibaba.com>
> ---
> Changes in v2:
> - Replace the hand-written vmstat snapshot with a non-SMP-only
> assertion, as suggested by Jason.
>
> Link to v1:
> https://lore.kernel.org/linux-iommu/20261015132024.43998-1-fangyu.yu@linux.alibaba.com/
> ---
> drivers/iommu/generic_pt/kunit_iommu_pt.h | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Jason
prev parent reply other threads:[~2026-11-16 19:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-31 8:55 fangyu.yu
2026-11-16 19:21 ` Jason Gunthorpe [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261116192150.GA2452510@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=Ankit.Soni@amd.com \
--cc=dan@reactivated.net \
--cc=fangyu.yu@linux.alibaba.com \
--cc=guoren@kernel.org \
--cc=iommu@lists.linux.dev \
--cc=joerg.roedel@amd.com \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=vasant.hegde@amd.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®