lkml.org 
[lkml]   [2018]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2018-03-16 14:35    [W:0.056 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site