]> www.infradead.org Git - linux.git/commitdiff
bcachefs: Drop memalloc_nofs_save() in bch2_btree_node_mem_alloc()
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 19 Aug 2024 19:11:20 +0000 (15:11 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 9 Sep 2024 13:41:49 +0000 (09:41 -0400)
It's really not needed: the only locks used here are the btree cache
lock, which we drop for GFP_WAIT allocations, and btree node locks - but
we also drop those for GFP_WAIT allocations.

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

index e52a06d3418ccd0226730e4e42737431a57cb6b6..662f0f79b7af09a6d34edec28cd327153a6cc021 100644 (file)
@@ -671,9 +671,7 @@ struct btree *bch2_btree_node_mem_alloc(struct btree_trans *trans, bool pcpu_rea
                : &bc->freed_nonpcpu;
        struct btree *b, *b2;
        u64 start_time = local_clock();
-       unsigned flags;
 
-       flags = memalloc_nofs_save();
        mutex_lock(&bc->lock);
 
        /*
@@ -745,8 +743,6 @@ out:
        bch2_time_stats_update(&c->times[BCH_TIME_btree_node_mem_alloc],
                               start_time);
 
-       memalloc_nofs_restore(flags);
-
        int ret = bch2_trans_relock(trans);
        if (unlikely(ret)) {
                bch2_btree_node_to_freelist(c, b);
@@ -781,7 +777,6 @@ err:
        }
 
        mutex_unlock(&bc->lock);
-       memalloc_nofs_restore(flags);
        return ERR_PTR(-BCH_ERR_ENOMEM_btree_node_mem_alloc);
 }