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


Groups > linux.kernel > #1519699

Re: [PATCH v2 01/12] mm: x86: move _PAGE_SWP_SOFT_DIRTY from bit 7 to bit 6

From "Kirill A. Shutemov" <kirill@shutemov.name>
Newsgroups linux.kernel
Subject Re: [PATCH v2 01/12] mm: x86: move _PAGE_SWP_SOFT_DIRTY from bit 7 to bit 6
Date 2016-11-11 12:20 +0100
Message-ID <sCi2d-3Bo-5@gated-at.bofh.it> (permalink)
References <sB1Ga-1xZ-7@gated-at.bofh.it> <sB1Ga-1xZ-15@gated-at.bofh.it> <sC76N-4It-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Nov 10, 2016 at 03:29:51PM -0800, Dave Hansen wrote:
> On 11/07/2016 03:31 PM, Naoya Horiguchi wrote:
> > pmd_present() checks _PAGE_PSE along with _PAGE_PRESENT to avoid false negative
> > return when it races with thp spilt (during which _PAGE_PRESENT is temporary
> > cleared.) I don't think that dropping _PAGE_PSE check in pmd_present() works
> > well because it can hurt optimization of tlb handling in thp split.
> > In the current kernel, bit 6 is not used in non-present format because nonlinear
> > file mapping is obsolete, so let's move _PAGE_SWP_SOFT_DIRTY to that bit.
> > Bit 7 is used as reserved (always clear), so please don't use it for other
> > purpose.
> ...
> >  #ifdef CONFIG_MEM_SOFT_DIRTY
> > -#define _PAGE_SWP_SOFT_DIRTY	_PAGE_PSE
> > +#define _PAGE_SWP_SOFT_DIRTY	_PAGE_DIRTY
> >  #else
> >  #define _PAGE_SWP_SOFT_DIRTY	(_AT(pteval_t, 0))
> >  #endif
> 
> I'm not sure this works.  Take a look at commit 00839ee3b29 and the
> erratum it works around.  I _think_ this means that a system affected by
> the erratum might see an erroneous _PAGE_SWP_SOFT_DIRTY/_PAGE_DIRTY get
> set in swap ptes.

But, is it destructive in any way? What is the harm if we mark swap entry
dirty by mistake?

Pavel?

-- 
 Kirill A. Shutemov

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v2 01/12] mm: x86: move _PAGE_SWP_SOFT_DIRTY from bit 7 to bit 6 Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> - 2016-11-08 00:40 +0100
  Re: [PATCH v2 01/12] mm: x86: move _PAGE_SWP_SOFT_DIRTY from bit 7 to  bit 6 Dave Hansen <dave.hansen@intel.com> - 2016-11-11 00:40 +0100
    Re: [PATCH v2 01/12] mm: x86: move _PAGE_SWP_SOFT_DIRTY from bit 7  to bit 6 Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> - 2016-11-11 02:20 +0100
    Re: [PATCH v2 01/12] mm: x86: move _PAGE_SWP_SOFT_DIRTY from bit 7  to bit 6 "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-11-11 12:20 +0100

csiph-web