lkml.org 
[lkml]   [2019]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] mm, frontswap: Fix frontswap_map issue with THP
Date
Shrink will try to use frontswap interface store the THP as a normal
page in __frontswap_store:
if (ret == 0) {
__frontswap_set(sis, offset);
inc_frontswap_succ_stores();
} else {
It should set all bits with THP.

This commit set all bits with THP.

Signed-off-by: Hui Zhu <teawaterz@linux.alibaba.com>
---
mm/frontswap.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/mm/frontswap.c b/mm/frontswap.c
index 60bb20e..f07ea63 100644
--- a/mm/frontswap.c
+++ b/mm/frontswap.c
@@ -274,8 +274,12 @@ int __frontswap_store(struct page *page)
break;
}
if (ret == 0) {
- __frontswap_set(sis, offset);
- inc_frontswap_succ_stores();
+ int i, nr = hpage_nr_pages(page);
+
+ for (i = 0; i < nr; i++) {
+ __frontswap_set(sis, offset + i);
+ inc_frontswap_succ_stores();
+ }
} else {
inc_frontswap_failed_stores();
}
--
2.7.4
\
 
 \ /
  Last update: 2019-10-15 05:50    [W:0.072 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site