Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp271607pxk; Thu, 17 Sep 2020 02:38:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJQX1yTFdPlB6+8Nor7eP3sVXEu9eY3c3tF8n9pq+wgdk/TZQFATDDir4tkAyJhS3+GGZB X-Received: by 2002:a50:fc91:: with SMTP id f17mr33246458edq.319.1600335505405; Thu, 17 Sep 2020 02:38:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600335505; cv=none; d=google.com; s=arc-20160816; b=N/p3yJ8uNqzeDeUGxG92mpvHhoBCUxDQddHNEB8ABo3w5+wuNtlX2b/88JkM1KBS5d RQMJoi0ACVkQyY0fXfe6LF/dQ/ZDrrltP+TeXC063h16/IIsE0AV2EofD2admzF30C/S LNOsPKcjJi6+Nu1xOZuVc9sFPZKaK0EPIwQnsWinRSPZdAaATqzVdghatoxm9jYqjpkn 3qzVFrk6PlhR9ZxR2k0oWEJe1Mlk28g/XeQgVjNZFWTWIZfyIViV4eb9v7TyTtoHWZ+O vYLlQBl+wleteHe4dEn1xyawlFTv3wTdPPgOdpEwvgJJ7IO+XTufqXb9HrvQnld9ykrG ANww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=58o+hLmC9gsyAjWI709Bk6iJauSd21arf4E4LYS4iI8=; b=hvmOC7aLv4BPqYiBNR+BeJBKIkl2+ZmjkpP+Eu23Lwb1pcvXHQ/WFzpnfM+TByp2m8 Uhj14UZzDcYKcVEhkK/hMBEAeDc0TKm/SgJ8wdl4DnwXLyxQRJxSkgYkhCNOR7w5qcwi sSJWdV93N5dW8zmClp9RTYGxJ/mgzOgzpGbxG5J7JsgAC7zeSNc9VyE5h4zgdUzIvzvz uizmKqLvQ8qWudWjbcn0F8jxQN9mUB6hU+7DhfwoXe5zCd3Qny3Lv7T53Rwq/bmy6ZhE Usqt7pY3kLmIfkoDeA3fhUbnUL6+cOF2944o5MOgQ6ZASeM++bWlx/ZgZ/w5eTCKklCS PKyg== ARC-Authentication-Results: i=1; mx.google.com; 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 f9si13098291ejq.641.2020.09.17.02.38.01; Thu, 17 Sep 2020 02:38:25 -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; 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 S1726509AbgIQJhC (ORCPT + 99 others); Thu, 17 Sep 2020 05:37:02 -0400 Received: from mx2.suse.de ([195.135.220.15]:47054 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726359AbgIQJhA (ORCPT ); Thu, 17 Sep 2020 05:37:00 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 87C08AC61; Thu, 17 Sep 2020 09:37:29 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 554E71E12E1; Thu, 17 Sep 2020 11:36:55 +0200 (CEST) Date: Thu, 17 Sep 2020 11:36:55 +0200 From: Jan Kara To: Christoph Hellwig Cc: Jens Axboe , 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: Re: [PATCH 07/12] bdi: remove BDI_CAP_CGROUP_WRITEBACK Message-ID: <20200917093655.GG7347@quack2.suse.cz> References: <20200910144833.742260-1-hch@lst.de> <20200910144833.742260-8-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200910144833.742260-8-hch@lst.de> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 10-09-20 16:48:27, Christoph Hellwig wrote: > 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 Makes sense. You can add: Reviewed-by: Jan Kara Honza > --- > 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 > -- Jan Kara SUSE Labs, CR