Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1682817

Re: [f2fs-dev] [PATCH v2] f2fs: relax migratepage for atomic written page

From Chao Yu <chao@kernel.org>
Newsgroups linux.kernel
Subject Re: [f2fs-dev] [PATCH v2] f2fs: relax migratepage for atomic written page
Date 2017-07-07 02:00 +0200
Message-ID <u0oQF-43b-3@gated-at.bofh.it> (permalink)
References <tZiDE-8gJ-7@gated-at.bofh.it> <u0mOT-2P4-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2017/7/7 5:49, Jaegeuk Kim wrote:
> In order to avoid lock contention for atomic written pages, we'd better give
> EBUSY in f2fs_migrate_page when mode is asynchronous. We expect it will be
> released soon as transaction commits.
> 
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

Reviewed-by: Chao Yu <yuchao0@huawei.com>

> ---
> 
> Change log from v1:
>  - return -EBUSY when mode is MIGRATE_ASYNC or MIGRATE_SYNC_LIGHT
> 
>  fs/f2fs/data.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 85ac3a63cce6..74c31cb203e2 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -2206,8 +2206,12 @@ int f2fs_migrate_page(struct address_space *mapping,
>  	BUG_ON(PageWriteback(page));
>  
>  	/* migrating an atomic written page is safe with the inmem_lock hold */
> -	if (atomic_written && !mutex_trylock(&fi->inmem_lock))
> -		return -EAGAIN;
> +	if (atomic_written) {
> +		if (mode != MIGRATE_SYNC)
> +			return -EBUSY;
> +		if (!mutex_trylock(&fi->inmem_lock))
> +			return -EAGAIN;
> +	}
>  
>  	/*
>  	 * A reference is expected if PagePrivate set when move mapping,
> 

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] f2fs: avoid migratepage for atomic written page Jaegeuk Kim <jaegeuk@kernel.org> - 2017-07-04 01:10 +0200
  Re: [f2fs-dev] [PATCH] f2fs: avoid migratepage for atomic written  page Chao Yu <chao@kernel.org> - 2017-07-06 15:40 +0200
  Re: [PATCH v2] f2fs: relax migratepage for atomic written page Jaegeuk Kim <jaegeuk@kernel.org> - 2017-07-06 23:50 +0200
    Re: [f2fs-dev] [PATCH v2] f2fs: relax migratepage for atomic written  page Chao Yu <chao@kernel.org> - 2017-07-07 02:00 +0200

csiph-web