Hi Jens, On Thu, Oct 10, 2024 at 01:31:21PM -0600, Jens Axboe wrote: > Hi, > > Discussed this with Pavel, and on his suggestion, I tried prototyping a > "buffer update" opcode. Basically it works like > IORING_REGISTER_BUFFERS_UPDATE in that it can update an existing buffer > registration. But it works as an sqe rather than being a sync opcode. > > The idea here is that you could do that upfront, or as part of a chain, > and have it be generically available, just like any other buffer that > was registered upfront. You do need an empty table registered first, > which can just be sparse. And since you can pick the slot it goes into, > you can rely on that slot afterwards (either as a link, or just the > following sqe). > > Quick'n dirty obviously, but I did write a quick test case too to verify > that: > > 1) It actually works (it seems to) It doesn't work for ublk zc since ublk needs to provide one kernel buffer for fs rw & net send/recv to consume, and the kernel buffer is invisible to userspace. But __io_register_rsrc_update() only can register userspace buffer. Also multiple OPs may consume the buffer concurrently, which can't be supported by buffer select. thanks, Ming