blk_attempt_plug_merge(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… blk_attempt_plug_merge(9) β€” Kernel API Manual πŸ’…

Okay bestie, welcome to the Kernel API Manual page for blk_attempt_plug_merge. This one is all about trying to merge stuff into %current's plugged list, and yes, the kernel is being iconic about it ✨


πŸ¦‹ NAME πŸ¦‹

blk_attempt_plug_merge β€” try to merge with %current's plugged list 🫢


✨ SYNOPSIS ✨

bool blk_attempt_plug_merge (struct request_queue *q , struct bio *bio ,
       unsigned int nr_segs );

Literal main-character energy: it takes a q, a bio, and nr_segs, and returns a bool πŸ’–


πŸŽ€ ARGUMENTS πŸŽ€

  • q β€” the request_queue where the new bio is being queued at 🌸
  • bio β€” the new bio being queued πŸ¦‹
  • nr_segs β€” number of segments in bio from the passed in q already in the plug list πŸ‘‘

🌸 DESCRIPTION 🌸

So the whole point: determine whether the bio being queued on q can be merged with the previous request on current's plugged list. Returns true if the merge was successful, otherwise false. No cap πŸ’…

Plugging coalesces IOs from the same issuer for the same purpose without going through q->queue_lock. As such it's more of an issuing mechanism than scheduling, and the request, while may have elvpriv data, is not added on the elevator at this point. In addition, we don't have reliable access to the elevator outside queue lock. Only check basic merging parameters without querying the elevator πŸ”₯

Caller must ensure !blk_queue_nomerges(q) beforehand. Like, fr fr β€” that's the vibe check you cannot skip, bestie 🚨

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./block/blk-merge.c β€” bvec_split_segs(9), bio_split_io_at(9), bio_split_to_limits(9), blk_rq_set_mixed_merge(9) πŸ’œ


Source/version: ./block Β· Date: October 2026 Β· Page: blk_attempt_plug_merge(9). That's the cute little footer sign-off, bestie β€” now go merge responsibly πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from