lkml.org 
[lkml]   [2012]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[ 08/27] mm: soft offline: split thp at the beginning of soft_offline_page()
    Date
    3.6-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>

    commit 783657a7dc20e5c0efbc9a09a9dd38e238a723da upstream.

    When we try to soft-offline a thp tail page, put_page() is called on the
    tail page unthinkingly and VM_BUG_ON is triggered in put_compound_page().

    This patch splits thp before going into the main body of soft-offlining.

    Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
    Cc: Andi Kleen <andi@firstfloor.org>
    Cc: Tony Luck <tony.luck@intel.com>
    Cc: Andi Kleen <andi.kleen@intel.com>
    Cc: Wu Fengguang <fengguang.wu@intel.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    mm/memory-failure.c | 8 ++++++++
    1 file changed, 8 insertions(+)

    --- a/mm/memory-failure.c
    +++ b/mm/memory-failure.c
    @@ -1474,9 +1474,17 @@ int soft_offline_page(struct page *page,
    {
    int ret;
    unsigned long pfn = page_to_pfn(page);
    + struct page *hpage = compound_trans_head(page);

    if (PageHuge(page))
    return soft_offline_huge_page(page, flags);
    + if (PageTransHuge(hpage)) {
    + if (PageAnon(hpage) && unlikely(split_huge_page(hpage))) {
    + pr_info("soft offline: %#lx: failed to split THP\n",
    + pfn);
    + return -EBUSY;
    + }
    + }

    ret = get_any_page(page, pfn, flags);
    if (ret < 0)



    \
     
     \ /
      Last update: 2012-12-07 03:01    [W:4.401 / U:0.164 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site