writeback: remove redundant checks for root memcg
authorJinliang Zheng <alexjlzheng@tencent.com>
Tue, 8 Aug 2023 08:44:32 +0000 (16:44 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 21 Aug 2023 20:37:48 +0000 (13:37 -0700)
The check for root memcg will be done in wb_get_lookup(), so remove the
redundant one to simplify the code.

Link: https://lkml.kernel.org/r/20230808084431.1632934-1-alexjlzheng@tencent.com
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/backing-dev.c

index fc44bfb..1e3447b 100644 (file)
@@ -732,9 +732,6 @@ struct bdi_writeback *wb_get_create(struct backing_dev_info *bdi,
 
        might_alloc(gfp);
 
-       if (!memcg_css->parent)
-               return &bdi->wb;
-
        do {
                wb = wb_get_lookup(bdi, memcg_css);
        } while (!wb && !cgwb_create(bdi, memcg_css, gfp));