bdi_split_work_to_wbs(9)
π bdi_split_work_to_wbs(9) π
okay so bestie, this is a page from the Kernel API Manual, and it's literally about bdi_split_work_to_wbs β splitting a wb_writeback_work to all wb's of a bdi. yes that's a lot of letters, we'll get through it together π«Ά
β¨ NAME β¨
bdi_split_work_to_wbs β split a wb_writeback_work to all wb's of a bdi
like, the whole job of this function in one line. she's giving one-sentence-queen π
π¦ SYNOPSIS π¦
void bdi_split_work_to_wbs (struct backing_dev_info *bdi , struct
wb_writeback_work *base_work , bool skip_if_busy );
that's it, that's the whole signature. void return, so she does the work and doesn't report back β main character energy, no receipts needed π
π ARGUMENTS π
bdiβ the targetbacking_dev_info. this is the thing whose wb's we're about to visit, like showing up at someone's house and knocking on every single door πͺβ¨base_workβ thewb_writeback_workto issue. this is the actual homework we're distributing, ok?skip_if_busyβ skip wb's which already have writeback in progress. like, if they're already busy, don't pile on. read the room bestie π
πΈ DESCRIPTION πΈ
so what she does is: split and issue base_work to all wb's (bdi_writeback's) of bdi which have dirty inodes. key detail β only the ones with dirty inodes, not literally every wb. vibe check first β¨
and then, here's the kinda iconic conditional: if base_work->nr_page isn't LONG_MAX, it's distributed to the busy wbs according to each wb's proportion in the total active write bandwidth of bdi.
read that again. proportion of the total active write bandwidth. she's doing math. she's being fair. she's splitting the pages proportional to bandwidth and honestly? we stan an equitable distribution algorithm ππ
ngl this is the kind of detail that gets skipped when you skim, so like β don't skim.nr_pagevsLONG_MAX, and the bandwidth-proportional split, both matter π
π₯ SEE ALSO π₯
okay this list is LONG, so buckle up, grab a snack π β every single one of these is here because the original says so:
- Kernel file
./fs/fs-writeback.c inode_io_list_move_locked(9)wb_wait_for_completion(9)inode_cgwb_move_to_attached(9)locked_inode_to_wb_and_lock_list(9)inode_to_wb_and_lock_list(9)inode_switch_wbs(9)cleanup_offline_cgwb(9)wbc_attach_and_unlock_inode(9)wbc_attach_fdatawrite_inode(9)wbc_detach_inode(9)wbc_account_cgroup_owner(9)wb_split_bdi_pages(9)cgroup_writeback_by_id(9)cgroup_writeback_umount(9)wb_start_background_writeback(9)filemap_dontcache_kick_writeback(9)__mark_inode_dirty(9)writeback_inodes_sb_nr(9)writeback_inodes_sb(9)try_to_writeback_inodes_sb(9)sync_inodes_sb(9)write_inode_now(9)sync_inode_metadata(9)
twenty-three friends + one file path. she's connected. iykyk π
π§ cute lil sign-off π§
this absolute baddie of a page lives under the source path ./fs, and the version/date stamp on it is October 2026 β so like, mark your calendars, she's from the future bestie ππ¦
go forth and split your work. periodt. π β¨
π¦ 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