Re: [patch 1/2] [PATCH] mm: Save soft-dirty bits on swapped pages

2013-08-10 Thread James Bottomley
On Wed, 2013-08-07 at 13:21 -0700, Andrew Morton wrote: > On Wed, 31 Jul 2013 00:41:55 +0400 Cyrill Gorcunov wrote: > > > Andy Lutomirski reported that in case if a page with _PAGE_SOFT_DIRTY > > bit set get swapped out, the bit is getting lost and no longer > > available when pte read back. > >

Re: [patch 1/2] [PATCH] mm: Save soft-dirty bits on swapped pages

2013-08-07 Thread Cyrill Gorcunov
On Wed, Aug 07, 2013 at 01:21:56PM -0700, Andrew Morton wrote: > > > > One of the problem was to find a place in pte entry where we can > > save the _PTE_SWP_SOFT_DIRTY bit while page is in swap. The > > _PAGE_PSE was chosen for that, it doesn't intersect with swap > > entry format stored in pte.

Re: [patch 1/2] [PATCH] mm: Save soft-dirty bits on swapped pages

2013-08-07 Thread Andrew Morton
On Wed, 31 Jul 2013 00:41:55 +0400 Cyrill Gorcunov wrote: > Andy Lutomirski reported that in case if a page with _PAGE_SOFT_DIRTY > bit set get swapped out, the bit is getting lost and no longer > available when pte read back. > > To resolve this we introduce _PTE_SWP_SOFT_DIRTY bit which is > s

Re: [patch 1/2] [PATCH] mm: Save soft-dirty bits on swapped pages

2013-08-04 Thread Cyrill Gorcunov
On Mon, Aug 05, 2013 at 10:58:35AM +0800, Wanpeng Li wrote: > > > >pte_to_swp_entry is passed orig_pte by vaule, not a pointer > >so although pte_to_swp_entry clear out _PTE_SWP_SOFT_DIRTY, it does it in > >local-copy. > >So orig_pte is never changed. > > Ouch! Thanks for pointing out. ;-) > > R

Re: [patch 1/2] [PATCH] mm: Save soft-dirty bits on swapped pages

2013-08-04 Thread Minchan Kim
On Mon, Aug 05, 2013 at 10:38:58AM +0800, Wanpeng Li wrote: > Hi Minchan, > > On Mon, Aug 05, 2013 at 11:17:15AM +0900, Minchan Kim wrote: > >Hello Wanpeng, > > > >On Mon, Aug 05, 2013 at 09:48:29AM +0800, Wanpeng Li wrote: > >> On Wed, Jul 31, 2013 at 12:41:55AM +0400, Cyrill Gorcunov wrote: > >>

Re: [patch 1/2] [PATCH] mm: Save soft-dirty bits on swapped pages

2013-08-04 Thread Minchan Kim
Hello Wanpeng, On Mon, Aug 05, 2013 at 09:48:29AM +0800, Wanpeng Li wrote: > On Wed, Jul 31, 2013 at 12:41:55AM +0400, Cyrill Gorcunov wrote: > >Andy Lutomirski reported that in case if a page with _PAGE_SOFT_DIRTY > >bit set get swapped out, the bit is getting lost and no longer > >available when

Re: [patch 1/2] [PATCH] mm: Save soft-dirty bits on swapped pages

2013-07-31 Thread Cyrill Gorcunov
On Thu, Aug 01, 2013 at 03:37:06PM +0900, Minchan Kim wrote: > > Reviewed-by: Minchan Kim Thanks a lot for review, Minchan! -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.

Re: [patch 1/2] [PATCH] mm: Save soft-dirty bits on swapped pages

2013-07-31 Thread Minchan Kim
On Thu, Aug 01, 2013 at 10:28:14AM +0400, Cyrill Gorcunov wrote: > On Thu, Aug 01, 2013 at 03:16:32PM +0900, Minchan Kim wrote: > > > > I don't get it. Could you correct me with below example? > > > > Process A context > > try_to_unmap > > swp_pte = swp_entry_to_pte /* cha

Re: [patch 1/2] [PATCH] mm: Save soft-dirty bits on swapped pages

2013-07-31 Thread Cyrill Gorcunov
On Thu, Aug 01, 2013 at 03:16:32PM +0900, Minchan Kim wrote: > > I don't get it. Could you correct me with below example? > > Process A context > try_to_unmap > swp_pte = swp_entry_to_pte /* change generic swp into arch > swap */ > swp_pte = pte_swp_mksoft

Re: [patch 1/2] [PATCH] mm: Save soft-dirty bits on swapped pages

2013-07-31 Thread Minchan Kim
On Thu, Aug 01, 2013 at 09:53:03AM +0400, Cyrill Gorcunov wrote: > On Thu, Aug 01, 2013 at 09:51:32AM +0900, Minchan Kim wrote: > > > Index: linux-2.6.git/include/linux/swapops.h > > > === > > > --- linux-2.6.git.orig/include/linux/swa

Re: [patch 1/2] [PATCH] mm: Save soft-dirty bits on swapped pages

2013-07-31 Thread Cyrill Gorcunov
On Thu, Aug 01, 2013 at 09:51:32AM +0900, Minchan Kim wrote: > > Index: linux-2.6.git/include/linux/swapops.h > > === > > --- linux-2.6.git.orig/include/linux/swapops.h > > +++ linux-2.6.git/include/linux/swapops.h > > @@ -67,6 +67,8 @

Re: [patch 1/2] [PATCH] mm: Save soft-dirty bits on swapped pages

2013-07-31 Thread Minchan Kim
Hello, On Wed, Jul 31, 2013 at 12:41:55AM +0400, Cyrill Gorcunov wrote: > Andy Lutomirski reported that in case if a page with _PAGE_SOFT_DIRTY > bit set get swapped out, the bit is getting lost and no longer > available when pte read back. > > To resolve this we introduce _PTE_SWP_SOFT_DIRTY bit

Re: [patch 1/2] [PATCH] mm: Save soft-dirty bits on swapped pages

2013-07-31 Thread Pavel Emelyanov
On 07/31/2013 12:41 AM, Cyrill Gorcunov wrote: > Andy Lutomirski reported that in case if a page with _PAGE_SOFT_DIRTY > bit set get swapped out, the bit is getting lost and no longer > available when pte read back. > > To resolve this we introduce _PTE_SWP_SOFT_DIRTY bit which is > saved in pte

[patch 1/2] [PATCH] mm: Save soft-dirty bits on swapped pages

2013-07-30 Thread Cyrill Gorcunov
Andy Lutomirski reported that in case if a page with _PAGE_SOFT_DIRTY bit set get swapped out, the bit is getting lost and no longer available when pte read back. To resolve this we introduce _PTE_SWP_SOFT_DIRTY bit which is saved in pte entry for the page being swapped out. When such page is to b

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

2013-07-25 Thread Andy Lutomirski
On Thu, Jul 25, 2013 at 12:29 AM, Pavel Emelyanov wrote: > On 07/24/2013 11:40 PM, Andy Lutomirski wrote: >> On Wed, Jul 24, 2013 at 12:04 PM, Cyrill Gorcunov wrote: >>> On Wed, Jul 24, 2013 at 10:55:41PM +0400, Pavel Emelyanov wrote: > > >> Perhaps another bit should be allocated to expose t

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

2013-07-25 Thread Pavel Emelyanov
On 07/25/2013 12:26 PM, Hush Bensen wrote: > On 07/25/2013 03:29 PM, Pavel Emelyanov wrote: >> On 07/24/2013 11:40 PM, Andy Lutomirski wrote: >>> On Wed, Jul 24, 2013 at 12:04 PM, Cyrill Gorcunov >>> wrote: On Wed, Jul 24, 2013 at 10:55:41PM +0400, Pavel Emelyanov wrote: >> Well, some pa

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

2013-07-25 Thread Hush Bensen
On 07/25/2013 03:29 PM, Pavel Emelyanov wrote: On 07/24/2013 11:40 PM, Andy Lutomirski wrote: On Wed, Jul 24, 2013 at 12:04 PM, Cyrill Gorcunov wrote: On Wed, Jul 24, 2013 at 10:55:41PM +0400, Pavel Emelyanov wrote: Well, some part of information already lays in pte (such as 'file' bit, swap

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

2013-07-25 Thread Pavel Emelyanov
On 07/24/2013 11:40 PM, Andy Lutomirski wrote: > On Wed, Jul 24, 2013 at 12:04 PM, Cyrill Gorcunov wrote: >> On Wed, Jul 24, 2013 at 10:55:41PM +0400, Pavel Emelyanov wrote: Well, some part of information already lays in pte (such as 'file' bit, swap entries) so it looks natural i t

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

2013-07-25 Thread Cyrill Gorcunov
On Wed, Jul 24, 2013 at 12:40:22PM -0700, Andy Lutomirski wrote: > > Hmm. So there are at least three kinds of memory: > > Anonymous pages: soft-dirty works > Shared file-backed pages: soft-dirty does not work > Private file-backed pages: soft-dirty works (but see below) > > Perhaps another bit

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

2013-07-24 Thread Andy Lutomirski
On Wed, Jul 24, 2013 at 12:04 PM, Cyrill Gorcunov wrote: > On Wed, Jul 24, 2013 at 10:55:41PM +0400, Pavel Emelyanov wrote: >> > >> > Well, some part of information already lays in pte (such as 'file' bit, >> > swap entries) so it looks natural i think to work on this level. but >> > letme think i

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

2013-07-24 Thread Cyrill Gorcunov
On Wed, Jul 24, 2013 at 11:04:53PM +0400, Cyrill Gorcunov wrote: > On Wed, Jul 24, 2013 at 10:55:41PM +0400, Pavel Emelyanov wrote: > > > > > > Well, some part of information already lays in pte (such as 'file' bit, > > > swap entries) so it looks natural i think to work on this level. but > > > l

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

2013-07-24 Thread Cyrill Gorcunov
On Wed, Jul 24, 2013 at 10:55:41PM +0400, Pavel Emelyanov wrote: > > > > Well, some part of information already lays in pte (such as 'file' bit, > > swap entries) so it looks natural i think to work on this level. but > > letme think if use page struct for that be more convenient... > > It hardly

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

2013-07-24 Thread Pavel Emelyanov
On 07/24/2013 10:52 PM, Cyrill Gorcunov wrote: > On Wed, Jul 24, 2013 at 11:21:46AM -0700, Andy Lutomirski wrote: >>> >>> I fear for tracking soft-dirty-bit for swapped entries we sinply have >>> no other place than pte (still i'm quite open for ideas, maybe there >>> are a better way which I've mi

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

2013-07-24 Thread Cyrill Gorcunov
On Wed, Jul 24, 2013 at 11:21:46AM -0700, Andy Lutomirski wrote: > > > > I fear for tracking soft-dirty-bit for swapped entries we sinply have > > no other place than pte (still i'm quite open for ideas, maybe there > > are a better way which I've missed). > > I know approximately nothing about ho

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

2013-07-24 Thread Pavel Emelyanov
On 07/24/2013 08:23 PM, Andy Lutomirski wrote: > On Wed, Jul 24, 2013 at 9:08 AM, Cyrill Gorcunov wrote: >> Andy Lutomirski reported that in case if a page with _PAGE_SOFT_DIRTY >> bit set get swapped out, the bit is getting lost and no longer >> available when pte read back. > > Potentially sill

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

2013-07-24 Thread Pavel Emelyanov
On 07/24/2013 08:08 PM, Cyrill Gorcunov wrote: > Andy Lutomirski reported that in case if a page with _PAGE_SOFT_DIRTY > bit set get swapped out, the bit is getting lost and no longer > available when pte read back. > > To resolve this we introduce _PTE_SWP_SOFT_DIRTY bit which is > saved in pte e

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

2013-07-24 Thread Andy Lutomirski
On Wed, Jul 24, 2013 at 11:15 AM, Cyrill Gorcunov wrote: > On Wed, Jul 24, 2013 at 10:42:24AM -0700, Andy Lutomirski wrote: >> > >> > Lets just be clear about the problem first: the vmscan pass referred to >> > above happens only on clean pages, so the soft dirty bit could only be >> > set if the

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

2013-07-24 Thread Cyrill Gorcunov
On Wed, Jul 24, 2013 at 10:42:24AM -0700, Andy Lutomirski wrote: > > > > Lets just be clear about the problem first: the vmscan pass referred to > > above happens only on clean pages, so the soft dirty bit could only be > > set if the page was previously dirty and got written back. Now it's an > >

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

2013-07-24 Thread Andy Lutomirski
On Wed, Jul 24, 2013 at 10:36 AM, James Bottomley wrote: > On Wed, 2013-07-24 at 21:17 +0400, Cyrill Gorcunov wrote: >> On Wed, Jul 24, 2013 at 10:06:53AM -0700, Andy Lutomirski wrote: >> > > Hi Andy, if I understand you correctly "file-backed pages" are carried >> > > in pte with _PAGE_FILE bit s

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

2013-07-24 Thread James Bottomley
On Wed, 2013-07-24 at 21:17 +0400, Cyrill Gorcunov wrote: > On Wed, Jul 24, 2013 at 10:06:53AM -0700, Andy Lutomirski wrote: > > > Hi Andy, if I understand you correctly "file-backed pages" are carried > > > in pte with _PAGE_FILE bit set and the swap soft-dirty bit won't be > > > used on them but

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

2013-07-24 Thread Cyrill Gorcunov
On Wed, Jul 24, 2013 at 10:06:53AM -0700, Andy Lutomirski wrote: > > Hi Andy, if I understand you correctly "file-backed pages" are carried > > in pte with _PAGE_FILE bit set and the swap soft-dirty bit won't be > > used on them but _PAGE_SOFT_DIRTY will be set on write if only I've > > not missed

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

2013-07-24 Thread Andy Lutomirski
On Wed, Jul 24, 2013 at 9:37 AM, Cyrill Gorcunov wrote: > On Wed, Jul 24, 2013 at 09:23:14AM -0700, Andy Lutomirski wrote: >> On Wed, Jul 24, 2013 at 9:08 AM, Cyrill Gorcunov wrote: >> > Andy Lutomirski reported that in case if a page with _PAGE_SOFT_DIRTY >> > bit set get swapped out, the bit is

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

2013-07-24 Thread Cyrill Gorcunov
On Wed, Jul 24, 2013 at 09:23:14AM -0700, Andy Lutomirski wrote: > On Wed, Jul 24, 2013 at 9:08 AM, Cyrill Gorcunov wrote: > > Andy Lutomirski reported that in case if a page with _PAGE_SOFT_DIRTY > > bit set get swapped out, the bit is getting lost and no longer > > available when pte read back.

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

2013-07-24 Thread Andy Lutomirski
On Wed, Jul 24, 2013 at 9:08 AM, Cyrill Gorcunov wrote: > Andy Lutomirski reported that in case if a page with _PAGE_SOFT_DIRTY > bit set get swapped out, the bit is getting lost and no longer > available when pte read back. Potentially silly question (due to my completely lack of understanding o

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

2013-07-24 Thread Cyrill Gorcunov
Andy Lutomirski reported that in case if a page with _PAGE_SOFT_DIRTY bit set get swapped out, the bit is getting lost and no longer available when pte read back. To resolve this we introduce _PTE_SWP_SOFT_DIRTY bit which is saved in pte entry for the page being swapped out. When such page is to b