Re: [PATCH] dma-buf: Split sgl by largest page-aligned chunk
From: David Laight
Date: Tue Jun 23 2026 - 04:26:58 EST
On Mon, 22 Jun 2026 17:26:10 -0400
David Hu <xuehaohu@xxxxxxxxxx> wrote:
> On Mon, Jun 22, 2026 at 4:13 AM David Laight
> <david.laight.linux@xxxxxxxxx> wrote:
> >
>
> Hi David,
>
> Thank you for your review. You raised many good points regarding
> optimizations here. I'll switch to using 2G as the max entry size
> (`SZ_2G` from `linux/sizes.h`), and remove divisions and
> multiplications. I'll also replace the `for()` loop with `while
> (length)`, and drop `min_t()` in favor of `min()` by casting `SZ_2G`
> to `size_t`.
You shouldn't need a cast at all.
David L.
> I'll send out a v2 with these changes shortly.
>
> Thanks,
> David