[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <176296116216.24001.10740596505863921319.b4-ty@kernel.dk>
Date: Wed, 12 Nov 2025 08:26:02 -0700
From: Jens Axboe <axboe@...nel.dk>
To: Ming Lei <ming.lei@...hat.com>, Keith Busch <kbusch@...nel.org>,
Chaitanya Kulkarni <kch@...dia.com>,
Caleb Sander Mateos <csander@...estorage.com>
Cc: linux-block@...r.kernel.org, io-uring@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] io_uring/rsrc: don't use blk_rq_nr_phys_segments() as
number of bvecs
On Tue, 11 Nov 2025 12:15:29 -0700, Caleb Sander Mateos wrote:
> io_buffer_register_bvec() currently uses blk_rq_nr_phys_segments() as
> the number of bvecs in the request. However, bvecs may be split into
> multiple segments depending on the queue limits. Thus, the number of
> segments may overestimate the number of bvecs. For ublk devices, the
> only current users of io_buffer_register_bvec(), virt_boundary_mask,
> seg_boundary_mask, max_segments, and max_segment_size can all be set
> arbitrarily by the ublk server process.
> Set imu->nr_bvecs based on the number of bvecs the rq_for_each_bvec()
> loop actually yields. However, continue using blk_rq_nr_phys_segments()
> as an upper bound on the number of bvecs when allocating imu to avoid
> needing to iterate the bvecs a second time.
>
> [...]
Applied, thanks!
[1/1] io_uring/rsrc: don't use blk_rq_nr_phys_segments() as number of bvecs
commit: 2d0e88f3fd1dcb37072d499c36162baf5b009d41
Best regards,
--
Jens Axboe
Powered by blists - more mailing lists