linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: William Kucharski <william.kucharski@oracle.com>
To: Peter Xu <peterx@redhat.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Matthew Wilcox <willy@infradead.org>,
	Michal Hocko <mhocko@suse.com>, Dave Jiang <dave.jiang@intel.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
	Souptick Joarder <jrdr.linux@gmail.com>,
	Konstantin Khlebnikov <khlebnikov@yandex-team.ru>,
	Zi Yan <zi.yan@cs.rutgers.edu>,
	linux-mm@kvack.org
Subject: Re: [PATCH v3] mm: thp: fix flags for pmd migration when split
Date: Thu, 13 Dec 2018 01:24:27 -0700	[thread overview]
Message-ID: <6B1C6409-E855-47E4-9D33-3D7C634A47F6@oracle.com> (raw)
In-Reply-To: <20181213051510.20306-1-peterx@redhat.com>



> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index f2d19e4fe854..aebade83cec9 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -2145,23 +2145,25 @@ static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd,
> 	 */
> 	old_pmd = pmdp_invalidate(vma, haddr, pmd);
> 
> -#ifdef CONFIG_ARCH_ENABLE_THP_MIGRATION
> 	pmd_migration = is_pmd_migration_entry(old_pmd);
> -	if (pmd_migration) {
> +	if (unlikely(pmd_migration)) {
> 		swp_entry_t entry;
> 
> 		entry = pmd_to_swp_entry(old_pmd);
> 		page = pfn_to_page(swp_offset(entry));
> -	} else
> -#endif
> +		write = is_write_migration_entry(entry);
> +		young = false;
> +		soft_dirty = pmd_swp_soft_dirty(old_pmd);
> +	} else {
> 		page = pmd_page(old_pmd);
> +		if (pmd_dirty(old_pmd))
> +			SetPageDirty(page);
> +		write = pmd_write(old_pmd);
> +		young = pmd_young(old_pmd);
> +		soft_dirty = pmd_soft_dirty(old_pmd);
> +	}
> 	VM_BUG_ON_PAGE(!page_count(page), page);
> 	page_ref_add(page, HPAGE_PMD_NR - 1);
> -	if (pmd_dirty(old_pmd))
> -		SetPageDirty(page);
> -	write = pmd_write(old_pmd);
> -	young = pmd_young(old_pmd);
> -	soft_dirty = pmd_soft_dirty(old_pmd);
> 
> 	/*
> 	 * Withdraw the table only after we mark the pmd entry invalid.
> -- 

Looks good.

Reviewed-by: William Kucharski <william.kucharski@oracle.com>

  parent reply	other threads:[~2018-12-13  8:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-13  5:15 Peter Xu
2018-12-13  7:55 ` Konstantin Khlebnikov
2018-12-13  8:24 ` William Kucharski [this message]
2018-12-13  9:59 ` Kirill A. Shutemov
2018-12-13 10:24   ` Peter Xu

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=6B1C6409-E855-47E4-9D33-3D7C634A47F6@oracle.com \
    --to=william.kucharski@oracle.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=dave.jiang@intel.com \
    --cc=jrdr.linux@gmail.com \
    --cc=khlebnikov@yandex-team.ru \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=peterx@redhat.com \
    --cc=willy@infradead.org \
    --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