Re: [PATCH v4 2/7] iommufd: Add iommufd_object_tombstone_user() helper
From: Xu Yilun
Date: Fri Jul 11 2025 - 11:12:50 EST
> 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.
> */