[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250617230136.GC1575786@nvidia.com>
Date: Tue, 17 Jun 2025 20:01:36 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Nicolin Chen <nicolinc@...dia.com>
Cc: kevin.tian@...el.com, shuah@...nel.org, joao.m.martins@...cle.com,
steven.sistare@...cle.com, iommu@...ts.linux.dev,
linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
thomas.weissschuh@...utronix.de
Subject: Re: [PATCH rc 1/4] iommufd/selftest: Fix iommufd_dirty_tracking with
large hugepage sizes
On Tue, Jun 17, 2025 at 02:23:41PM -0700, Nicolin Chen wrote:
> On Tue, Jun 17, 2025 at 08:59:48AM -0300, Jason Gunthorpe wrote:
> > On Mon, Jun 16, 2025 at 07:02:08PM -0700, Nicolin Chen wrote:
> > > ---breakdown---
> > > After `posix_memalign()`:
> > > [ posix_memalign() memory ] ← malloc thinks it owns this
> > >
> > > Then `mmap(aligned_ptr, ..., MAP_FIXED)`:
> > > [ anonymous mmap region ] ← malloc still thinks it owns this (!)
> > > ↑ mapped
> > > ---end---
> >
> > Yes, this is correct and what we are doing here. The allocator always
> > owns it and we are just replacing the memory with a different mmap.
>
> Hmm, if allocator always owns it. Does that mean the munmap() [3]
> will release what [1] and [2] do (allocating and replacing)?
No, munmap doesn't destroy the allocator meta data.
Jason
Powered by blists - more mailing lists