Re: [PATCH v6 6/8] dma: swiotlb: Centralize memory-encryption pool sizing

From: Kohei Enju

Date: Fri Nov 27 2026 - 03:33:04 EST


On 11/12 15:43, Aneesh Kumar K.V wrote:
> Kohei Enju <enju.kohei@xxxxxxxxxxx> writes:
>
> > Hi Aneesh,
> >
> > On 11/01 09:47, Aneesh Kumar K.V wrote:
> > [...]
> >> >
> >> > Hi Aneesh,
> >> >
>
> [ ... 35 lines skipped ... ]
>
> > Overall, I would prefer the dynamic sizing approach. However, I believe
> > the initial pool size still matters.
> >
> > Also, as Catalin pointed out earlier in the following message:
> >
> > https://lore.kernel.org/all/ann6noRzoPLL9kDY@xxxxxxx/
> >
> > the arm64 adjustment also reduces the target size used for dynamic
> > pool allocation, since both the initial pool and dynamic allocation
> > currently use default_nslabs.
> >
> > I am testing the patch below to decouple the initial pool size from the
> > dynamic allocation target. It adds swiotlb_adjust_initial_size() for
> > callers that only want to reduce the initial allocation, while keeping
> > the existing swiotlb_adjust_size() semantics for callers that want to
> > adjust both sizes.
> >
>
> Should we instead update the logic so that reducing the swiotlb size
> leaves the dynamic allocation size unchanged, while increasing it also
> bumps the dynamic allocation size?

Sorry for the late response.

That makes sense for the arm64 and RISC-V cases. However, for
plat_swiotlb_setup() in arch/mips/cavium-octeon/dma-octeon.c, I'm not
sure whether we also want to preserve the dynamic allocation target when
reducing the initial pool size.

Do we want that change on Octeon too? If not, I'd prefer a separate API
so that we can preserve the existing behavior and explicitly update only
the callers that need to reduce the initial pool size independently of
the dynamic allocation target.

Thanks,
Kohei