On 6/17/24 04:16, Chenliang Li wrote:
Actually here it does account an entire folio. The j is just
array index.
Hmm, indeed. Is iteration the only difference here?
It seems like you can just call io_buffer_account_pin()
instead.
On that note, you shouldn't duplicate code in either case,
just treat the normal discontig pages case as folios of
shift=PAGE_SHIFT.
Either just plain reuse or adjust io_buffer_account_pin()
instead of io_coalesced_buffer_account_pin().
io_coalesced_imu_alloc() should also go away.
io_sqe_buffer_register() {
struct io_imu_folio_data data;
if (!io_sqe_buffer_try_coalesce(pages, folio_data)) {
folio_data.shift = PAGE_SHIFT;
...
}
io_buffer_account_pin(pages, &data);
imu->data = uaddr;
...
}
Will remove them.
--
Pavel Begunkov