Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-27 Thread Benjamin Herrenschmidt
On Wed, 2013-08-21 at 09:30 -0700, Linus Torvalds wrote: > I will be reverting the whole soft-dirty mess. I thought the > bit-mapping games it played were already too complicated (the patch to > pgtable-2level.h in commit 41bb3476b361 just makes me want to barf and > came in very late, so I'm not

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-27 Thread Benjamin Herrenschmidt
On Wed, 2013-08-21 at 09:30 -0700, Linus Torvalds wrote: I will be reverting the whole soft-dirty mess. I thought the bit-mapping games it played were already too complicated (the patch to pgtable-2level.h in commit 41bb3476b361 just makes me want to barf and came in very late, so I'm not

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-22 Thread Cyrill Gorcunov
On Thu, Aug 22, 2013 at 03:37:33PM +0900, Minchan Kim wrote: > > > > Look, good thing is that 7th bit also available on the 4level pages > > (ie x86-64) without additional code modification, that's why I picked > > it in first place. I prepared the patch locally which doesn't use > > pse bit for

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-22 Thread Pavel Emelyanov
On 08/22/2013 03:33 PM, Jan Beulich wrote: >> From: Cyrill Gorcunov >> Subject: [PATCH] mm: Make sure _PAGE_SWP_SOFT_DIRTY bit is not set on >> present pte >> >> _PAGE_SOFT_DIRTY bit should never be set on present pte so add >> VM_BUG_ON to catch any potential future abuse. >> >> Also add a

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-22 Thread Jan Beulich
>>> On 22.08.13 at 13:27, Cyrill Gorcunov wrote: > On Thu, Aug 22, 2013 at 08:27:45AM +0100, Jan Beulich wrote: >> >>> On 22.08.13 at 09:03, Cyrill Gorcunov wrote: >> > Ok, how about this? >> > >> > static inline pte_t pte_swp_mksoft_dirty(pte_t pte) >> > { >> >BUG_ON(pte_present(pte)); >>

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-22 Thread Cyrill Gorcunov
On Thu, Aug 22, 2013 at 08:27:45AM +0100, Jan Beulich wrote: > >>> On 22.08.13 at 09:03, Cyrill Gorcunov wrote: > > Ok, how about this? > > > > static inline pte_t pte_swp_mksoft_dirty(pte_t pte) > > { > > BUG_ON(pte_present(pte)); > > return pte_set_flags(pte, _PAGE_SWP_SOFT_DIRTY); > >

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-22 Thread Pavel Emelyanov
On 08/22/2013 01:32 PM, David Vrabel wrote: > On 22/08/13 00:04, Linus Torvalds wrote: >> On Wed, Aug 21, 2013 at 12:03 PM, Cyrill Gorcunov wrote: >>> >>> I personally don't see bug here because >>> >>> - this swapped page soft dirty bit is set for non-present entries only, >>>never for

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-22 Thread David Vrabel
On 22/08/13 00:04, Linus Torvalds wrote: > On Wed, Aug 21, 2013 at 12:03 PM, Cyrill Gorcunov wrote: >> >> I personally don't see bug here because >> >> - this swapped page soft dirty bit is set for non-present entries only, >>never for present ones, just at moment we form swap pte entry >>

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-22 Thread Jan Beulich
>>> On 21.08.13 at 19:28, Andy Lutomirski wrote: > On Wed, Aug 21, 2013 at 6:48 AM, David Vrabel wrote: >> All, >> >> 179ef71c (mm: save soft-dirty bits on swapped pages) introduces a new >> PTE bit on x86 _PTE_SWP_SOFT_DIRTY which has the same value as _PTE_PSE >> and _PTE_PAT. >> >> With a Xen

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-22 Thread Jan Beulich
>>> On 22.08.13 at 01:04, Linus Torvalds wrote: > On Wed, Aug 21, 2013 at 12:03 PM, Cyrill Gorcunov wrote: >> >> I personally don't see bug here because >> >> - this swapped page soft dirty bit is set for non-present entries only, >>never for present ones, just at moment we form swap pte

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-22 Thread Jan Beulich
>>> On 22.08.13 at 09:03, Cyrill Gorcunov wrote: > Ok, how about this? > > static inline pte_t pte_swp_mksoft_dirty(pte_t pte) > { > BUG_ON(pte_present(pte)); > return pte_set_flags(pte, _PAGE_SWP_SOFT_DIRTY); > } Sure, fine with me. Perhaps VM_BUG_ON() or some other similar

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-22 Thread Cyrill Gorcunov
On Thu, Aug 22, 2013 at 07:56:26AM +0100, Jan Beulich wrote: > >>> On 21.08.13 at 18:19, Cyrill Gorcunov wrote: > > On Wed, Aug 21, 2013 at 05:03:13PM +0100, Jan Beulich wrote: > >> > > >> > Only to non-present ptes, as far as I know. > >> > >> That's not really any guarantee. And the accessor

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-22 Thread Jan Beulich
>>> On 21.08.13 at 18:19, Cyrill Gorcunov wrote: > On Wed, Aug 21, 2013 at 05:03:13PM +0100, Jan Beulich wrote: >> > >> > Only to non-present ptes, as far as I know. >> >> That's not really any guarantee. And the accessor functions also >> don't check that they'd be used on non-present PTEs

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-22 Thread Pavel Emelyanov
On 08/22/2013 04:51 AM, Dave Jones wrote: > On Wed, Aug 21, 2013 at 04:04:54PM -0700, Linus Torvalds wrote: > > On Wed, Aug 21, 2013 at 12:03 PM, Cyrill Gorcunov > wrote: > > > > > > I personally don't see bug here because > > > > > > - this swapped page soft dirty bit is set for

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-22 Thread Minchan Kim
Hello Cyrill, On Thu, Aug 22, 2013 at 09:49:19AM +0400, Cyrill Gorcunov wrote: > On Wed, Aug 21, 2013 at 04:42:53PM -0700, Andi Kleen wrote: > > Cyrill Gorcunov writes: > > > > > > Hi all, I worked on patch which would not touch PSE bit for dirty page > > > tracking and the result is not that

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-22 Thread Minchan Kim
Hello Cyrill, On Thu, Aug 22, 2013 at 09:49:19AM +0400, Cyrill Gorcunov wrote: On Wed, Aug 21, 2013 at 04:42:53PM -0700, Andi Kleen wrote: Cyrill Gorcunov gorcu...@gmail.com writes: Hi all, I worked on patch which would not touch PSE bit for dirty page tracking and the result is not

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-22 Thread Pavel Emelyanov
On 08/22/2013 04:51 AM, Dave Jones wrote: On Wed, Aug 21, 2013 at 04:04:54PM -0700, Linus Torvalds wrote: On Wed, Aug 21, 2013 at 12:03 PM, Cyrill Gorcunov gorcu...@gmail.com wrote: I personally don't see bug here because - this swapped page soft dirty bit is set for

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-22 Thread Jan Beulich
On 21.08.13 at 18:19, Cyrill Gorcunov gorcu...@gmail.com wrote: On Wed, Aug 21, 2013 at 05:03:13PM +0100, Jan Beulich wrote: Only to non-present ptes, as far as I know. That's not really any guarantee. And the accessor functions also don't check that they'd be used on non-present PTEs

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-22 Thread Cyrill Gorcunov
On Thu, Aug 22, 2013 at 07:56:26AM +0100, Jan Beulich wrote: On 21.08.13 at 18:19, Cyrill Gorcunov gorcu...@gmail.com wrote: On Wed, Aug 21, 2013 at 05:03:13PM +0100, Jan Beulich wrote: Only to non-present ptes, as far as I know. That's not really any guarantee. And the accessor

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-22 Thread Jan Beulich
On 22.08.13 at 09:03, Cyrill Gorcunov gorcu...@gmail.com wrote: Ok, how about this? static inline pte_t pte_swp_mksoft_dirty(pte_t pte) { BUG_ON(pte_present(pte)); return pte_set_flags(pte, _PAGE_SWP_SOFT_DIRTY); } Sure, fine with me. Perhaps VM_BUG_ON() or some other similar

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-22 Thread Jan Beulich
On 22.08.13 at 01:04, Linus Torvalds torva...@linux-foundation.org wrote: On Wed, Aug 21, 2013 at 12:03 PM, Cyrill Gorcunov gorcu...@gmail.com wrote: I personally don't see bug here because - this swapped page soft dirty bit is set for non-present entries only, never for present ones,

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-22 Thread Jan Beulich
On 21.08.13 at 19:28, Andy Lutomirski l...@amacapital.net wrote: On Wed, Aug 21, 2013 at 6:48 AM, David Vrabel david.vra...@citrix.com wrote: All, 179ef71c (mm: save soft-dirty bits on swapped pages) introduces a new PTE bit on x86 _PTE_SWP_SOFT_DIRTY which has the same value as _PTE_PSE

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-22 Thread David Vrabel
On 22/08/13 00:04, Linus Torvalds wrote: On Wed, Aug 21, 2013 at 12:03 PM, Cyrill Gorcunov gorcu...@gmail.com wrote: I personally don't see bug here because - this swapped page soft dirty bit is set for non-present entries only, never for present ones, just at moment we form swap pte

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-22 Thread Pavel Emelyanov
On 08/22/2013 01:32 PM, David Vrabel wrote: On 22/08/13 00:04, Linus Torvalds wrote: On Wed, Aug 21, 2013 at 12:03 PM, Cyrill Gorcunov gorcu...@gmail.com wrote: I personally don't see bug here because - this swapped page soft dirty bit is set for non-present entries only, never for

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-22 Thread Cyrill Gorcunov
On Thu, Aug 22, 2013 at 08:27:45AM +0100, Jan Beulich wrote: On 22.08.13 at 09:03, Cyrill Gorcunov gorcu...@gmail.com wrote: Ok, how about this? static inline pte_t pte_swp_mksoft_dirty(pte_t pte) { BUG_ON(pte_present(pte)); return pte_set_flags(pte, _PAGE_SWP_SOFT_DIRTY);

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-22 Thread Jan Beulich
On 22.08.13 at 13:27, Cyrill Gorcunov gorcu...@gmail.com wrote: On Thu, Aug 22, 2013 at 08:27:45AM +0100, Jan Beulich wrote: On 22.08.13 at 09:03, Cyrill Gorcunov gorcu...@gmail.com wrote: Ok, how about this? static inline pte_t pte_swp_mksoft_dirty(pte_t pte) {

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-22 Thread Pavel Emelyanov
On 08/22/2013 03:33 PM, Jan Beulich wrote: From: Cyrill Gorcunov gorcu...@gmail.com Subject: [PATCH] mm: Make sure _PAGE_SWP_SOFT_DIRTY bit is not set on present pte _PAGE_SOFT_DIRTY bit should never be set on present pte so add VM_BUG_ON to catch any potential future abuse. Also add a

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-22 Thread Cyrill Gorcunov
On Thu, Aug 22, 2013 at 03:37:33PM +0900, Minchan Kim wrote: Look, good thing is that 7th bit also available on the 4level pages (ie x86-64) without additional code modification, that's why I picked it in first place. I prepared the patch locally which doesn't use pse bit for tracking

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Cyrill Gorcunov
On Wed, Aug 21, 2013 at 04:42:53PM -0700, Andi Kleen wrote: > Cyrill Gorcunov writes: > > > > Hi all, I worked on patch which would not touch PSE bit for dirty page > > tracking and the result is not that good: > > > > - 2level pages now always page dirty if page is swapped in and out, because >

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Cyrill Gorcunov
On Wed, Aug 21, 2013 at 08:51:15PM -0400, Dave Jones wrote: > > Could this explain what I'm seeing in another thread ? > https://lkml.org/lkml/2013/8/7/27 Don't think so. This code is merged in -rc6, while your report is saying the kernel version is -rc4 (also this feature requires

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Dave Jones
On Wed, Aug 21, 2013 at 04:04:54PM -0700, Linus Torvalds wrote: > On Wed, Aug 21, 2013 at 12:03 PM, Cyrill Gorcunov wrote: > > > > I personally don't see bug here because > > > > - this swapped page soft dirty bit is set for non-present entries only, > >never for present ones, just at

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Andi Kleen
Cyrill Gorcunov writes: > > Hi all, I worked on patch which would not touch PSE bit for dirty page > tracking and the result is not that good: > > - 2level pages now always page dirty if page is swapped in and out, because >there is no space left in PTE (other than PSE bit) Maybe just don't

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Cyrill Gorcunov
On Wed, Aug 21, 2013 at 09:30:03AM -0700, Linus Torvalds wrote: > Quite frankly, unless I see a patch later today that is > > (a) obvious > (b) explains what is going on > (c) tested > > I will be reverting the whole soft-dirty mess. I thought the > bit-mapping games it played were already

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Linus Torvalds
On Wed, Aug 21, 2013 at 12:03 PM, Cyrill Gorcunov wrote: > > I personally don't see bug here because > > - this swapped page soft dirty bit is set for non-present entries only, >never for present ones, just at moment we form swap pte entry > > - i don't find any code which would test for

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Pavel Emelyanov
On 08/21/2013 11:07 PM, Andy Lutomirski wrote: > On Wed, Aug 21, 2013 at 12:03 PM, Cyrill Gorcunov wrote: >> On Wed, Aug 21, 2013 at 08:50:26PM +0200, H. Peter Anvin wrote: >>> But is there a manifest bug or not? What is the deal with Xen? >>> >> >> I personally don't see bug here because >> >>

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Cyrill Gorcunov
On Wed, Aug 21, 2013 at 12:07:13PM -0700, Andy Lutomirski wrote: > On Wed, Aug 21, 2013 at 12:03 PM, Cyrill Gorcunov wrote: > > On Wed, Aug 21, 2013 at 08:50:26PM +0200, H. Peter Anvin wrote: > >> But is there a manifest bug or not? What is the deal with Xen? > >> > > > > I personally don't see

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Andy Lutomirski
On Wed, Aug 21, 2013 at 12:03 PM, Cyrill Gorcunov wrote: > On Wed, Aug 21, 2013 at 08:50:26PM +0200, H. Peter Anvin wrote: >> But is there a manifest bug or not? What is the deal with Xen? >> > > I personally don't see bug here because > > - this swapped page soft dirty bit is set for

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Cyrill Gorcunov
On Wed, Aug 21, 2013 at 08:50:26PM +0200, H. Peter Anvin wrote: > But is there a manifest bug or not? What is the deal with Xen? > I personally don't see bug here because - this swapped page soft dirty bit is set for non-present entries only, never for present ones, just at moment we form

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread H. Peter Anvin
But is there a manifest bug or not? What is the deal with Xen? Cyrill Gorcunov wrote: >On Wed, Aug 21, 2013 at 09:25:47PM +0400, Cyrill Gorcunov wrote: >> > >> > However, I do find the use of PTE bits in this way somewhat >fragile. >> > What other potential corner cases might still remain that

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Cyrill Gorcunov
On Wed, Aug 21, 2013 at 09:25:47PM +0400, Cyrill Gorcunov wrote: > > > > However, I do find the use of PTE bits in this way somewhat fragile. > > What other potential corner cases might still remain that will require > > further games with PTE bits? > > OK, so this is not a bug finally. The

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Andy Lutomirski
On Wed, Aug 21, 2013 at 6:48 AM, David Vrabel wrote: > All, > > 179ef71c (mm: save soft-dirty bits on swapped pages) introduces a new > PTE bit on x86 _PTE_SWP_SOFT_DIRTY which has the same value as _PTE_PSE > and _PTE_PAT. > > With a Xen PV guest, the use of the _PTE_PAT will result in the page

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Cyrill Gorcunov
On Wed, Aug 21, 2013 at 05:56:08PM +0100, David Vrabel wrote: > > > > And I asked David to point me how it happens, because I don't > > understand at which point pse bit get analized when page is > > not present. > > As Jan said, we're concerned that the bit was being used on present PTEs > and

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread David Vrabel
On 21/08/13 17:19, Cyrill Gorcunov wrote: > On Wed, Aug 21, 2013 at 05:03:13PM +0100, Jan Beulich wrote: >>> >>> Only to non-present ptes, as far as I know. >> >> That's not really any guarantee. And the accessor functions also >> don't check that they'd be used on non-present PTEs only. > >

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Cyrill Gorcunov
On Wed, Aug 21, 2013 at 09:30:03AM -0700, Linus Torvalds wrote: > On Wed, Aug 21, 2013 at 7:19 AM, Cyrill Gorcunov wrote: > > On Wed, Aug 21, 2013 at 04:11:25PM +0200, H. Peter Anvin wrote: > >> > >> Eep. This should be reverted, indeed. This isn't a manifest bug on !Xen > >> but we > >> have

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Linus Torvalds
On Wed, Aug 21, 2013 at 7:19 AM, Cyrill Gorcunov wrote: > On Wed, Aug 21, 2013 at 04:11:25PM +0200, H. Peter Anvin wrote: >> >> Eep. This should be reverted, indeed. This isn't a manifest bug on !Xen >> but we >> have gotten requests for WT support which would mean adding in the PAT but >>

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Cyrill Gorcunov
On Wed, Aug 21, 2013 at 05:03:13PM +0100, Jan Beulich wrote: > > > > Only to non-present ptes, as far as I know. > > That's not really any guarantee. And the accessor functions also > don't check that they'd be used on non-present PTEs only. Wait. This _PAGE_SWP_SOFT_DIRTY bit (which is in real

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Jan Beulich
>>> On 21.08.13 at 17:42, Cyrill Gorcunov wrote: > On Wed, Aug 21, 2013 at 03:53:36PM +0100, Jan Beulich wrote: >> >>> On 21.08.13 at 16:12, Cyrill Gorcunov wrote: >> > David, could you please explain, Xen keeps and analyze _PTE_PAT bit >> > for ptes which are not present? >> >> No, the problem

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Cyrill Gorcunov
On Wed, Aug 21, 2013 at 03:53:36PM +0100, Jan Beulich wrote: > >>> On 21.08.13 at 16:12, Cyrill Gorcunov wrote: > > On Wed, Aug 21, 2013 at 02:48:20PM +0100, David Vrabel wrote: > >> All, > >> > >> 179ef71c (mm: save soft-dirty bits on swapped pages) introduces a new > >> PTE bit on x86

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread H. Peter Anvin
Only WB pages should be swappable, but even so, the cacheability should be in the vma. Jan Beulich wrote: On 21.08.13 at 16:12, Cyrill Gorcunov wrote: >> On Wed, Aug 21, 2013 at 02:48:20PM +0100, David Vrabel wrote: >>> All, >>> >>> 179ef71c (mm: save soft-dirty bits on swapped pages)

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Jan Beulich
>>> On 21.08.13 at 16:12, Cyrill Gorcunov wrote: > On Wed, Aug 21, 2013 at 02:48:20PM +0100, David Vrabel wrote: >> All, >> >> 179ef71c (mm: save soft-dirty bits on swapped pages) introduces a new >> PTE bit on x86 _PTE_SWP_SOFT_DIRTY which has the same value as _PTE_PSE >> and _PTE_PAT. >> >>

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Cyrill Gorcunov
On Wed, Aug 21, 2013 at 04:22:21PM +0200, H. Peter Anvin wrote: > OK now I'm confused. I guess I shouldn't comment while on vacation > and cache cold on everything. I rather think I'm missing something, that's why I asked David how this featue affects non present pte. -- To unsubscribe from this

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread H. Peter Anvin
Good question... Cyrill Gorcunov wrote: >On Wed, Aug 21, 2013 at 02:48:20PM +0100, David Vrabel wrote: >> All, >> >> 179ef71c (mm: save soft-dirty bits on swapped pages) introduces a new >> PTE bit on x86 _PTE_SWP_SOFT_DIRTY which has the same value as >_PTE_PSE >> and _PTE_PAT. >> >> With a

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread H. Peter Anvin
OK now I'm confused. I guess I shouldn't comment while on vacation and cache cold on everything. Cyrill Gorcunov wrote: >On Wed, Aug 21, 2013 at 04:11:25PM +0200, H. Peter Anvin wrote: >> >> Eep. This should be reverted, indeed. This isn't a manifest bug on >!Xen but we >> have gotten

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Cyrill Gorcunov
On Wed, Aug 21, 2013 at 04:11:25PM +0200, H. Peter Anvin wrote: > > Eep. This should be reverted, indeed. This isn't a manifest bug on !Xen but > we > have gotten requests for WT support which would mean adding in the PAT but > again. Please no, letme fix it. That's what I'm having in mind:

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread H. Peter Anvin
Eep. This should be reverted, indeed. This isn't a manifest bug on !Xen but we have gotten requests for WT support which would mean adding in the PAT but again. David Vrabel wrote: >All, > >179ef71c (mm: save soft-dirty bits on swapped pages) introduces a new >PTE bit on x86

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Cyrill Gorcunov
On Wed, Aug 21, 2013 at 02:48:20PM +0100, David Vrabel wrote: > All, > > 179ef71c (mm: save soft-dirty bits on swapped pages) introduces a new > PTE bit on x86 _PTE_SWP_SOFT_DIRTY which has the same value as _PTE_PSE > and _PTE_PAT. > > With a Xen PV guest, the use of the _PTE_PAT will result in

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread konrad wilk
On 8/21/2013 9:48 AM, David Vrabel wrote: All, 179ef71c (mm: save soft-dirty bits on swapped pages) introduces a new PTE bit on x86 _PTE_SWP_SOFT_DIRTY which has the same value as _PTE_PSE and _PTE_PAT. With a Xen PV guest, the use of the _PTE_PAT will result in the page having unexpected

Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread David Vrabel
All, 179ef71c (mm: save soft-dirty bits on swapped pages) introduces a new PTE bit on x86 _PTE_SWP_SOFT_DIRTY which has the same value as _PTE_PSE and _PTE_PAT. With a Xen PV guest, the use of the _PTE_PAT will result in the page having unexpected cachability which will introduce a range of

Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread David Vrabel
All, 179ef71c (mm: save soft-dirty bits on swapped pages) introduces a new PTE bit on x86 _PTE_SWP_SOFT_DIRTY which has the same value as _PTE_PSE and _PTE_PAT. With a Xen PV guest, the use of the _PTE_PAT will result in the page having unexpected cachability which will introduce a range of

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread konrad wilk
On 8/21/2013 9:48 AM, David Vrabel wrote: All, 179ef71c (mm: save soft-dirty bits on swapped pages) introduces a new PTE bit on x86 _PTE_SWP_SOFT_DIRTY which has the same value as _PTE_PSE and _PTE_PAT. With a Xen PV guest, the use of the _PTE_PAT will result in the page having unexpected

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Cyrill Gorcunov
On Wed, Aug 21, 2013 at 02:48:20PM +0100, David Vrabel wrote: All, 179ef71c (mm: save soft-dirty bits on swapped pages) introduces a new PTE bit on x86 _PTE_SWP_SOFT_DIRTY which has the same value as _PTE_PSE and _PTE_PAT. With a Xen PV guest, the use of the _PTE_PAT will result in the

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread H. Peter Anvin
Eep. This should be reverted, indeed. This isn't a manifest bug on !Xen but we have gotten requests for WT support which would mean adding in the PAT but again. David Vrabel david.vra...@citrix.com wrote: All, 179ef71c (mm: save soft-dirty bits on swapped pages) introduces a new PTE bit on

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Cyrill Gorcunov
On Wed, Aug 21, 2013 at 04:11:25PM +0200, H. Peter Anvin wrote: Eep. This should be reverted, indeed. This isn't a manifest bug on !Xen but we have gotten requests for WT support which would mean adding in the PAT but again. Please no, letme fix it. That's what I'm having in mind: don't

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread H. Peter Anvin
OK now I'm confused. I guess I shouldn't comment while on vacation and cache cold on everything. Cyrill Gorcunov gorcu...@gmail.com wrote: On Wed, Aug 21, 2013 at 04:11:25PM +0200, H. Peter Anvin wrote: Eep. This should be reverted, indeed. This isn't a manifest bug on !Xen but we have

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread H. Peter Anvin
Good question... Cyrill Gorcunov gorcu...@gmail.com wrote: On Wed, Aug 21, 2013 at 02:48:20PM +0100, David Vrabel wrote: All, 179ef71c (mm: save soft-dirty bits on swapped pages) introduces a new PTE bit on x86 _PTE_SWP_SOFT_DIRTY which has the same value as _PTE_PSE and _PTE_PAT. With a

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Cyrill Gorcunov
On Wed, Aug 21, 2013 at 04:22:21PM +0200, H. Peter Anvin wrote: OK now I'm confused. I guess I shouldn't comment while on vacation and cache cold on everything. I rather think I'm missing something, that's why I asked David how this featue affects non present pte. -- To unsubscribe from this

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Jan Beulich
On 21.08.13 at 16:12, Cyrill Gorcunov gorcu...@gmail.com wrote: On Wed, Aug 21, 2013 at 02:48:20PM +0100, David Vrabel wrote: All, 179ef71c (mm: save soft-dirty bits on swapped pages) introduces a new PTE bit on x86 _PTE_SWP_SOFT_DIRTY which has the same value as _PTE_PSE and _PTE_PAT.

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread H. Peter Anvin
Only WB pages should be swappable, but even so, the cacheability should be in the vma. Jan Beulich jbeul...@suse.com wrote: On 21.08.13 at 16:12, Cyrill Gorcunov gorcu...@gmail.com wrote: On Wed, Aug 21, 2013 at 02:48:20PM +0100, David Vrabel wrote: All, 179ef71c (mm: save soft-dirty bits

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Cyrill Gorcunov
On Wed, Aug 21, 2013 at 03:53:36PM +0100, Jan Beulich wrote: On 21.08.13 at 16:12, Cyrill Gorcunov gorcu...@gmail.com wrote: On Wed, Aug 21, 2013 at 02:48:20PM +0100, David Vrabel wrote: All, 179ef71c (mm: save soft-dirty bits on swapped pages) introduces a new PTE bit on x86

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Jan Beulich
On 21.08.13 at 17:42, Cyrill Gorcunov gorcu...@gmail.com wrote: On Wed, Aug 21, 2013 at 03:53:36PM +0100, Jan Beulich wrote: On 21.08.13 at 16:12, Cyrill Gorcunov gorcu...@gmail.com wrote: David, could you please explain, Xen keeps and analyze _PTE_PAT bit for ptes which are not present?

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Cyrill Gorcunov
On Wed, Aug 21, 2013 at 05:03:13PM +0100, Jan Beulich wrote: Only to non-present ptes, as far as I know. That's not really any guarantee. And the accessor functions also don't check that they'd be used on non-present PTEs only. Wait. This _PAGE_SWP_SOFT_DIRTY bit (which is in real PSE

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Linus Torvalds
On Wed, Aug 21, 2013 at 7:19 AM, Cyrill Gorcunov gorcu...@gmail.com wrote: On Wed, Aug 21, 2013 at 04:11:25PM +0200, H. Peter Anvin wrote: Eep. This should be reverted, indeed. This isn't a manifest bug on !Xen but we have gotten requests for WT support which would mean adding in the PAT

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Cyrill Gorcunov
On Wed, Aug 21, 2013 at 09:30:03AM -0700, Linus Torvalds wrote: On Wed, Aug 21, 2013 at 7:19 AM, Cyrill Gorcunov gorcu...@gmail.com wrote: On Wed, Aug 21, 2013 at 04:11:25PM +0200, H. Peter Anvin wrote: Eep. This should be reverted, indeed. This isn't a manifest bug on !Xen but we

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread David Vrabel
On 21/08/13 17:19, Cyrill Gorcunov wrote: On Wed, Aug 21, 2013 at 05:03:13PM +0100, Jan Beulich wrote: Only to non-present ptes, as far as I know. That's not really any guarantee. And the accessor functions also don't check that they'd be used on non-present PTEs only. Wait. This

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Cyrill Gorcunov
On Wed, Aug 21, 2013 at 05:56:08PM +0100, David Vrabel wrote: And I asked David to point me how it happens, because I don't understand at which point pse bit get analized when page is not present. As Jan said, we're concerned that the bit was being used on present PTEs and not just

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Andy Lutomirski
On Wed, Aug 21, 2013 at 6:48 AM, David Vrabel david.vra...@citrix.com wrote: All, 179ef71c (mm: save soft-dirty bits on swapped pages) introduces a new PTE bit on x86 _PTE_SWP_SOFT_DIRTY which has the same value as _PTE_PSE and _PTE_PAT. With a Xen PV guest, the use of the _PTE_PAT will

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Cyrill Gorcunov
On Wed, Aug 21, 2013 at 09:25:47PM +0400, Cyrill Gorcunov wrote: However, I do find the use of PTE bits in this way somewhat fragile. What other potential corner cases might still remain that will require further games with PTE bits? OK, so this is not a bug finally. The problem is

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread H. Peter Anvin
But is there a manifest bug or not? What is the deal with Xen? Cyrill Gorcunov gorcu...@gmail.com wrote: On Wed, Aug 21, 2013 at 09:25:47PM +0400, Cyrill Gorcunov wrote: However, I do find the use of PTE bits in this way somewhat fragile. What other potential corner cases might still

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Cyrill Gorcunov
On Wed, Aug 21, 2013 at 08:50:26PM +0200, H. Peter Anvin wrote: But is there a manifest bug or not? What is the deal with Xen? I personally don't see bug here because - this swapped page soft dirty bit is set for non-present entries only, never for present ones, just at moment we form

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Andy Lutomirski
On Wed, Aug 21, 2013 at 12:03 PM, Cyrill Gorcunov gorcu...@gmail.com wrote: On Wed, Aug 21, 2013 at 08:50:26PM +0200, H. Peter Anvin wrote: But is there a manifest bug or not? What is the deal with Xen? I personally don't see bug here because - this swapped page soft dirty bit is set for

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Cyrill Gorcunov
On Wed, Aug 21, 2013 at 12:07:13PM -0700, Andy Lutomirski wrote: On Wed, Aug 21, 2013 at 12:03 PM, Cyrill Gorcunov gorcu...@gmail.com wrote: On Wed, Aug 21, 2013 at 08:50:26PM +0200, H. Peter Anvin wrote: But is there a manifest bug or not? What is the deal with Xen? I personally don't

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Pavel Emelyanov
On 08/21/2013 11:07 PM, Andy Lutomirski wrote: On Wed, Aug 21, 2013 at 12:03 PM, Cyrill Gorcunov gorcu...@gmail.com wrote: On Wed, Aug 21, 2013 at 08:50:26PM +0200, H. Peter Anvin wrote: But is there a manifest bug or not? What is the deal with Xen? I personally don't see bug here because

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Linus Torvalds
On Wed, Aug 21, 2013 at 12:03 PM, Cyrill Gorcunov gorcu...@gmail.com wrote: I personally don't see bug here because - this swapped page soft dirty bit is set for non-present entries only, never for present ones, just at moment we form swap pte entry - i don't find any code which would

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Cyrill Gorcunov
On Wed, Aug 21, 2013 at 09:30:03AM -0700, Linus Torvalds wrote: Quite frankly, unless I see a patch later today that is (a) obvious (b) explains what is going on (c) tested I will be reverting the whole soft-dirty mess. I thought the bit-mapping games it played were already too

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Andi Kleen
Cyrill Gorcunov gorcu...@gmail.com writes: Hi all, I worked on patch which would not touch PSE bit for dirty page tracking and the result is not that good: - 2level pages now always page dirty if page is swapped in and out, because there is no space left in PTE (other than PSE bit)

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Dave Jones
On Wed, Aug 21, 2013 at 04:04:54PM -0700, Linus Torvalds wrote: On Wed, Aug 21, 2013 at 12:03 PM, Cyrill Gorcunov gorcu...@gmail.com wrote: I personally don't see bug here because - this swapped page soft dirty bit is set for non-present entries only, never for present ones,

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Cyrill Gorcunov
On Wed, Aug 21, 2013 at 08:51:15PM -0400, Dave Jones wrote: Could this explain what I'm seeing in another thread ? https://lkml.org/lkml/2013/8/7/27 Don't think so. This code is merged in -rc6, while your report is saying the kernel version is -rc4 (also this feature requires

Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts with existing use

2013-08-21 Thread Cyrill Gorcunov
On Wed, Aug 21, 2013 at 04:42:53PM -0700, Andi Kleen wrote: Cyrill Gorcunov gorcu...@gmail.com writes: Hi all, I worked on patch which would not touch PSE bit for dirty page tracking and the result is not that good: - 2level pages now always page dirty if page is swapped in and out,