On Fri, Jul 11, 2025 at 10:05:13AM -0400, Caleb Sander Mateos wrote: > On Wed, Jul 9, 2025 at 7:57 AM Ming Lei <ming.lei@xxxxxxxxxx> wrote: > > > > On Tue, Jul 08, 2025 at 09:27:57AM -0400, Caleb Sander Mateos wrote: > > > On Wed, Jul 2, 2025 at 12:04 AM Ming Lei <ming.lei@xxxxxxxxxx> wrote: > > > > > > > > Remove ublk_commit_and_fetch() and open code request completion. > > > > > > > > Now request reference is stored in 'ublk_io', which becomes one global > > > > variable, the motivation is to centralize access 'struct ublk_io' reference, > > > > then we can introduce lock to protect `ublk_io` in future for supporting > > > > io batch. > > > > > > I didn't follow this. What do you mean by "global variable"? > > > > ublk server can send anything to driver with specified tag if batch io > > extension is added and per-io task is relaxed, then 'ublk_io' instance can be > > visible to any userpsace command, which needs protection, looks like one > > global variable. > > > > If reference is stored in request pdu, things becomes more like local > > variable, since the early ublk_io flag check guarantees that concurrent > > access can't reach 'request'. > > "global variable" means something specific in C, so I would avoid > using it here to refer to something else. How about something like the > following? > > Consolidate accesses to struct ublk_io in > UBLK_IO_COMMIT_AND_FETCH_REQ. When the ublk_io daemon task restriction > is relaxed in the future, ublk_io will need to be protected by a lock. > Unregister the auto-registered buffer and complete the request last, > as these don't need to happen under the lock. OK. Thanks, Ming