[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181213095942.3y7lfdwndek6sja4@kshutemo-mobl1>
Date: Thu, 13 Dec 2018 12:59:42 +0300
From: "Kirill A. Shutemov" <kirill@...temov.name>
To: Peter Xu <peterx@...hat.com>
Cc: linux-kernel@...r.kernel.org,
Andrea Arcangeli <aarcange@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Matthew Wilcox <willy@...radead.org>,
Michal Hocko <mhocko@...e.com>,
Dave Jiang <dave.jiang@...el.com>,
"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>,
Souptick Joarder <jrdr.linux@...il.com>,
Konstantin Khlebnikov <khlebnikov@...dex-team.ru>,
Zi Yan <zi.yan@...rutgers.edu>, linux-mm@...ck.org
Subject: Re: [PATCH v3] mm: thp: fix flags for pmd migration when split
On Thu, Dec 13, 2018 at 01:15:10PM +0800, Peter Xu wrote:
> When splitting a huge migrating PMD, we'll transfer all the existing
> PMD bits and apply them again onto the small PTEs. However we are
> fetching the bits unconditionally via pmd_soft_dirty(), pmd_write()
> or pmd_yound() while actually they don't make sense at all when it's
> a migration entry. Fix them up. Since at it, drop the ifdef together
> as not needed.
>
> Note that if my understanding is correct about the problem then if
> without the patch there is chance to lose some of the dirty bits in
> the migrating pmd pages (on x86_64 we're fetching bit 11 which is part
> of swap offset instead of bit 2) and it could potentially corrupt the
> memory of an userspace program which depends on the dirty bit.
>
> CC: Andrea Arcangeli <aarcange@...hat.com>
> CC: Andrew Morton <akpm@...ux-foundation.org>
> CC: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
> CC: Matthew Wilcox <willy@...radead.org>
> CC: Michal Hocko <mhocko@...e.com>
> CC: Dave Jiang <dave.jiang@...el.com>
> CC: "Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
> CC: Souptick Joarder <jrdr.linux@...il.com>
> CC: Konstantin Khlebnikov <khlebnikov@...dex-team.ru>
> CC: Zi Yan <zi.yan@...rutgers.edu>
> CC: linux-mm@...ck.org
> CC: linux-kernel@...r.kernel.org
> Signed-off-by: Peter Xu <peterx@...hat.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
Stable?
--
Kirill A. Shutemov
Powered by blists - more mailing lists