[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180316133417.hk2lvnvgildsc65n@node.shutemov.name>
Date: Fri, 16 Mar 2018 16:34:17 +0300
From: "Kirill A. Shutemov" <kirill@...temov.name>
To: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
Cc: mhocko@...nel.org, kirill.shutemov@...ux.intel.com,
akpm@...ux-foundation.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, stable@...r.kernel.org,
linux-mm@...ts.ewheeler.net
Subject: Re: [PATCH] mm/shmem: Do not wait for lock_page() in
shmem_unused_huge_shrink()
On Fri, Mar 16, 2018 at 10:14:24PM +0900, Tetsuo Handa wrote:
> f2fs is doing
>
> page = f2fs_pagecache_get_page(inode->i_mapping, 0, FGP_LOCK|FGP_NOWAIT, 0);
>
> which calls
>
> struct page *pagecache_get_page(inode->i_mapping, 0, FGP_LOCK|FGP_NOWAIT, 0);
>
> . Then, can't we define
>
> static inline struct page *find_trylock_page(struct address_space *mapping,
> pgoff_t offset)
> {
> return pagecache_get_page(mapping, offset, FGP_LOCK|FGP_NOWAIT, 0);
> }
>
> and replace find_lock_page() with find_trylock_page() ?
This won't work in this case. We need to destinct no-page-in-page-cache
from failed-to-lock-page. We take different routes depending on this.
--
Kirill A. Shutemov
Powered by blists - more mailing lists