bcachefs: reduce stack usage in alloc_sectors_start()
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 26 May 2025 21:15:11 +0000 (17:15 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Fri, 30 May 2025 05:21:13 +0000 (01:21 -0400)
with typical config options, variables in different inline functions
aren't sharing stack space - and these are slowpaths.

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

index 1a52c12c51ae60ade376dc87e639671d521a06bf..4341201deec3f2fe4b967ba15ddaf331d493c598 100644 (file)
@@ -1104,7 +1104,7 @@ static inline bool too_many_writepoints(struct bch_fs *c, unsigned factor)
        return stranded * factor > free;
 }
 
-static bool try_increase_writepoints(struct bch_fs *c)
+static noinline bool try_increase_writepoints(struct bch_fs *c)
 {
        struct write_point *wp;
 
@@ -1117,7 +1117,7 @@ static bool try_increase_writepoints(struct bch_fs *c)
        return true;
 }
 
-static bool try_decrease_writepoints(struct btree_trans *trans, unsigned old_nr)
+static noinline bool try_decrease_writepoints(struct btree_trans *trans, unsigned old_nr)
 {
        struct bch_fs *c = trans->c;
        struct write_point *wp;