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


Groups > linux.kernel > #1661049

Re: [PATCH 3/3] mm: migrate: Stabilise page count when migrating transparent hugepages

From "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH 3/3] mm: migrate: Stabilise page count when migrating transparent hugepages
Date 2017-06-08 12:50 +0200
Message-ID <tQ3aN-3bB-1@gated-at.bofh.it> (permalink)
References <tPqVR-3xj-39@gated-at.bofh.it> <tPqVR-3xj-41@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Jun 06, 2017 at 06:58:36PM +0100, Will Deacon wrote:
> When migrating a transparent hugepage, migrate_misplaced_transhuge_page
> guards itself against a concurrent fastgup of the page by checking that
> the page count is equal to 2 before and after installing the new pmd.
> 
> If the page count changes, then the pmd is reverted back to the original
> entry, however there is a small window where the new (possibly writable)
> pmd is installed and the underlying page could be written by userspace.
> Restoring the old pmd could therefore result in loss of data.
> 
> This patch fixes the problem by freezing the page count whilst updating
> the page tables, which protects against a concurrent fastgup without the
> need to restore the old pmd in the failure case (since the page count can
> no longer change under our feet).
> 
> Cc: Mel Gorman <mgorman@suse.de>
> Signed-off-by: Will Deacon <will.deacon@arm.com>

Looks correct to me.

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

-- 
 Kirill A. Shutemov

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


Thread

Re: [PATCH 3/3] mm: migrate: Stabilise page count when migrating  transparent hugepages "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2017-06-08 12:50 +0200

csiph-web