Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1263907

Re: [PATCH v2] mm: hwpoison: adjust for new thp refcounting

From "Kirill A. Shutemov" <kirill@shutemov.name>
Newsgroups linux.kernel
Subject Re: [PATCH v2] mm: hwpoison: adjust for new thp refcounting
Date 2015-11-06 11:40 +0100
Message-ID <qrMB4-3if-19@gated-at.bofh.it> (permalink)
References <qrJ0u-Z9-21@gated-at.bofh.it> <qrKfU-1Vl-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Nov 06, 2015 at 05:03:12PM +0900, Naoya Horiguchi wrote:
> Some mm-related BUG_ON()s could trigger from hwpoison code due to recent
> changes in thp refcounting rule. This patch fixes them up.
> 
> In the new refcounting, we no longer use tail->_mapcount to keep tail's
> refcount, and thereby we can simplify get/put_hwpoison_page().
> 
> And another change is that tail's refcount is not transferred to the raw
> page during thp split (more precisely, in new rule we don't take refcount
> on tail page any more.) So when we need thp split, we have to transfer the
> refcount properly to the 4kB soft-offlined page before migration.
> 
> thp split code goes into core code only when precheck (total_mapcount(head)
> == page_count(head) - 1) passes to avoid useless split, where we assume that
> one refcount is held by the caller of thp split and the others are taken
> via mapping. To meet this assumption, this patch moves thp split part in
> soft_offline_page() after get_any_page().
> 
> Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> ---
> ChangeLog v1->v2:
> - leave put_hwpoison_page() as a macro
> 
> - based on mmotm-2015-10-21-14-41 + Kirill's "[PATCH 0/4] Bugfixes for THP
>   refcounting" series.
> ---
>  include/linux/mm.h  |    1 +
>  mm/memory-failure.c |   75 +++++++++++++++------------------------------------
>  2 files changed, 23 insertions(+), 53 deletions(-)
> 
> diff --git mmotm-2015-10-21-14-41/include/linux/mm.h mmotm-2015-10-21-14-41_patched/include/linux/mm.h
> index a36f9fa..51e3ffe 100644
> --- mmotm-2015-10-21-14-41/include/linux/mm.h
> +++ mmotm-2015-10-21-14-41_patched/include/linux/mm.h
> @@ -2173,6 +2173,7 @@ extern int memory_failure(unsigned long pfn, int trapno, int flags);
>  extern void memory_failure_queue(unsigned long pfn, int trapno, int flags);
>  extern int unpoison_memory(unsigned long pfn);
>  extern int get_hwpoison_page(struct page *page);
> +#define put_hwpoison_page(page)	put_page(page)
>  extern void put_hwpoison_page(struct page *page);

This line should be removed.

Otherwise looks good to me.

Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>

-- 
 Kirill A. Shutemov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v1] mm: hwpoison: adjust for new thp refcounting Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> - 2015-11-06 07:20 +0100
  Re: [PATCH v1] mm: hwpoison: adjust for new thp refcounting Sasha Levin <sasha.levin@oracle.com> - 2015-11-06 07:40 +0100
    Re: [PATCH v1] mm: hwpoison: adjust for new thp refcounting Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> - 2015-11-06 07:50 +0100
      [PATCH v2] mm: hwpoison: adjust for new thp refcounting Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> - 2015-11-06 09:10 +0100
        Re: [PATCH v2] mm: hwpoison: adjust for new thp refcounting "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-11-06 11:40 +0100
      [PATCH v1] hugetlb: trivial comment fix Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> - 2015-11-09 10:20 +0100

csiph-web