Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1380993pxk; Thu, 10 Sep 2020 13:58:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKlsAMUOE9K4nYz1oTIL9D1gC9RHfTALY+SXqfEoP6PpGHYigNUOid3EPr+NgozFB1CS91 X-Received: by 2002:aa7:df14:: with SMTP id c20mr11577769edy.334.1599771519328; Thu, 10 Sep 2020 13:58:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599771519; cv=none; d=google.com; s=arc-20160816; b=ciuh+yhhy+MU1Hd85hn98REhIXOuky7sv8SL4Df0x/lc2cWmDWEy0VTJ5sXgeP1hz7 cIw+4B99N/4DCW+odYR9lKiC9dLNelpTsDTRv9z8l7CxwUeWxqH+1xoglj5b2Q9/X6ki fupllPTKWkB7N+Iqn6JlkNsrTpab+0r3mOITlKaC2QVAu8jXYWk1R0U7txr/meF/oesI gvlTVvGyEeRJWdMy1bYWVmlV0OyuOP5URITms/yWQ2zd+i3I4FWsgGexUxcZCthLwG1m RPijnX0GUUzPqkypngIq/1b1QadRJqbvnVJP6QX+yC0mvKgxUsdz0/s7GsFLc7WpFft7 Hu5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=x3mXocVSE1Ebx6CKr4ScPVOkg1E0gmJHqtGLnjlzrp0=; b=h1ArN6YOjq4e6PP1T1aBIj8aRJEVscA/vcVtJTiN4Aa/ExA/rVSM9pdvgCovli7NBt +VVBaRe2OBzwlaEvV8vbCAziERElasIZYUi4Tf3KPsITLOTrv/IM4KnmoL8YA/4CCisZ YETG4AHW0R40W5HUnFL3mq8AN7e+pezlhCiNVXu0yCygt+lXqh8O4Iklr6+1wmuJKTxU Lcejx7krc3oZwYFjR80d1ljU2jua10lww0ZlEteKViG76Irsh/yvFmnE2WgUIsGxX7GR 0YqPlbRIcAIwV6z4ncx4yECTa0XzrqKSvz0yEhETBd1whqevr1NB84bAchDalX19VJGY C64A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=JyR2faOd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u14si4254210ejt.556.2020.09.10.13.58.16; Thu, 10 Sep 2020 13:58:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=JyR2faOd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727081AbgIJU5Z (ORCPT + 99 others); Thu, 10 Sep 2020 16:57:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731155AbgIJOtO (ORCPT ); Thu, 10 Sep 2020 10:49:14 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA81DC061756; Thu, 10 Sep 2020 07:48:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=x3mXocVSE1Ebx6CKr4ScPVOkg1E0gmJHqtGLnjlzrp0=; b=JyR2faOdOafTeMYH/eo+WcbIBC 7g+pcV8tPXxPXK5fTzyK0UvjDb9hX+ZsGlihd6PNSeAEcrd6/F0PKw+J/MZyRNqC3swShhX5Hcs6p IJgJ6wjjuOo6uHHos0BtN0Gb4MGKL6AeyuMpgv5cHWB/qykJwCGcnqI5LogBbnPB/bYCkSF5A0u/o o/rsXAHmOpVdy4BP3SIQCeEOoJ/v7txgXEsYdeZr3Kz6nSWE2YxQ8T4SwIhLyY1/BpTKVFESoCjM1 sl1PjMR+PX6pHDiUCcs0TGqQ9Q2rYCUp21Shuqfv5MJ7nYG6PS28uXxFE+LgCIrljCmxgqsvJHQ4q EWUWT1jg==; Received: from [2001:4bb8:184:af1:3ecc:ac5b:136f:434a] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGNsT-0006wo-G5; Thu, 10 Sep 2020 14:48:45 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Song Liu , Hans de Goede , Richard Weinberger , Minchan Kim , linux-mtd@lists.infradead.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, linux-raid@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org, Johannes Thumshirn Subject: [PATCH 07/12] bdi: remove BDI_CAP_CGROUP_WRITEBACK Date: Thu, 10 Sep 2020 16:48:27 +0200 Message-Id: <20200910144833.742260-8-hch@lst.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910144833.742260-1-hch@lst.de> References: <20200910144833.742260-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Just checking SB_I_CGROUPWB for cgroup writeback support is enough. Either the file system allocates its own bdi (e.g. btrfs), in which case it is known to support cgroup writeback, or the bdi comes from the block layer, which always supports cgroup writeback. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- block/blk-core.c | 1 - fs/btrfs/disk-io.c | 1 - include/linux/backing-dev.h | 8 +++----- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 18c092f8d69175..d81ee511ec8b01 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -538,7 +538,6 @@ struct request_queue *blk_alloc_queue(int node_id) if (!q->stats) goto fail_stats; - q->backing_dev_info->capabilities = BDI_CAP_CGROUP_WRITEBACK; q->node = node_id; atomic_set(&q->nr_active_requests_shared_sbitmap, 0); diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 047934cea25efa..e24927bddd5829 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -3091,7 +3091,6 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device goto fail_sb_buffer; } - sb->s_bdi->capabilities |= BDI_CAP_CGROUP_WRITEBACK; sb->s_bdi->ra_pages *= btrfs_super_num_devices(disk_super); sb->s_bdi->ra_pages = max(sb->s_bdi->ra_pages, SZ_4M / PAGE_SIZE); diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index 0b06b2d26c9aa3..52583b6f2ea05d 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h @@ -123,7 +123,6 @@ int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio); * BDI_CAP_NO_ACCT_WB: Don't automatically account writeback pages * BDI_CAP_STRICTLIMIT: Keep number of dirty pages below bdi threshold. * - * BDI_CAP_CGROUP_WRITEBACK: Supports cgroup-aware writeback. * BDI_CAP_SYNCHRONOUS_IO: Device is so fast that asynchronous IO would be * inefficient. */ @@ -233,9 +232,9 @@ int inode_congested(struct inode *inode, int cong_bits); * inode_cgwb_enabled - test whether cgroup writeback is enabled on an inode * @inode: inode of interest * - * cgroup writeback requires support from both the bdi and filesystem. - * Also, both memcg and iocg have to be on the default hierarchy. Test - * whether all conditions are met. + * Cgroup writeback requires support from the filesystem. Also, both memcg and + * iocg have to be on the default hierarchy. Test whether all conditions are + * met. * * Note that the test result may change dynamically on the same inode * depending on how memcg and iocg are configured. @@ -247,7 +246,6 @@ static inline bool inode_cgwb_enabled(struct inode *inode) return cgroup_subsys_on_dfl(memory_cgrp_subsys) && cgroup_subsys_on_dfl(io_cgrp_subsys) && bdi_cap_account_dirty(bdi) && - (bdi->capabilities & BDI_CAP_CGROUP_WRITEBACK) && (inode->i_sb->s_iflags & SB_I_CGROUPWB); } -- 2.28.0