All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/swap: Use page flags to determine LRU list in __activate_page()
@ 2017-10-19 14:56 ` Anshuman Khandual
  0 siblings, 0 replies; 14+ messages in thread
From: Anshuman Khandual @ 2017-10-19 14:56 UTC (permalink / raw)
  To: linux-mm, linux-kernel; +Cc: akpm, shli

Its already assumed that the PageActive flag is clear on the input
page, hence page_lru(page) will pick the base LRU for the page. In
the same way page_lru(page) will pick active base LRU, once the
flag PageActive is set on the page. This change of LRU list should
happen implicitly through the page flags instead of being hard
coded.

Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
---
 mm/swap.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/mm/swap.c b/mm/swap.c
index fcd82bc..494276b 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -275,12 +275,10 @@ static void __activate_page(struct page *page, struct lruvec *lruvec,
 {
 	if (PageLRU(page) && !PageActive(page) && !PageUnevictable(page)) {
 		int file = page_is_file_cache(page);
-		int lru = page_lru_base_type(page);
 
-		del_page_from_lru_list(page, lruvec, lru);
+		del_page_from_lru_list(page, lruvec, page_lru(page));
 		SetPageActive(page);
-		lru += LRU_ACTIVE;
-		add_page_to_lru_list(page, lruvec, lru);
+		add_page_to_lru_list(page, lruvec, page_lru(page));
 		trace_mm_lru_activate(page);
 
 		__count_vm_event(PGACTIVATE);
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-11-02 11:45 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-19 14:56 [PATCH] mm/swap: Use page flags to determine LRU list in __activate_page() Anshuman Khandual
2017-10-19 14:56 ` Anshuman Khandual
2017-10-19 15:33 ` Michal Hocko
2017-10-19 15:33   ` Michal Hocko
2017-10-23  3:22   ` Anshuman Khandual
2017-10-23  3:22     ` Anshuman Khandual
2017-10-27  4:06     ` Anshuman Khandual
2017-10-27  4:06       ` Anshuman Khandual
2017-10-27  7:57       ` Michal Hocko
2017-10-27  7:57         ` Michal Hocko
2017-10-31 12:45   ` Vlastimil Babka
2017-10-31 12:45     ` Vlastimil Babka
2017-11-02 11:44     ` Anshuman Khandual
2017-11-02 11:44       ` Anshuman Khandual

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.