bcachefs: Prioritize fragmentation in bucket allocator
authorKent Overstreet <kent.overstreet@gmail.com>
Tue, 21 Aug 2018 19:19:33 +0000 (15:19 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:09 +0000 (17:08 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/alloc.c

index 82f27a57dc610291b8c2ef0beabc341a10ccf0d7..73c11f808edcdc77e3815b4149d1dd3c661d7257 100644 (file)
@@ -610,7 +610,7 @@ static unsigned long bucket_sort_key(struct bch_fs *c, struct bch_dev *ca,
 
        return  (data_wantness << 9) |
                (needs_journal_commit << 8) |
-               bucket_gc_gen(ca, b);
+               (bucket_gc_gen(ca, b) / 16);
 }
 
 static inline int bucket_alloc_cmp(alloc_heap *h,