[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <BN9PR11MB52763344AF43582DB97EF45B8C11A@BN9PR11MB5276.namprd11.prod.outlook.com>
Date: Fri, 19 Sep 2025 08:18:21 +0000
From: "Tian, Kevin" <kevin.tian@...el.com>
To: Jason Gunthorpe <jgg@...dia.com>
CC: Lu Baolu <baolu.lu@...ux.intel.com>, Joerg Roedel <joro@...tes.org>, "Will
Deacon" <will@...nel.org>, Robin Murphy <robin.murphy@....com>, Jann Horn
<jannh@...gle.com>, Vasant Hegde <vasant.hegde@....com>, "Hansen, Dave"
<dave.hansen@...el.com>, Alistair Popple <apopple@...dia.com>, Peter Zijlstra
<peterz@...radead.org>, Uladzislau Rezki <urezki@...il.com>, "Jean-Philippe
Brucker" <jean-philippe@...aro.org>, Andy Lutomirski <luto@...nel.org>, "Lai,
Yi1" <yi1.lai@...el.com>, "iommu@...ts.linux.dev" <iommu@...ts.linux.dev>,
"security@...nel.org" <security@...nel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, Dave Hansen <dave.hansen@...ux.intel.com>
Subject: RE: [PATCH v4 6/8] mm: Introduce deferred freeing for kernel page
tables
> From: Jason Gunthorpe <jgg@...dia.com>
> Sent: Monday, September 15, 2025 7:35 PM
>
> On Fri, Sep 12, 2025 at 08:17:23AM +0000, Tian, Kevin wrote:
> > > From: Jason Gunthorpe <jgg@...dia.com>
> > > Sent: Saturday, September 6, 2025 2:44 AM
> > >
> > > On Fri, Sep 05, 2025 at 01:51:01PM +0800, Lu Baolu wrote:
> > >
> > > > + list_for_each_entry_safe(pt, next, &page_list, pt_list) {
> > > > + list_del(&pt->pt_list);
> > >
> > > The list_del isn't necessary, it doesn't zero the list, just _safe
> > > iteration is fine.
> > >
> >
> > if no list_del why need to keep the _safe iteration?
>
> __pagetable_free() can change the memory holding pt->pt-list, it is
> like kfree. So _safe is needed to allow that.
>
> _safe is not just about deletion, anything that could change the list
> element must use a safe iteration.
>
yeah, my oversight.
Powered by blists - more mailing lists