blk_attempt_plug_merge(9)
π 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β therequest_queuewhere the new bio is being queued at πΈbioβ the new bio being queued π¦nr_segsβ number of segments inbiofrom the passed inqalready 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms