linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@kernel.dk>, Song Liu <song@kernel.org>,
	Hans de Goede <hdegoede@redhat.com>, Coly Li <colyli@suse.de>,
	Richard Weinberger <richard@nod.at>,
	Minchan Kim <minchan@kernel.org>,
	Johannes Thumshirn <Johannes.Thumshirn@wdc.com>,
	Justin Sanders <justin@coraid.com>,
	linux-mtd@lists.infradead.org, dm-devel@redhat.com,
	linux-block@vger.kernel.org, linux-bcache@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,
	David Sterba <dsterba@suse.com>
Subject: Re: [PATCH 05/13] bdi: initialize ->ra_pages and ->io_pages in bdi_init
Date: Tue, 22 Sep 2020 10:49:54 +0200	[thread overview]
Message-ID: <20200922084954.GC16464@quack2.suse.cz> (raw)
In-Reply-To: <20200921080734.452759-6-hch@lst.de>

On Mon 21-09-20 10:07:26, Christoph Hellwig wrote:
> Set up a readahead size by default, as very few users have a good
> reason to change it.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Acked-by: David Sterba <dsterba@suse.com> [btrfs]
> Acked-by: Richard Weinberger <richard@nod.at> [ubifs, mtd]

The patch looks good to me. You can add:

Reviewed-by: Jan Kara <jack@suse.cz>

I'd just prefer if the changelog explicitely mentioned that this patch
results in enabling readahead for coda, ecryptfs, and orangefs... Just in
case someone bisects some issue down to this patch :).

								Honza

> ---
>  block/blk-core.c      | 2 --
>  drivers/mtd/mtdcore.c | 2 ++
>  fs/9p/vfs_super.c     | 6 ++++--
>  fs/afs/super.c        | 1 -
>  fs/btrfs/disk-io.c    | 1 -
>  fs/fuse/inode.c       | 1 -
>  fs/nfs/super.c        | 9 +--------
>  fs/ubifs/super.c      | 2 ++
>  fs/vboxsf/super.c     | 2 ++
>  mm/backing-dev.c      | 2 ++
>  10 files changed, 13 insertions(+), 15 deletions(-)
> 
> diff --git a/block/blk-core.c b/block/blk-core.c
> index ca3f0f00c9435f..865d39e5be2b28 100644
> --- a/block/blk-core.c
> +++ b/block/blk-core.c
> @@ -538,8 +538,6 @@ struct request_queue *blk_alloc_queue(int node_id)
>  	if (!q->stats)
>  		goto fail_stats;
>  
> -	q->backing_dev_info->ra_pages = VM_READAHEAD_PAGES;
> -	q->backing_dev_info->io_pages = VM_READAHEAD_PAGES;
>  	q->backing_dev_info->capabilities = BDI_CAP_CGROUP_WRITEBACK;
>  	q->node = node_id;
>  
> diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
> index 7d930569a7dfb7..b5e5d3140f578e 100644
> --- a/drivers/mtd/mtdcore.c
> +++ b/drivers/mtd/mtdcore.c
> @@ -2196,6 +2196,8 @@ static struct backing_dev_info * __init mtd_bdi_init(char *name)
>  	bdi = bdi_alloc(NUMA_NO_NODE);
>  	if (!bdi)
>  		return ERR_PTR(-ENOMEM);
> +	bdi->ra_pages = 0;
> +	bdi->io_pages = 0;
>  
>  	/*
>  	 * We put '-0' suffix to the name to get the same name format as we
> diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
> index 74df32be4c6a52..e34fa20acf612e 100644
> --- a/fs/9p/vfs_super.c
> +++ b/fs/9p/vfs_super.c
> @@ -80,8 +80,10 @@ v9fs_fill_super(struct super_block *sb, struct v9fs_session_info *v9ses,
>  	if (ret)
>  		return ret;
>  
> -	if (v9ses->cache)
> -		sb->s_bdi->ra_pages = VM_READAHEAD_PAGES;
> +	if (!v9ses->cache) {
> +		sb->s_bdi->ra_pages = 0;
> +		sb->s_bdi->io_pages = 0;
> +	}
>  
>  	sb->s_flags |= SB_ACTIVE | SB_DIRSYNC;
>  	if (!v9ses->cache)
> diff --git a/fs/afs/super.c b/fs/afs/super.c
> index b552357b1d1379..3a40ee752c1e3f 100644
> --- a/fs/afs/super.c
> +++ b/fs/afs/super.c
> @@ -456,7 +456,6 @@ static int afs_fill_super(struct super_block *sb, struct afs_fs_context *ctx)
>  	ret = super_setup_bdi(sb);
>  	if (ret)
>  		return ret;
> -	sb->s_bdi->ra_pages	= VM_READAHEAD_PAGES;
>  
>  	/* allocate the root inode and dentry */
>  	if (as->dyn_root) {
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index f6bba7eb1fa171..047934cea25efa 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -3092,7 +3092,6 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device
>  	}
>  
>  	sb->s_bdi->capabilities |= BDI_CAP_CGROUP_WRITEBACK;
> -	sb->s_bdi->ra_pages = VM_READAHEAD_PAGES;
>  	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/fs/fuse/inode.c b/fs/fuse/inode.c
> index bba747520e9b08..17b00670fb539e 100644
> --- a/fs/fuse/inode.c
> +++ b/fs/fuse/inode.c
> @@ -1049,7 +1049,6 @@ static int fuse_bdi_init(struct fuse_conn *fc, struct super_block *sb)
>  	if (err)
>  		return err;
>  
> -	sb->s_bdi->ra_pages = VM_READAHEAD_PAGES;
>  	/* fuse does it's own writeback accounting */
>  	sb->s_bdi->capabilities = BDI_CAP_NO_ACCT_WB | BDI_CAP_STRICTLIMIT;
>  
> diff --git a/fs/nfs/super.c b/fs/nfs/super.c
> index 7a70287f21a2c1..f943e37853fa25 100644
> --- a/fs/nfs/super.c
> +++ b/fs/nfs/super.c
> @@ -1200,13 +1200,6 @@ static void nfs_get_cache_cookie(struct super_block *sb,
>  }
>  #endif
>  
> -static void nfs_set_readahead(struct backing_dev_info *bdi,
> -			      unsigned long iomax_pages)
> -{
> -	bdi->ra_pages = VM_READAHEAD_PAGES;
> -	bdi->io_pages = iomax_pages;
> -}
> -
>  int nfs_get_tree_common(struct fs_context *fc)
>  {
>  	struct nfs_fs_context *ctx = nfs_fc2context(fc);
> @@ -1251,7 +1244,7 @@ int nfs_get_tree_common(struct fs_context *fc)
>  					     MINOR(server->s_dev));
>  		if (error)
>  			goto error_splat_super;
> -		nfs_set_readahead(s->s_bdi, server->rpages);
> +		s->s_bdi->io_pages = server->rpages;
>  		server->super = s;
>  	}
>  
> diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
> index a2420c900275a8..fbddb2a1c03f5e 100644
> --- a/fs/ubifs/super.c
> +++ b/fs/ubifs/super.c
> @@ -2177,6 +2177,8 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent)
>  				   c->vi.vol_id);
>  	if (err)
>  		goto out_close;
> +	sb->s_bdi->ra_pages = 0;
> +	sb->s_bdi->io_pages = 0;
>  
>  	sb->s_fs_info = c;
>  	sb->s_magic = UBIFS_SUPER_MAGIC;
> diff --git a/fs/vboxsf/super.c b/fs/vboxsf/super.c
> index 8fe03b4a0d2b03..8e3792177a8523 100644
> --- a/fs/vboxsf/super.c
> +++ b/fs/vboxsf/super.c
> @@ -167,6 +167,8 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc)
>  	err = super_setup_bdi_name(sb, "vboxsf-%d", sbi->bdi_id);
>  	if (err)
>  		goto fail_free;
> +	sb->s_bdi->ra_pages = 0;
> +	sb->s_bdi->io_pages = 0;
>  
>  	/* Turn source into a shfl_string and map the folder */
>  	size = strlen(fc->source) + 1;
> diff --git a/mm/backing-dev.c b/mm/backing-dev.c
> index 8e8b00627bb2d8..2dac3be6127127 100644
> --- a/mm/backing-dev.c
> +++ b/mm/backing-dev.c
> @@ -746,6 +746,8 @@ struct backing_dev_info *bdi_alloc(int node_id)
>  		kfree(bdi);
>  		return NULL;
>  	}
> +	bdi->ra_pages = VM_READAHEAD_PAGES;
> +	bdi->io_pages = VM_READAHEAD_PAGES;
>  	return bdi;
>  }
>  EXPORT_SYMBOL(bdi_alloc);
> -- 
> 2.28.0
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2020-09-22  8:50 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-21  8:07 bdi cleanups v6 Christoph Hellwig
2020-09-21  8:07 ` [PATCH 01/13] fs: remove the unused SB_I_MULTIROOT flag Christoph Hellwig
2020-09-21  8:07 ` [PATCH 02/13] drbd: remove dead code in device_to_statistics Christoph Hellwig
2020-09-21  8:07 ` [PATCH 03/13] bcache: inherit the optimal I/O size Christoph Hellwig
2020-09-21  9:54   ` Coly Li
2020-09-21 14:00     ` Christoph Hellwig
2020-09-21 15:09       ` Coly Li
2020-09-21 18:18         ` Christoph Hellwig
2020-09-22  8:44   ` Jan Kara
2020-09-22  9:39   ` Coly Li
2020-09-21  8:07 ` [PATCH 04/13] aoe: set an " Christoph Hellwig
2020-09-22  8:45   ` Jan Kara
2020-09-21  8:07 ` [PATCH 05/13] bdi: initialize ->ra_pages and ->io_pages in bdi_init Christoph Hellwig
2020-09-22  8:49   ` Jan Kara [this message]
2020-09-23 15:16     ` Christoph Hellwig
2020-09-21  8:07 ` [PATCH 06/13] md: update the optimal I/O size on reshape Christoph Hellwig
2020-09-21  8:07 ` [PATCH 07/13] block: lift setting the readahead size into the block layer Christoph Hellwig
2020-09-22  9:13   ` Jan Kara
2020-09-22  9:51   ` Coly Li
2020-09-21  8:07 ` [PATCH 08/13] bdi: remove BDI_CAP_CGROUP_WRITEBACK Christoph Hellwig
2020-09-21  8:07 ` [PATCH 09/13] bdi: remove BDI_CAP_SYNCHRONOUS_IO Christoph Hellwig
2020-09-21  8:07 ` [PATCH 10/13] mm: use SWP_SYNCHRONOUS_IO more intelligently Christoph Hellwig
2020-09-21  8:07 ` [PATCH 11/13] bdi: replace BDI_CAP_STABLE_WRITES with a queue and a sb flag Christoph Hellwig
2020-09-21  8:07 ` [PATCH 12/13] bdi: invert BDI_CAP_NO_ACCT_WB Christoph Hellwig
2020-09-21  8:07 ` [PATCH 13/13] bdi: replace BDI_CAP_NO_{WRITEBACK,ACCT_DIRTY} with a single flag Christoph Hellwig
2020-09-24  6:51 bdi cleanups v7 Christoph Hellwig
2020-09-24  6:51 ` [PATCH 05/13] bdi: initialize ->ra_pages and ->io_pages in bdi_init Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200922084954.GC16464@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=cgroups@vger.kernel.org \
    --cc=colyli@suse.de \
    --cc=dm-devel@redhat.com \
    --cc=drbd-dev@lists.linbit.com \
    --cc=dsterba@suse.com \
    --cc=hch@lst.de \
    --cc=hdegoede@redhat.com \
    --cc=justin@coraid.com \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=minchan@kernel.org \
    --cc=richard@nod.at \
    --cc=song@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).