From: Hui Zhu <teawater@gmail.com>
To: konrad.wilk@oracle.com, sjenning@redhat.com, ddstreet@ieee.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Cc: Hui Zhu <teawater@gmail.com>, Hui Zhu <teawaterz@linux.alibaba.com>
Subject: [PATCH 1/2] mm, frontswap: Fix frontswap_map issue with THP
Date: Tue, 15 Oct 2019 11:49:08 +0800 [thread overview]
Message-ID: <1571111349-5041-1-git-send-email-teawater@gmail.com> (raw)
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
next reply other threads:[~2019-10-15 3:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-15 3:49 Hui Zhu [this message]
2019-10-15 3:49 ` [PATCH 2/2] mm, zswap: Support THP Hui Zhu
2019-11-08 16:15 ` Dan Streetman
2019-11-11 1:48 ` Hui Zhu
2020-01-26 19:35 ` Dan Streetman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1571111349-5041-1-git-send-email-teawater@gmail.com \
--to=teawater@gmail.com \
--cc=ddstreet@ieee.org \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sjenning@redhat.com \
--cc=teawaterz@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).