Re: [PATCH v5 01/11] iommu/vt-d: add wrapper functions for page allocations

From: Linu Cherian
Date: Sun Apr 07 2024 - 22:19:19 EST


Hi Pasha,

> -----Original Message-----
> From: Pasha Tatashin <pasha.tatashin@xxxxxxxxxx>
> Sent: Thursday, April 4, 2024 7:26 PM
> To: Linu Cherian <lcherian@xxxxxxxxxxx>
> Cc: akpm@xxxxxxxxxxxxxxxxxxxx; alim.akhtar@xxxxxxxxxxx;
> alyssa@xxxxxxxxxxxxx; asahi@xxxxxxxxxxxxxxx; baolu.lu@xxxxxxxxxxxxxxx;
> bhelgaas@xxxxxxxxxx; cgroups@xxxxxxxxxxxxxxx; corbet@xxxxxxx;
> david@xxxxxxxxxx; dwmw2@xxxxxxxxxxxxx; hannes@xxxxxxxxxxx;
> heiko@xxxxxxxxx; iommu@xxxxxxxxxxxxxxx; jernej.skrabec@xxxxxxxxx;
> jonathanh@xxxxxxxxxx; joro@xxxxxxxxxx; krzysztof.kozlowski@xxxxxxxxxx;
> linux-doc@xxxxxxxxxxxxxxx; linux-fsdevel@xxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx; linux-mm@xxxxxxxxx; linux-
> rockchip@xxxxxxxxxxxxxxxxxxx; linux-samsung-soc@xxxxxxxxxxxxxxx; linux-
> sunxi@xxxxxxxxxxxxxxx; linux-tegra@xxxxxxxxxxxxxxx;
> lizefan.x@xxxxxxxxxxxxx; marcan@xxxxxxxxx; mhiramat@xxxxxxxxxx;
> m.szyprowski@xxxxxxxxxxx; paulmck@xxxxxxxxxx; rdunlap@xxxxxxxxxxxxx;
> robin.murphy@xxxxxxx; samuel@xxxxxxxxxxxx;
> suravee.suthikulpanit@xxxxxxx; sven@xxxxxxxxxxxxx;
> thierry.reding@xxxxxxxxx; tj@xxxxxxxxxx; tomas.mudrunka@xxxxxxxxx;
> vdumpa@xxxxxxxxxx; wens@xxxxxxxx; will@xxxxxxxxxx; yu-
> cheng.yu@xxxxxxxxx; rientjes@xxxxxxxxxx; bagasdotme@xxxxxxxxx;
> mkoutny@xxxxxxxx
> Subject: [EXTERNAL] Re: [PATCH v5 01/11] iommu/vt-d: add wrapper
> functions for page allocations
>
> > Few minor nits.
>
> Hi Linu,
>
> Thank you for taking a look at this patch, my replies below.
>
> > > +/*
> > > + * All page allocations that should be reported to as
> > > +"iommu-pagetables" to
> > > + * userspace must use on of the functions below. This includes
> > > +allocations of
> > > + * page-tables and other per-iommu_domain configuration structures.
> >
> > /s/use on/use one/?
>
> I will correct in the next version (if there is going to be one).
>
> > > + *
> > > + * This is necessary for the proper accounting as IOMMU state can
> > > + be rather
> > > + * large, i.e. multiple gigabytes in size.
> > > + */
> > > +
> > > +/**
> > > + * __iommu_alloc_pages - allocate a zeroed page of a given order.
> > > + * @gfp: buddy allocator flags
> >
> > Shall we keep the comments generic here(avoid reference to allocator
> > algo) ?
>
> There are no references to allocator algorithm. I specify the zero page
> because this function adds __GFP_ZERO. The order and gfp arguments are
> provided by the caller, therefore, should be mentioned.

Just meant to remove the mention of "buddy allocator" in the above comments if I was not clear.
Ie. "* @gfp: allocator flags" instead of "* @gfp: buddy allocator flags" since that is allocator specific.

Thanks
Linu Cherian.