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