lkml.org 
[lkml]   [2015]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRE: [PATCH 32/36] thp: reintroduce split_huge_page()
Date
Kirill A. Shutemov wrote:
> This patch adds implementation of split_huge_page() for new
> refcountings.
>
> Unlike previous implementation, new split_huge_page() can fail if
> somebody holds GUP pin on the page. It also means that pin on page
> would prevent it from bening split under you. It makes situation in
> many places much cleaner.
>
> The basic scheme of split_huge_page():
>
> - Check that sum of mapcounts of all subpage is equal to page_count()
> plus one (caller pin). Foll off with -EBUSY. This way we can avoid
> useless PMD-splits.
>
> - Freeze the page counters by splitting all PMD and setup migration
> PTEs.
>
> - Re-check sum of mapcounts against page_count(). Page's counts are
> stable now. -EBUSY if page is pinned.
>
> - Split compound page.
>
> - Unfreeze the page by removing migration entries.
>
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Tested-by: Sasha Levin <sasha.levin@oracle.com>

checkpatch fixlet:

749ab1c0df4a thp: reintroduce split_huge_page() fix
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 5df1b76837c7..a200ed579e1f 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -2998,7 +2998,7 @@ static void __split_huge_page(struct page *page, struct list_head *list)
* Both head page and tail pages will inherit mapping, flags, and so on from
* the hugepage.
*
- * GUP pin and PG_locked transfered to @page. Rest subpages can be freed if
+ * GUP pin and PG_locked transferred to @page. Rest subpages can be freed if
* they are not mapped.
*
* Returns 0 if the hugepage is split successfully.

\
 
 \ /
  Last update: 2015-07-14 16:21    [W:0.348 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site