]> www.infradead.org Git - users/hch/misc.git/commitdiff
bcachefs: Use __GFP_ACCOUNT for reclaimable memory
authorKent Overstreet <kent.overstreet@linux.dev>
Tue, 3 Sep 2024 21:42:53 +0000 (17:42 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sat, 21 Sep 2024 15:39:46 +0000 (11:39 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_cache.c
fs/bcachefs/btree_key_cache.c

index 7e74df9f194ca46f481ac737a0ee57af333792c9..02e6e609e377de49b585b63b01513bd893506a5c 100644 (file)
@@ -102,6 +102,8 @@ static int btree_node_data_alloc(struct bch_fs *c, struct btree *b, gfp_t gfp)
 {
        BUG_ON(b->data || b->aux_data);
 
+       gfp |= __GFP_ACCOUNT|__GFP_RECLAIMABLE;
+
        b->data = kvmalloc(btree_buf_bytes(b), gfp);
        if (!b->data)
                return -BCH_ERR_ENOMEM_btree_node_mem_alloc;
index 2e49ca71194f2fc5fdff0c2a8b42e60928a8a3eb..244610b1d0b595501094a9c107c9fbb4d438e68c 100644 (file)
@@ -118,6 +118,8 @@ static void bkey_cached_free(struct btree_key_cache *bc,
 
 static struct bkey_cached *__bkey_cached_alloc(unsigned key_u64s, gfp_t gfp)
 {
+       gfp |= __GFP_ACCOUNT|__GFP_RECLAIMABLE;
+
        struct bkey_cached *ck = kmem_cache_zalloc(bch2_key_cache, gfp);
        if (unlikely(!ck))
                return NULL;