]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bcachefs: Increase default journal size
authorKent Overstreet <kent.overstreet@gmail.com>
Thu, 25 Mar 2021 02:49:05 +0000 (22:49 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:57 +0000 (17:08 -0400)
The default was 1/256th of the device and capped at 512MB, which is
fairly tiny these days.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/journal.c

index 22069c277c15c83a14b187d4c14964d687661168..87623ec8cf4755de034e960429b9e6bcf5978b6f 100644 (file)
@@ -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);
 }