On 07/20/2015 04:21 PM, 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.shute...@linux.intel.com>
> Tested-by: Sasha Levin <sasha.le...@oracle.com>
> Tested-by: Aneesh Kumar K.V <aneesh.ku...@linux.vnet.ibm.com>

Acked-by: Jerome Marchand <jmarc...@redhat.com>

> ---
>  include/linux/huge_mm.h |   7 +-
>  include/linux/pagemap.h |  13 +-
>  mm/huge_memory.c        | 318 
> ++++++++++++++++++++++++++++++++++++++++++++++++
>  mm/internal.h           |  26 +++-
>  mm/rmap.c               |  21 ----
>  5 files changed, 357 insertions(+), 28 deletions(-)
> 
> 


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to