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


Groups > linux.kernel > #1620570

Re: [PATCH] mm, numa: Fix bad pmd by atomically check for pmd_trans_huge when marking page tables prot_numa

From Mel Gorman <mgorman@techsingularity.net>
Newsgroups linux.kernel
Subject Re: [PATCH] mm, numa: Fix bad pmd by atomically check for pmd_trans_huge when marking page tables prot_numa
Date 2017-04-10 20:10 +0200
Message-ID <tuLVf-4hB-21@gated-at.bofh.it> (permalink)
References <tuE7n-7nn-3@gated-at.bofh.it> <tuLiy-3MR-43@gated-at.bofh.it> <tuLiy-3MR-41@gated-at.bofh.it> <tuLVf-4hB-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Apr 10, 2017 at 12:49:40PM -0500, Zi Yan wrote:
> On 10 Apr 2017, at 12:20, Mel Gorman wrote:
> 
> > On Mon, Apr 10, 2017 at 11:45:08AM -0500, Zi Yan wrote:
> >>> While this could be fixed with heavy locking, it's only necessary to
> >>> make a copy of the PMD on the stack during change_pmd_range and avoid
> >>> races. A new helper is created for this as the check if quite subtle and the
> >>> existing similar helpful is not suitable. This passed 154 hours of testing
> >>> (usually triggers between 20 minutes and 24 hours) without detecting bad
> >>> PMDs or corruption. A basic test of an autonuma-intensive workload showed
> >>> no significant change in behaviour.
> >>>
> >>> Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
> >>> Cc: stable@vger.kernel.org
> >>
> >> Does this patch fix the same problem fixed by Kirill's patch here?
> >> https://lkml.org/lkml/2017/3/2/347
> >>
> >
> > I don't think so. The race I'm concerned with is due to locks not being
> > held and is in a different path.
> 
> I do not agree. Kirill's patch is fixing the same race problem but in
> zap_pmd_range().
> 
> The original autoNUMA code first clears PMD then sets it to protnone entry.
> pmd_trans_huge() does not return TRUE because it saw cleared PMD, but
> pmd_none_or_clear_bad() later saw the protnone entry and reported it as bad.
> Is this the problem you are trying solve?
> 
> Kirill's patch will pmdp_invalidate() the PMD entry, which keeps _PAGE_PSE bit,
> so pmd_trans_huge() will return TRUE. In this case, it also fixes
> your race problem in change_pmd_range().
> 
> Let me know if I miss anything.
> 

Ok, now I see. I think you're correct and I withdraw the patch.

-- 
Mel Gorman
SUSE Labs

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


Thread

Re: [PATCH] mm, numa: Fix bad pmd by atomically check for  pmd_trans_huge when marking page tables prot_numa Mel Gorman <mgorman@techsingularity.net> - 2017-04-10 19:30 +0200
  Re: [PATCH] mm, numa: Fix bad pmd by atomically check for  pmd_trans_huge when marking page tables prot_numa Mel Gorman <mgorman@techsingularity.net> - 2017-04-10 20:10 +0200
    Re: [PATCH] mm, numa: Fix bad pmd by atomically check for  pmd_trans_huge when marking page tables prot_numa Andrew Morton <akpm@linux-foundation.org> - 2017-04-11 00:10 +0200
      Re: [PATCH] mm, numa: Fix bad pmd by atomically check for  pmd_trans_huge when marking page tables prot_numa Vlastimil Babka <vbabka@suse.cz> - 2017-04-11 08:40 +0200
        Re: [PATCH] mm, numa: Fix bad pmd by atomically check for  pmd_trans_huge when marking page tables prot_numa Andrew Morton <akpm@linux-foundation.org> - 2017-04-11 23:50 +0200
      Re: [PATCH] mm, numa: Fix bad pmd by atomically check for  pmd_trans_huge when marking page tables prot_numa Mel Gorman <mgorman@techsingularity.net> - 2017-04-11 10:30 +0200

csiph-web