Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1276553 > unrolled thread

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

Started byBoris Ostrovsky <boris.ostrovsky@oracle.com>
First post2015-11-24 16:10 +0100
Last post2015-11-27 11:20 +0100
Articles 4 — 4 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] x86/mm: fix regression with huge pages on PAE Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2015-11-24 16:10 +0100
    Re: [PATCH] x86/mm: fix regression with huge pages on PAE "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-11-24 21:20 +0100
      Re: [PATCH] x86/mm: fix regression with huge pages on PAE Borislav Petkov <bp@alien8.de> - 2015-11-25 11:30 +0100
      Re: [PATCH] x86/mm: fix regression with huge pages on PAE Ingo Molnar <mingo@kernel.org> - 2015-11-27 11:20 +0100

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

FromBoris Ostrovsky <boris.ostrovsky@oracle.com>
Date2015-11-24 16:10 +0100
SubjectRe: [PATCH] x86/mm: fix regression with huge pages on PAE
Message-ID<qynoe-1lP-19@gated-at.bofh.it>
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 <kirill.shutemov@linux.intel.com> 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


Kirill, where are we with this patch?

-boris

>>> @@ -9,19 +9,21 @@
>>>   #define PAGE_SIZE	(_AC(1,UL) << PAGE_SHIFT)
>>>   #define PAGE_MASK	(~(PAGE_SIZE-1))
>>>   
>>> +#define PMD_PAGE_SIZE		(_AC(1, UL) << PMD_SHIFT)
>>> +#define PMD_PAGE_MASK		(~(PMD_PAGE_SIZE-1))
>>> +
>>> +#define PUD_PAGE_SIZE		(_AC(1, UL) << PUD_SHIFT)
>>> +#define PUD_PAGE_MASK		(~(PUD_PAGE_SIZE-1))
>>> +
>>>   #define __PHYSICAL_MASK		((phys_addr_t)((1ULL << __PHYSICAL_MASK_SHIFT) - 1))
>>>   #define __VIRTUAL_MASK		((1UL << __VIRTUAL_MASK_SHIFT) - 1)
>>>   
>>> -/* Cast PAGE_MASK to a signed type so that it is sign-extended if
>>> +/* Cast *PAGE_MASK to a signed type so that it is sign-extended if
>>>      virtual addresses are 32-bits but physical addresses are larger
>>>      (ie, 32-bit PAE). */
>>>   #define PHYSICAL_PAGE_MASK	(((signed long)PAGE_MASK) & __PHYSICAL_MASK)
>>> -
>>> -#define PMD_PAGE_SIZE		(_AC(1, UL) << PMD_SHIFT)
>>> -#define PMD_PAGE_MASK		(~(PMD_PAGE_SIZE-1))
>>> -
>>> -#define PUD_PAGE_SIZE		(_AC(1, UL) << PUD_SHIFT)
>>> -#define PUD_PAGE_MASK		(~(PUD_PAGE_SIZE-1))
>>> +#define PHYSICAL_PMD_PAGE_MASK	(((signed long)PMD_PAGE_MASK) & __PHYSICAL_MASK)
>>> +#define PHYSICAL_PUD_PAGE_MASK	(((signed long)PUD_PAGE_MASK) & __PHYSICAL_MASK)
>> that's a really odd way of writing it, 'long' is signed by default ...
> See the comment above (it was there before the patch). 'signed' can be
> considered as documentation -- we want sign-extension here.
>
>> There seems to be 150+ such cases in the kernel source though - weird.
>>
>> More importantly, how does this improve things on 32-bit PAE kernels? If I follow
>> the values correctly then PMD_PAGE_MASK is 'UL' i.e. 32-bit:
>>
>>> +#define PMD_PAGE_SIZE                (_AC(1, UL) << PMD_SHIFT)
>>> +#define PMD_PAGE_MASK                (~(PMD_PAGE_SIZE-1))
>> thus PHYSICAL_PMD_PAGE_MASK is 32-bit too:
>>
>>> +#define PHYSICAL_PMD_PAGE_MASK       (((signed long)PMD_PAGE_MASK) & __PHYSICAL_MASK)
>> so how is the bug fixed?
> Again, see the comment.
> I've checked that it generates correct value (using kernel/bounds.c).
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1276742

From"Kirill A. Shutemov" <kirill@shutemov.name>
Date2015-11-24 21:20 +0100
Message-ID<qysee-4rc-13@gated-at.bofh.it>
In reply to#1276553
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 <kirill.shutemov@linux.intel.com> 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
> 
> 
> Kirill, where are we with this patch?

I haven't seen any actionable objections to the updated patch.
Not sure why it's not applied.

-- 
 Kirill A. Shutemov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1277168

FromBorislav Petkov <bp@alien8.de>
Date2015-11-25 11:30 +0100
Message-ID<qyFuP-4Xh-29@gated-at.bofh.it>
In reply to#1276742
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: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1278698

FromIngo Molnar <mingo@kernel.org>
Date2015-11-27 11:20 +0100
Message-ID<qzoie-1vq-7@gated-at.bofh.it>
In reply to#1276742
* Kirill A. Shutemov <kirill@shutemov.name> 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 <kirill.shutemov@linux.intel.com> 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
> > 
> > 
> > Kirill, where are we with this patch?
> 
> I haven't seen any actionable objections to the updated patch.
> Not sure why it's not applied.

So I think that happened because you did not change the subject line to a new, 
fresh one, that indicates it's a patch intended to be applied.

Patches sent inside existing discussions, under the same subject, tend to be 
test-only or discussion-only patches, to be submitted for real, in 95% of the 
cases.

Thanks,

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web