Re: [PATCH 2/8] io_uring: add infra for importing vectored reg buffers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/4/25 10:05, Pavel Begunkov wrote:
On 3/3/25 20:49, Caleb Sander Mateos wrote:
On Mon, Mar 3, 2025 at 7:51 AM Pavel Begunkov <asml.silence@xxxxxxxxx> wrote:
...
+       for (i = 0; i < nr_iovs; i++)
+               max_segs += (iov[i].iov_len >> shift) + 2;

Sees like this may overestimate a bit. I think something like this
would give the exact number of segments for each iovec?
(((u64)iov_base & folio_mask) + iov_len + folio_mask) >> folio_shift

It's overestimated exactly to avoid a beast like this.

And it'd be broken as well for 0 len.

--
Pavel Begunkov





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux