[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aGI7nHgYNtXhiet9@yilunxu-OptiPlex-7050>
Date: Mon, 30 Jun 2025 15:24:12 +0800
From: Xu Yilun <yilun.xu@...ux.intel.com>
To: Baolu Lu <baolu.lu@...ux.intel.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, nicolinc@...dia.com, aik@....com,
dan.j.williams@...el.com, yilun.xu@...el.com
Subject: Re: [PATCH v3 1/5] iommufd: Add iommufd_object_tombstone_user()
helper
> > - while (!xa_empty(&ictx->objects)) {
> > + for (;;) {
> > unsigned int destroyed = 0;
> > unsigned long index;
> > + empty = true;
> > xa_for_each(&ictx->objects, index, obj) {
> > + empty = false;
>
> People like me, who don't know the details of how xa_for_each() and
> xa_empty() work, will ask why "empty = xa_empty()" isn't used here. So
> it's better to add some comments to make it more readable.
>
> /* XA_ZERO_ENTRY is treated as a null entry by xa_for_each(). */
Yes. I try to make it more elaborate:
+ /*
+ * xa_for_each() will not return tomestones (zeroed entries),
+ * which prevent the xarray being empty. So use an empty flag
+ * instead of xa_empty() to indicate all entries are either
+ * NULLed or tomestoned.
+ */
empty = true;
Thanks,
Yilun
>
> Others look good to me.
>
> Reviewed-by: Lu Baolu <baolu.lu@...ux.intel.com>
Powered by blists - more mailing lists