Skip to content

Instantly share code, notes, and snippets.

@zoumingzhe
Last active May 23, 2022 09:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoumingzhe/69a353e7c6fffe43142c2f42b94a67b5 to your computer and use it in GitHub Desktop.
Save zoumingzhe/69a353e7c6fffe43142c2f42b94a67b5 to your computer and use it in GitHub Desktop.
bcache dynamic incremental gc performance number
As a comparison, I tested the random write of fio (4k, 128 iodepth, runtime 60s) in two cases:
1. No gc was done before the end of fio
2. Trigger gc 3 times during the fio process (at 10s, 20s and 30s)
Before this patch, dmesg info:
[ 1816.862886] bcache: btree_gc_start() start gc: on set ed1f9649-90dd-4430-afb7-18f1c819cb85
[ 1817.191064] bcache: bch_btree_gc_finish() finish gc: on set ed1f9649-90dd-4430-afb7-18f1c819cb85, avail_nbuckets is 810884
[ 1826.872662] bcache: btree_gc_start() start gc: on set ed1f9649-90dd-4430-afb7-18f1c819cb85
[ 1827.510968] bcache: bch_btree_gc_finish() finish gc: on set ed1f9649-90dd-4430-afb7-18f1c819cb85, avail_nbuckets is 811014
[ 1836.884083] bcache: btree_gc_start() start gc: on set ed1f9649-90dd-4430-afb7-18f1c819cb85
[ 1837.820856] bcache: bch_btree_gc_finish() finish gc: on set ed1f9649-90dd-4430-afb7-18f1c819cb85, avail_nbuckets is 811138
After this patch, dmesg info:
[ 1393.397493] bcache: btree_gc_start() start gc: on set 82b9cb5e-a70d-4f30-b49d-9500a61e6657
[ 1396.740401] bcache: bch_btree_gc_finish() finish gc: on set 82b9cb5e-a70d-4f30-b49d-9500a61e6657, avail_nbuckets is 810916
[ 1396.752098] bcache: bch_btree_gc() gc 19 times with 172 nodes, sleep 2989ms, average gc cost 1951us per node, max inflight 128
[ 1396.775289] bcache: bch_btree_gc() max inflight updated to 76
[ 1403.408413] bcache: btree_gc_start() start gc: on set 82b9cb5e-a70d-4f30-b49d-9500a61e6657
[ 1410.104854] bcache: bch_btree_gc_finish() finish gc: on set 82b9cb5e-a70d-4f30-b49d-9500a61e6657, avail_nbuckets is 811112
[ 1410.116635] bcache: bch_btree_gc() gc 35 times with 344 nodes, sleep 5998ms, average gc cost 1975us per node, max inflight 128
[ 1410.140197] bcache: bch_btree_gc() max inflight updated to 107
[ 1413.420529] bcache: btree_gc_start() start gc: on set 82b9cb5e-a70d-4f30-b49d-9500a61e6657
[ 1424.146089] bcache: bch_btree_gc_finish() finish gc: on set 82b9cb5e-a70d-4f30-b49d-9500a61e6657, avail_nbuckets is 811301
[ 1424.158127] bcache: bch_btree_gc() gc 51 times with 504 nodes, sleep 9623ms, average gc cost 2150us per node, max inflight 128
[ 1424.181986] bcache: bch_btree_gc() max inflight updated to 119
This file has been truncated, but you can view the full file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment