Re: [PATCH 14/15] mm: fix TLB flush race between migration, and change_protection_range

2013-12-09 Thread Rik van Riel
On 12/09/2013 11:59 AM, Christoph Lameter wrote: > On Mon, 9 Dec 2013, Mel Gorman wrote: > >> I looked at what would be required to implement migration entry support for >> PMDs. It's major surgery because we do not have something like swap-like >> entries to use at that page table level. It looke

Re: [PATCH 14/15] mm: fix TLB flush race between migration, and change_protection_range

2013-12-09 Thread Christoph Lameter
On Mon, 9 Dec 2013, Mel Gorman wrote: > I looked at what would be required to implement migration entry support for > PMDs. It's major surgery because we do not have something like swap-like > entries to use at that page table level. It looked like it would require > inserting a fake entry (easies

Re: [PATCH 14/15] mm: fix TLB flush race between migration, and change_protection_range

2013-12-09 Thread Mel Gorman
On Mon, Dec 09, 2013 at 04:00:24PM +, Christoph Lameter wrote: > On Fri, 6 Dec 2013, Rik van Riel wrote: > > > > Ok then what are you trying to fix? > > > > It would help if you had actually read the patch. > > I read the patch. Please update the documentation to accurately describe > the rac

Re: [PATCH 14/15] mm: fix TLB flush race between migration, and change_protection_range

2013-12-09 Thread Christoph Lameter
On Fri, 6 Dec 2013, Rik van Riel wrote: > > Ok then what are you trying to fix? > > It would help if you had actually read the patch. I read the patch. Please update the documentation to accurately describe the race. >From what I can see this race affects only huge pages and the basic issue seem

Re: [PATCH 14/15] mm: fix TLB flush race between migration, and change_protection_range

2013-12-06 Thread Rik van Riel
On 12/06/2013 07:25 PM, Christoph Lameter wrote: > On Fri, 6 Dec 2013, Rik van Riel wrote: > >>> When you start migrating a page a special page migration entry is >>> created that will trap all accesses to the page. You can safely flush when >>> the migration entry is there. Only allow a new PTE/P

Re: [PATCH 14/15] mm: fix TLB flush race between migration, and change_protection_range

2013-12-06 Thread Christoph Lameter
On Fri, 6 Dec 2013, Rik van Riel wrote: > > When you start migrating a page a special page migration entry is > > created that will trap all accesses to the page. You can safely flush when > > the migration entry is there. Only allow a new PTE/PMD to be put there > > *after* the tlb flush. > > A P

Re: [PATCH 14/15] mm: fix TLB flush race between migration, and change_protection_range

2013-12-06 Thread Rik van Riel
On 12/06/2013 03:32 PM, Christoph Lameter wrote: > On Fri, 6 Dec 2013, Rik van Riel wrote: >> >> The basic race looks like this: >> >> CPU ACPU B CPU C >> >> load TLB entry >> make entry PTE/PMD_NUMA >>

Re: [PATCH 14/15] mm: fix TLB flush race between migration, and change_protection_range

2013-12-06 Thread Christoph Lameter
On Fri, 6 Dec 2013, Rik van Riel wrote: > > The basic race looks like this: > > CPU A CPU B CPU C > > load TLB entry > make entry PTE/PMD_NUMA > fault on entry >

[PATCH 14/15] mm: fix TLB flush race between migration, and change_protection_range

2013-12-06 Thread Rik van Riel
On Wed, 4 Dec 2013 16:07:41 + Mel Gorman wrote: > Because I found it impossible to segfault processes under any level of > scanning and numa hinting fault stress after it was applied As discussed on #mm, here is the new patch (just compile tested so far). ---8<--- Subject: mm: fix TLB flus