Commit 7c8b166e authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Increase default journal size

The default was 1/256th of the device and capped at 512MB, which is
fairly tiny these days.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent a9d79c6e
......@@ -913,14 +913,17 @@ int bch2_dev_journal_alloc(struct bch_dev *ca)
if (dynamic_fault("bcachefs:add:journal_alloc"))
return -ENOMEM;
/* 1/128th of the device by default: */
nr = ca->mi.nbuckets >> 7;
/*
* clamp journal size to 1024 buckets or 512MB (in sectors), whichever
* clamp journal size to 8192 buckets or 8GB (in sectors), whichever
* is smaller:
*/
nr = clamp_t(unsigned, ca->mi.nbuckets >> 8,
nr = clamp_t(unsigned, nr,
BCH_JOURNAL_BUCKETS_MIN,
min(1 << 10,
(1 << 20) / ca->mi.bucket_size));
min(1 << 13,
(1 << 24) / ca->mi.bucket_size));
return __bch2_set_nr_journal_buckets(ca, nr, true, NULL);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment