* [PATCH] mm/swap: simplify the code of find_get_incore_page()
@ 2022-03-16 7:59 Miaohe Lin
2022-03-16 12:25 ` Matthew Wilcox
0 siblings, 1 reply; 3+ messages in thread
From: Miaohe Lin @ 2022-03-16 7:59 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, linux-kernel, linmiaohe
pagecache_get_page() can return subpage for us if we do not specify
FGP_HEAD. No functional change intended.
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
mm/swap_state.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/mm/swap_state.c b/mm/swap_state.c
index ee67164531c0..517b4b856e32 100644
--- a/mm/swap_state.c
+++ b/mm/swap_state.c
@@ -394,13 +394,10 @@ struct page *find_get_incore_page(struct address_space *mapping, pgoff_t index)
{
swp_entry_t swp;
struct swap_info_struct *si;
- struct page *page = pagecache_get_page(mapping, index,
- FGP_ENTRY | FGP_HEAD, 0);
+ struct page *page = pagecache_get_page(mapping, index, FGP_ENTRY, 0);
- if (!page)
+ if (!page || !xa_is_value(page))
return page;
- if (!xa_is_value(page))
- return find_subpage(page, index);
if (!shmem_mapping(mapping))
return NULL;
--
2.23.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mm/swap: simplify the code of find_get_incore_page()
2022-03-16 7:59 [PATCH] mm/swap: simplify the code of find_get_incore_page() Miaohe Lin
@ 2022-03-16 12:25 ` Matthew Wilcox
2022-03-17 1:43 ` Miaohe Lin
0 siblings, 1 reply; 3+ messages in thread
From: Matthew Wilcox @ 2022-03-16 12:25 UTC (permalink / raw)
To: Miaohe Lin; +Cc: akpm, linux-mm, linux-kernel
On Wed, Mar 16, 2022 at 03:59:41PM +0800, Miaohe Lin wrote:
> pagecache_get_page() can return subpage for us if we do not specify
> FGP_HEAD. No functional change intended.
No, I'm converting this to folios soon.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm/swap: simplify the code of find_get_incore_page()
2022-03-16 12:25 ` Matthew Wilcox
@ 2022-03-17 1:43 ` Miaohe Lin
0 siblings, 0 replies; 3+ messages in thread
From: Miaohe Lin @ 2022-03-17 1:43 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: akpm, linux-mm, linux-kernel
On 2022/3/16 20:25, Matthew Wilcox wrote:
> On Wed, Mar 16, 2022 at 03:59:41PM +0800, Miaohe Lin wrote:
>> pagecache_get_page() can return subpage for us if we do not specify
>> FGP_HEAD. No functional change intended.
>
> No, I'm converting this to folios soon.
This patch is based on linux-next-20220315 where pagecache_get_page is already
converted to folios. What you mean is find_get_incore_page will convert to folis
too soon? I'll continue to delay this patch anyway.
Thanks.
>
> .
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-03-17 1:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-16 7:59 [PATCH] mm/swap: simplify the code of find_get_incore_page() Miaohe Lin
2022-03-16 12:25 ` Matthew Wilcox
2022-03-17 1:43 ` Miaohe Lin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.