Re: [PATCH] mm: Save soft-dirty bits on file pages

2013-07-29 Thread Cyrill Gorcunov
On Mon, Jul 29, 2013 at 08:28:54PM +0530, Aneesh Kumar K.V wrote: > > > > If only I'm not missing something obvious, this code compiles not only on > > x86, > > CONFIG_MEM_SOFT_DIRTY depends on x86 (otherwise I'll have to implement > > pte_soft_dirty for all archs). > > why not > > #ifndef pte_s

Re: [PATCH] mm: Save soft-dirty bits on file pages

2013-07-29 Thread Aneesh Kumar K.V
Cyrill Gorcunov writes: > On Mon, Jul 29, 2013 at 06:08:55PM +0400, Pavel Emelyanov wrote: >> > >> > - if (!pte_none(*pte)) >> > + ptfile = pgoff_to_pte(pgoff); >> > + >> > + if (!pte_none(*pte)) { >> > +#ifdef CONFIG_MEM_SOFT_DIRTY >> > + if (pte_present(*pte) && >> > +

Re: [PATCH] mm: Save soft-dirty bits on file pages

2013-07-29 Thread Cyrill Gorcunov
On Mon, Jul 29, 2013 at 06:24:39PM +0400, Pavel Emelyanov wrote: > > For non-x86 case there are stubs in include/asm-generic/pgtable.h that would > act as if the CONFIG_MEM_SOFT_DIRTY is off. Yeah, thanks, I'll update. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

Re: [PATCH] mm: Save soft-dirty bits on file pages

2013-07-29 Thread Pavel Emelyanov
On 07/29/2013 06:14 PM, Cyrill Gorcunov wrote: > On Mon, Jul 29, 2013 at 06:08:55PM +0400, Pavel Emelyanov wrote: >>> >>> - if (!pte_none(*pte)) >>> + ptfile = pgoff_to_pte(pgoff); >>> + >>> + if (!pte_none(*pte)) { >>> +#ifdef CONFIG_MEM_SOFT_DIRTY >>> + if (pte_present(*pte) &&

Re: [PATCH] mm: Save soft-dirty bits on file pages

2013-07-29 Thread Cyrill Gorcunov
On Mon, Jul 29, 2013 at 06:08:55PM +0400, Pavel Emelyanov wrote: > > > > - if (!pte_none(*pte)) > > + ptfile = pgoff_to_pte(pgoff); > > + > > + if (!pte_none(*pte)) { > > +#ifdef CONFIG_MEM_SOFT_DIRTY > > + if (pte_present(*pte) && > > + pte_soft_dirty(*pte)) > > I

Re: [PATCH] mm: Save soft-dirty bits on file pages

2013-07-29 Thread Pavel Emelyanov
On 07/27/2013 12:18 AM, Cyrill Gorcunov wrote: > Andy reported that if file page get reclaimed we loose soft-dirty bit > if it was there, so save _PAGE_BIT_SOFT_DIRTY bit when page address > get encoded into pte entry. Thus when #pf happens on such non-present > pte we can restore it back. > > Rep

Re: [PATCH] mm: Save soft-dirty bits on file pages

2013-07-28 Thread Pavel Emelyanov
On 07/27/2013 11:29 PM, Pavel Emelyanov wrote: > On 07/27/2013 12:55 AM, Andy Lutomirski wrote: >> On Fri, Jul 26, 2013 at 1:18 PM, Cyrill Gorcunov wrote: >>> Andy reported that if file page get reclaimed we loose soft-dirty bit >>> if it was there, so save _PAGE_BIT_SOFT_DIRTY bit when page addre

Re: [PATCH] mm: Save soft-dirty bits on file pages

2013-07-27 Thread Cyrill Gorcunov
On Sat, Jul 27, 2013 at 10:06:01AM -0700, Andy Lutomirski wrote: > > That being said, a MAP_PRIVATE, un-cowed mapping must be clean -- if > it had been (soft-)dirtied, it would also have been cowed. So you > might be okay. Yas, as far as I know we are either cow'ed or in clean state, thus either

Re: [PATCH] mm: Save soft-dirty bits on file pages

2013-07-27 Thread Pavel Emelyanov
On 07/27/2013 12:55 AM, Andy Lutomirski wrote: > On Fri, Jul 26, 2013 at 1:18 PM, Cyrill Gorcunov wrote: >> Andy reported that if file page get reclaimed we loose soft-dirty bit >> if it was there, so save _PAGE_BIT_SOFT_DIRTY bit when page address >> get encoded into pte entry. Thus when #pf happ

Re: [PATCH] mm: Save soft-dirty bits on file pages

2013-07-27 Thread Andy Lutomirski
On Fri, Jul 26, 2013 at 11:25 PM, Cyrill Gorcunov wrote: > On Fri, Jul 26, 2013 at 02:36:51PM -0700, Andy Lutomirski wrote: >> >> Unless I'm misunderstanding this, it's saving the bit in the >> >> non-present PTE. This sounds wrong -- what happens if the entire pmd >> > >> > It's the same as enco

Re: [PATCH] mm: Save soft-dirty bits on file pages

2013-07-26 Thread Cyrill Gorcunov
On Fri, Jul 26, 2013 at 02:36:51PM -0700, Andy Lutomirski wrote: > >> Unless I'm misunderstanding this, it's saving the bit in the > >> non-present PTE. This sounds wrong -- what happens if the entire pmd > > > > It's the same as encoding pgoff in pte entry (pte is not present), > > but together w

Re: [PATCH] mm: Save soft-dirty bits on file pages

2013-07-26 Thread Andy Lutomirski
On Fri, Jul 26, 2013 at 2:18 PM, Cyrill Gorcunov wrote: > On Fri, Jul 26, 2013 at 01:55:04PM -0700, Andy Lutomirski wrote: >> On Fri, Jul 26, 2013 at 1:18 PM, Cyrill Gorcunov wrote: >> > Andy reported that if file page get reclaimed we loose soft-dirty bit >> > if it was there, so save _PAGE_BIT_

Re: [PATCH] mm: Save soft-dirty bits on file pages

2013-07-26 Thread Cyrill Gorcunov
On Fri, Jul 26, 2013 at 01:55:04PM -0700, Andy Lutomirski wrote: > On Fri, Jul 26, 2013 at 1:18 PM, Cyrill Gorcunov wrote: > > Andy reported that if file page get reclaimed we loose soft-dirty bit > > if it was there, so save _PAGE_BIT_SOFT_DIRTY bit when page address > > get encoded into pte entr

Re: [PATCH] mm: Save soft-dirty bits on file pages

2013-07-26 Thread Andy Lutomirski
On Fri, Jul 26, 2013 at 1:18 PM, Cyrill Gorcunov wrote: > Andy reported that if file page get reclaimed we loose soft-dirty bit > if it was there, so save _PAGE_BIT_SOFT_DIRTY bit when page address > get encoded into pte entry. Thus when #pf happens on such non-present > pte we can restore it back