[PATCH] x86/mm: Fix regression with huge pages on PAE

2015-11-30 Thread Borislav Petkov
From: "Kirill A. Shutemov" Recent PAT patchset has caused issue on 32-bit PAE machines: page:eea45000 count:0 mapcount:-128 mapping: (null) index:0x0 flags: 0x4000() page dumped because: VM_BUG_ON_PAGE(page_mapcount(page) < 0) [ cut here ] kernel BUG at /home/build/l

Re: [PATCH] x86/mm: fix regression with huge pages on PAE

2015-11-27 Thread Ingo Molnar
* Kirill A. Shutemov wrote: > On Tue, Nov 24, 2015 at 09:59:27AM -0500, Boris Ostrovsky wrote: > > On 11/12/2015 04:00 AM, Kirill A. Shutemov wrote: > > >On Thu, Nov 12, 2015 at 09:54:18AM +0100, Ingo Molnar wrote: > > >>* Kirill A. Shutemov wrote: > > >> > > >>>diff --git a/arch/x86/include/as

Re: [PATCH] x86/mm: fix regression with huge pages on PAE

2015-11-25 Thread Borislav Petkov
On Tue, Nov 24, 2015 at 10:14:49PM +0200, Kirill A. Shutemov wrote: > I haven't seen any actionable objections to the updated patch. > Not sure why it's not applied. It is now. Thanks. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. -- To unsubscribe from this list:

Re: [PATCH] x86/mm: fix regression with huge pages on PAE

2015-11-24 Thread Kirill A. Shutemov
On Tue, Nov 24, 2015 at 09:59:27AM -0500, Boris Ostrovsky wrote: > On 11/12/2015 04:00 AM, Kirill A. Shutemov wrote: > >On Thu, Nov 12, 2015 at 09:54:18AM +0100, Ingo Molnar wrote: > >>* Kirill A. Shutemov wrote: > >> > >>>diff --git a/arch/x86/include/asm/page_types.h > >>>b/arch/x86/include/asm

Re: [PATCH] x86/mm: fix regression with huge pages on PAE

2015-11-24 Thread Boris Ostrovsky
On 11/12/2015 04:00 AM, Kirill A. Shutemov wrote: On Thu, Nov 12, 2015 at 09:54:18AM +0100, Ingo Molnar wrote: * Kirill A. Shutemov wrote: diff --git a/arch/x86/include/asm/page_types.h b/arch/x86/include/asm/page_types.h index c5b7fb2774d0..cc071c6f7d4d 100644 --- a/arch/x86/include/asm/pag

Re: [PATCH] x86/mm: fix regression with huge pages on PAE

2015-11-13 Thread Dan Williams
On Thu, Nov 12, 2015 at 11:29 AM, Linus Torvalds wrote: > On Thu, Nov 12, 2015 at 12:00 AM, Ingo Molnar wrote: [..] > I have this dim memory of us playing around with just making PAGE_SIZE > (and thus PAGE_MASK) always be signed, but that it caused other > problems. Signed types have downsides to

Re: [PATCH] x86/mm: fix regression with huge pages on PAE

2015-11-12 Thread Linus Torvalds
On Thu, Nov 12, 2015 at 12:00 AM, Ingo Molnar wrote: > > So we already have PHYSICAL_PAGE_MASK, why not introduce PHYSICAL_PMD_MASK et > al, > instead of uglifying the code? I think that's the right thing here. > But, what problems do you expect with having a wider mask than its primary > usag

Re: [PATCH] x86/mm: fix regression with huge pages on PAE

2015-11-12 Thread Ingo Molnar
* Kirill A. Shutemov wrote: > On Thu, Nov 12, 2015 at 09:54:18AM +0100, Ingo Molnar wrote: > > > > * Kirill A. Shutemov wrote: > > > > > diff --git a/arch/x86/include/asm/page_types.h > > > b/arch/x86/include/asm/page_types.h > > > index c5b7fb2774d0..cc071c6f7d4d 100644 > > > --- a/arch/x86

Re: [PATCH] x86/mm: fix regression with huge pages on PAE

2015-11-12 Thread Kirill A. Shutemov
On Thu, Nov 12, 2015 at 09:54:18AM +0100, Ingo Molnar wrote: > > * Kirill A. Shutemov wrote: > > > diff --git a/arch/x86/include/asm/page_types.h > > b/arch/x86/include/asm/page_types.h > > index c5b7fb2774d0..cc071c6f7d4d 100644 > > --- a/arch/x86/include/asm/page_types.h > > +++ b/arch/x86/in

Re: [PATCH] x86/mm: fix regression with huge pages on PAE

2015-11-12 Thread Ingo Molnar
* Kirill A. Shutemov wrote: > > But, what problems do you expect with having a wider mask than its primary > > usage? > > If it's used for 32-bit values it will be truncated down safely. (But I > > have not > > tested it, so I might be missing some complication.) > > Yeah, I basically worry

Re: [PATCH] x86/mm: fix regression with huge pages on PAE

2015-11-12 Thread Ingo Molnar
* Kirill A. Shutemov wrote: > diff --git a/arch/x86/include/asm/page_types.h > b/arch/x86/include/asm/page_types.h > index c5b7fb2774d0..cc071c6f7d4d 100644 > --- a/arch/x86/include/asm/page_types.h > +++ b/arch/x86/include/asm/page_types.h > @@ -9,19 +9,21 @@ > #define PAGE_SIZE(_AC(1,UL)

Re: [PATCH] x86/mm: fix regression with huge pages on PAE

2015-11-12 Thread Kirill A. Shutemov
not > tested it, so I might be missing some complication.) Yeah, I basically worry about non realized side effect. And these masks are defined via {PMD,PUD}_PAGE_SIZE. Should we change them to 'unsigned long long' too or leave alone? What about PAGE_SIZE and PAGE_MASK? Need to be conv

Re: [PATCH] x86/mm: fix regression with huge pages on PAE

2015-11-12 Thread Ingo Molnar
* Kirill A. Shutemov wrote: > On Thu, Nov 12, 2015 at 08:48:54AM +0100, Ingo Molnar wrote: > > > > * Borislav Petkov wrote: > > > > > --- a/arch/x86/include/asm/pgtable_types.h > > > +++ b/arch/x86/include/asm/pgtable_types.h > > > @@ -279,17 +279,14 @@ static inline pmdval_t native_pmd_val(p

Re: [PATCH] x86/mm: fix regression with huge pages on PAE

2015-11-11 Thread Kirill A. Shutemov
On Thu, Nov 12, 2015 at 08:48:54AM +0100, Ingo Molnar wrote: > > * Borislav Petkov wrote: > > > --- a/arch/x86/include/asm/pgtable_types.h > > +++ b/arch/x86/include/asm/pgtable_types.h > > @@ -279,17 +279,14 @@ static inline pmdval_t native_pmd_val(pmd_t pmd) > > static inline pudval_t pud_pfn

Re: [PATCH] x86/mm: fix regression with huge pages on PAE

2015-11-11 Thread Ingo Molnar
* Borislav Petkov wrote: > --- a/arch/x86/include/asm/pgtable_types.h > +++ b/arch/x86/include/asm/pgtable_types.h > @@ -279,17 +279,14 @@ static inline pmdval_t native_pmd_val(pmd_t pmd) > static inline pudval_t pud_pfn_mask(pud_t pud) > { > if (native_pud_val(pud) & _PAGE_PSE) > -

Re: [PATCH] x86/mm: fix regression with huge pages on PAE

2015-11-11 Thread Borislav Petkov
ended up committing: --- From: "Kirill A. Shutemov" Date: Tue, 10 Nov 2015 01:18:10 +0200 Subject: [PATCH] x86/mm: Fix regression with huge pages on PAE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Recent PAT patchset has caused issue on 32-bit PAE

Re: [PATCH] x86/mm: fix regression with huge pages on PAE

2015-11-10 Thread Borislav Petkov
On Tue, Nov 10, 2015 at 05:07:13PM +0200, Kirill A. Shutemov wrote: > Yeah. Looks good to me. It gets even cleaner. Let me run it through the *config build tests. --- diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h index 0033e96c3f09..9011a88353de 100644 --- a/arch/x86/boot/boot.h +++ b/

Re: [PATCH] x86/mm: fix regression with huge pages on PAE

2015-11-10 Thread Kirill A. Shutemov
On Tue, Nov 10, 2015 at 03:46:48PM +0100, Borislav Petkov wrote: > On Tue, Nov 10, 2015 at 03:53:03PM +0200, Kirill A. Shutemov wrote: > > Oh.. pmdval_t/pudval_t is 'unsinged long' on 64 bit. But realmode code > > uses -m16 which makes 'unsigned long' 32-bit therefore truncation warning. > > > > T

Re: [PATCH] x86/mm: fix regression with huge pages on PAE

2015-11-10 Thread Borislav Petkov
On Tue, Nov 10, 2015 at 03:53:03PM +0200, Kirill A. Shutemov wrote: > Oh.. pmdval_t/pudval_t is 'unsinged long' on 64 bit. But realmode code > uses -m16 which makes 'unsigned long' 32-bit therefore truncation warning. > > These helpers not really used in realmode code. Hrrm, yeah, that's just the

Re: [PATCH] x86/mm: fix regression with huge pages on PAE

2015-11-10 Thread Kirill A. Shutemov
On Tue, Nov 10, 2015 at 01:34:29PM +0100, Borislav Petkov wrote: > On Tue, Nov 10, 2015 at 01:18:10AM +0200, Kirill A. Shutemov wrote: > > diff --git a/arch/x86/include/asm/pgtable_types.h > > b/arch/x86/include/asm/pgtable_types.h > > index dd5b0aa9dd2f..c1e797266ce9 100644 > > --- a/arch/x86/inc

Re: [PATCH] x86/mm: fix regression with huge pages on PAE

2015-11-10 Thread Borislav Petkov
On Tue, Nov 10, 2015 at 01:18:10AM +0200, Kirill A. Shutemov wrote: > diff --git a/arch/x86/include/asm/pgtable_types.h > b/arch/x86/include/asm/pgtable_types.h > index dd5b0aa9dd2f..c1e797266ce9 100644 > --- a/arch/x86/include/asm/pgtable_types.h > +++ b/arch/x86/include/asm/pgtable_types.h > @@

Re: [PATCH] x86/mm: fix regression with huge pages on PAE

2015-11-09 Thread Toshi Kani
On Tue, 2015-11-10 at 01:57 +0200, Kirill A. Shutemov wrote: > On Mon, Nov 09, 2015 at 04:43:11PM -0700, Toshi Kani wrote: > > On Tue, 2015-11-10 at 01:18 +0200, Kirill A. Shutemov wrote: > > > Recent PAT patchset has caused issue on 32-bit PAE machines: > > : > > > The problem is in pmd_pfn_mask(

Re: [PATCH] x86/mm: fix regression with huge pages on PAE

2015-11-09 Thread Kirill A. Shutemov
On Mon, Nov 09, 2015 at 04:43:11PM -0700, Toshi Kani wrote: > On Tue, 2015-11-10 at 01:18 +0200, Kirill A. Shutemov wrote: > > Recent PAT patchset has caused issue on 32-bit PAE machines: > : > > The problem is in pmd_pfn_mask() and pmd_flags_mask(). These helpers use > > PMD_PAGE_MASK to calculat

Re: [PATCH] x86/mm: fix regression with huge pages on PAE

2015-11-09 Thread Toshi Kani
On Tue, 2015-11-10 at 01:18 +0200, Kirill A. Shutemov wrote: > Recent PAT patchset has caused issue on 32-bit PAE machines: : > The problem is in pmd_pfn_mask() and pmd_flags_mask(). These helpers use > PMD_PAGE_MASK to calculate resulting mask. PMD_PAGE_MASK is 'unsigned > long', not 'unsigned lo

[PATCH] x86/mm: fix regression with huge pages on PAE

2015-11-09 Thread Kirill A. Shutemov
Recent PAT patchset has caused issue on 32-bit PAE machines: [8.905943] page:eea45000 count:0 mapcount:-128 mapping: (null) index:0x0 [8.913041] flags: 0x4000() [8.916293] page dumped because: VM_BUG_ON_PAGE(page_mapcount(page) < 0) [8.923204] [ cut here ]-