[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201112212641.27837-4-willy@infradead.org>
Date: Thu, 12 Nov 2020 21:26:28 +0000
From: "Matthew Wilcox (Oracle)" <willy@...radead.org>
To: linux-fsdevel@...r.kernel.org, linux-mm@...ck.org
Cc: "Matthew Wilcox (Oracle)" <willy@...radead.org>,
akpm@...ux-foundation.org, hughd@...gle.com, hch@....de,
hannes@...xchg.org, yang.shi@...ux.alibaba.com,
dchinner@...hat.com, linux-kernel@...r.kernel.org
Subject: [PATCH v4 03/16] mm/swap: Optimise get_shadow_from_swap_cache
There's no need to get a reference to the page, just load the entry and
see if it's a shadow entry.
Signed-off-by: Matthew Wilcox (Oracle) <willy@...radead.org>
---
mm/swap_state.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/mm/swap_state.c b/mm/swap_state.c
index cf7b322a9abc..d2161154d873 100644
--- a/mm/swap_state.c
+++ b/mm/swap_state.c
@@ -113,11 +113,9 @@ void *get_shadow_from_swap_cache(swp_entry_t entry)
pgoff_t idx = swp_offset(entry);
struct page *page;
- page = find_get_entry(address_space, idx);
+ page = xa_load(&address_space->i_pages, idx);
if (xa_is_value(page))
return page;
- if (page)
- put_page(page);
return NULL;
}
--
2.28.0
Powered by blists - more mailing lists