linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: Jaegeuk Kim <jaegeuk@kernel.org>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH v2] f2fs: relax migratepage for atomic written page
Date: Fri, 7 Jul 2017 07:57:29 +0800	[thread overview]
Message-ID: <4f92014b-5265-2c60-51a6-f80f34dd1418@kernel.org> (raw)
In-Reply-To: <20170706214926.GB395@jaegeuk-macbookpro.roam.corp.google.com>

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,
> 

      reply	other threads:[~2017-07-06 23:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-03 23:08 [PATCH] f2fs: avoid migratepage for atomic written page Jaegeuk Kim
2017-07-06 13:38 ` [f2fs-dev] " Chao Yu
2017-07-06 21:49 ` [PATCH v2] f2fs: relax " Jaegeuk Kim
2017-07-06 23:57   ` Chao Yu [this message]

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=4f92014b-5265-2c60-51a6-f80f34dd1418@kernel.org \
    --to=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.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).