From: Zi Yan <zi.yan@sent.com>
To: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Zi Yan <zi.yan@cs.rutgers.edu>
Subject: [RFC PATCH 0/4] mm: hwpoison: soft-offline support for thp migration
Date: Mon, 14 Aug 2017 21:52:12 -0400 [thread overview]
Message-ID: <20170815015216.31827-1-zi.yan@sent.com> (raw)
From: Zi Yan <zi.yan@cs.rutgers.edu>
Hi Naoya,
Here is soft-offline support for thp migration. I need comments since it has
an interface change (Patch 2) of soft_offline_page() and
a behavior change (Patch 3) in migrate_pages(). soft_offline_page() is used
in store_soft_offline_page() from drivers/base/memory.c.
The patchset is on top of mmotm-2017-08-10-15-33.
The patchset is tested with:
1. simple madvise() call program (https://github.com/x-y-z/soft-offline-test) and
2. a local kernel change to intentionally fail allocating THPs for soft offline,
which makes to-be-soft-offlined THPs being split by Patch 3.
Patch 1: obtain the size of a offlined page before it is offlined. The size is
used as the step value of the for-loop inside madvise_inject_error().
Originally, the for-loop used the size of offlined pages, which was OK.
But as a THP is offlined, it is split afterwards, so the page size obtained
after offlined is PAGE_SIZE instead of THP page size, which causes a THP being
offlined 512 times.
Patch 2: when offlining a THP, there are two situations, a) the THP is offlined
as a whole, or b) the THP is split and only the raw error page is offlined.
Thus, we need soft_offline_page() to tell us whether a THP is split during
offlining, which leads to a new interface parameter.
Patch 3: as Naoya suggested, if a THP fails to be offlined as a whole, we should
retry the raw error subpage. This patch implement it. This also requires
migrate_pages() not splitting a THP if migration fails for MR_MEMORY_FAILURE.
Patch 4: enable thp migration support for soft offline.
Any suggestions and comments are welcome.
Thanks.
Zi Yan (4):
mm: madvise: read loop's step size beforehand in
madvise_inject_error(), prepare for THP support.
mm: soft-offline: Change soft_offline_page() interface to tell if the
page is split or not.
mm: soft-offline: retry to split and soft-offline the raw error if the
original THP offlining fails.
mm: hwpoison: soft offline supports thp migration
drivers/base/memory.c | 2 +-
include/linux/mm.h | 2 +-
mm/madvise.c | 24 ++++++++++--
mm/memory-failure.c | 103 +++++++++++++++++++++++++++++---------------------
mm/migrate.c | 16 ++++++++
5 files changed, 97 insertions(+), 50 deletions(-)
--
2.13.2
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next reply other threads:[~2017-08-15 1:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-15 1:52 Zi Yan [this message]
2017-08-15 1:52 ` [RFC PATCH 1/4] mm: madvise: read loop's step size beforehand in madvise_inject_error(), prepare for THP support Zi Yan
2017-08-23 7:49 ` Naoya Horiguchi
2017-08-23 14:20 ` Zi Yan
2017-08-24 4:26 ` Naoya Horiguchi
2017-08-24 14:26 ` Zi Yan
2017-08-15 1:52 ` [RFC PATCH 2/4] mm: soft-offline: Change soft_offline_page() interface to tell if the page is split or not Zi Yan
2017-08-15 1:52 ` [RFC PATCH 3/4] mm: soft-offline: retry to split and soft-offline the raw error if the original THP offlining fails Zi Yan
2017-08-24 7:31 ` Naoya Horiguchi
2017-08-15 1:52 ` [RFC PATCH 4/4] mm: hwpoison: soft offline supports thp migration Zi Yan
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=20170815015216.31827-1-zi.yan@sent.com \
--to=zi.yan@sent.com \
--cc=gregkh@linuxfoundation.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=n-horiguchi@ah.jp.nec.com \
--cc=zi.yan@cs.rutgers.edu \
/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