Skip to content

bcache-tools: improve large bucket on-disk layout

Coly Li linux-bcache linux-block 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6bcache.h: fix typo from SUUP to SUPPbcache.h+3 -30 replies
2/6bcache-tools: only call set_bucket_size() for cache devicemake.c+2 -10 replies
3/6bcache.h: add BCH_FEATURE_INCOMPAT_LARGE_BUCKET to BCH_FEATURE_INCOMPAT_SUPPbcache.h+1 -10 replies
4/6bcache-tools: check incompatible feature setlib.c+27 -00 replies
5/6bcache-tools: introduce BCH_FEATURE_INCOMPAT_LOG_LARGE_BUCKET_SIZE for large bucketbcache.h features.c lib.c +1 more+28 -80 replies
6/6bcache-tools: display obsoleted bucket size configurationlib.c+7 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/6] bcache-tools: improve large bucket on-disk layout

Current large bucket layout is a preparation for the future zoned cache device, by which the cache device bucket can be aligned to zone size and boundary of the zoned SSD.

Original patch introduces bucket_size_hi in struct cache_sb_disk, this is problematic and can be improved,
- The bucket size is always power-of-2 value, it is unnecessary to add extra space in struct cache_sb_disk to store the real size value. Just using existing bucket_size to store the order of power-of-2 value is enough.
- The added bucket_size_hi is behind d[SB_JOURNAL_BUCKETS] in struct cache_sb_disk, which breaks a very implicit restriction from macro csum_set(). This restriction requires member d[] must be the last member in data structure to calculate the checksum.

This series is to improve the above issue from user space tools. Basic ideas of this series are,
- Add BCH_FEATURE_INCOMPAT_LOG_LARGE_BUCKET_SIZE incompat feature bit. When it is set, for bucket size >16MB, bucket_size stores the order of power-of-2 bucket size value. Then no extra space introduced and csum_set() has all data to calculate super block checksum.
- Rename struct cache_sb_disk's bucket_size_hi to obso_bucket_size_hi, and rename the incompat feature bit BCH_FEATURE_INCOMPAT_LARGE_BUCKET to BCH_FEATURE_INCOMPAT_OBSO_LARGE_BUCKET, to indicate they are not used anymore and obsoleted.
- If a cache device was created for bucket size >16MB with obsoleted layout, "bcache show" command still display the expected bucket size value for legacy compatibility purpose.

Although there almost no one else uses bucket size >16MB except me (the btree node usage code is not optimized yet), it is still necessary to fix and improve the layout usage as soon as possible.

Coly Li
---
Coly Li (6):
bcache.h: fix typo from SUUP to SUPP
bcache-tools: only call set_bucket_size() for cache device bcache.h: add BCH_FEATURE_INCOMPAT_LARGE_BUCKET to
BCH_FEATURE_INCOMPAT_SUPP
bcache-tools: check incompatible feature set
bcache-tools: introduce BCH_FEATURE_INCOMPAT_LOG_LARGE_BUCKET_SIZE for
large bucket
bcache-tools: display obsoleted bucket size configuration

 bcache.h   | 17 +++++++++++------
 features.c |  4 +++-
 lib.c      | 52 ++++++++++++++++++++++++++++++++++++++++++++++++----
 lib.h      |  2 +-
 make.c     |  3 ++-
 5 files changed, 65 insertions(+), 13 deletions(-)
Signature · 1 line
2.26.2