f2fs: relax migratepage for atomic written page
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. Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
000519f278
commit
ff1048e7df
|
@ -2203,8 +2203,12 @@ int f2fs_migrate_page(struct address_space *mapping,
|
||||||
BUG_ON(PageWriteback(page));
|
BUG_ON(PageWriteback(page));
|
||||||
|
|
||||||
/* migrating an atomic written page is safe with the inmem_lock hold */
|
/* migrating an atomic written page is safe with the inmem_lock hold */
|
||||||
if (atomic_written && !mutex_trylock(&fi->inmem_lock))
|
if (atomic_written) {
|
||||||
return -EAGAIN;
|
if (mode != MIGRATE_SYNC)
|
||||||
|
return -EBUSY;
|
||||||
|
if (!mutex_trylock(&fi->inmem_lock))
|
||||||
|
return -EAGAIN;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A reference is expected if PagePrivate set when move mapping,
|
* A reference is expected if PagePrivate set when move mapping,
|
||||||
|
|
Loading…
Reference in New Issue