[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aHEnnesvLL5te5rf@yilunxu-OptiPlex-7050>
Date: Fri, 11 Jul 2025 23:02:53 +0800
From: Xu Yilun <yilun.xu@...ux.intel.com>
To: Nicolin Chen <nicolinc@...dia.com>
Cc: jgg@...dia.com, jgg@...pe.ca, kevin.tian@...el.com, will@...nel.org,
aneesh.kumar@...nel.org, iommu@...ts.linux.dev,
linux-kernel@...r.kernel.org, joro@...tes.org, robin.murphy@....com,
shuah@...nel.org, aik@....com, dan.j.williams@...el.com,
baolu.lu@...ux.intel.com, yilun.xu@...el.com
Subject: Re: [PATCH v4 2/7] iommufd: Add iommufd_object_tombstone_user()
helper
> With one nit:
>
> > - while (!xa_empty(&ictx->objects)) {
> > + for (;;) {
> > unsigned int destroyed = 0;
> > unsigned long index;
> > + bool empty = true;
> >
> > + /*
> > + * xa_for_each() will not return tomestones (zeroed entries),
> > + * which prevent the xarray being empty. So use an empty flags
>
> Since the first "empty" and the second "empty" are different things,
>
> > + * instead of xa_empty() to indicate all entries are either
> > + * NULLed or tomestoned.
> > + */
>
> let's write something like this (correcting typos too):
>
> /*
> * We can't use xa_empty(), as a tombstone (NULLed entry) would
^
> * prevent it returning true, unlike xa_for_each() ignoring the
> * NULLed entries. So use an empty flag instead of xa_empty() to
^
s/NULLed/zeroed, are they?
Thanks,
Yilun
> * indicate all entries are either NULLed or tombstoned.
> */
Powered by blists - more mailing lists