[RFC PATCH v1 05/17] block: add bio_alloc_atomic() for atomic bio users
yu kuai
yukuai at fygo.io
Thu Jul 9 02:49:47 PDT 2026
Hi,
在 2026/7/9 14:12, Christoph Hellwig 写道:
> On Sun, Jul 05, 2026 at 03:51:12AM +0800, Yu Kuai wrote:
>> From: Yu Kuai <yukuai at fygo.io>
>>
>> Add bio_alloc_atomic() for callers that need a GFP_ATOMIC bio from the
>> default bio set but cannot safely pass a bdev during allocation. The
>> helper returns an unattached bio, leaving callers to set bi_bdev and
>> attach blkcg state explicitly before submission.
>>
>> Use the helper for virtio-pmem flush child bios and OCFS2 heartbeat I/O.
>> Both allocate bios from atomic paths and must avoid creating missing blkgs
>> once blkg creation is protected by q->blkcg_mutex. virtio-pmem clones the
>> parent bio's blkg association; OCFS2 binds heartbeat I/O to the root blkg.
> Let's kill off the concept of atomic bio allocations instead.
> Joseph already has an outstanding patch for nd_virtio that needs a little
> bit more work, and ocfs2 should be easy enough as well.
Thanks for the notice and good to hear that. This will make this set much
simpler.
>
--
Thanks,
Kuai
More information about the Linux-nvme
mailing list