Re: [PATCH] mm: Introduce GFP_PGTABLE

2019-01-15 Thread Anshuman Khandual
On 01/14/2019 12:31 PM, Michal Hocko wrote: > On Mon 14-01-19 09:30:55, Anshuman Khandual wrote: >> >> >> On 01/13/2019 11:05 PM, Michal Hocko wrote: >>> On Sat 12-01-19 15:56:38, Anshuman Khandual wrote: All architectures have been defining their own PGALLOC_GFP as (GFP_KERNEL | __GFP

Re: [PATCH] mm: Introduce GFP_PGTABLE

2019-01-13 Thread Michal Hocko
On Mon 14-01-19 09:30:55, Anshuman Khandual wrote: > > > On 01/13/2019 11:05 PM, Michal Hocko wrote: > > On Sat 12-01-19 15:56:38, Anshuman Khandual wrote: > >> All architectures have been defining their own PGALLOC_GFP as (GFP_KERNEL | > >> __GFP_ZERO) and using it for allocating page table page

Re: [PATCH] mm: Introduce GFP_PGTABLE

2019-01-13 Thread Anshuman Khandual
On 01/12/2019 09:19 PM, Matthew Wilcox wrote: > On Sat, Jan 12, 2019 at 02:49:29PM +0100, Christophe Leroy wrote: >> As far as I can see, >> >> #define GFP_KERNEL_ACCOUNT (GFP_KERNEL | __GFP_ACCOUNT) >> >> So what's the difference between: >> >> (GFP_KERNEL_ACCOUNT | __GFP_ZERO) & ~__GFP_ACCOUNT

Re: [PATCH] mm: Introduce GFP_PGTABLE

2019-01-13 Thread Anshuman Khandual
On 01/12/2019 10:18 PM, Shakeel Butt wrote: >> --- a/arch/x86/kernel/espfix_64.c >> +++ b/arch/x86/kernel/espfix_64.c >> @@ -57,8 +57,6 @@ >> # error "Need more virtual address space for the ESPFIX hack" >> #endif >> >> -#define PGALLOC_GFP (GFP_KERNEL | __GFP_ZERO) >> - >> /* This contains t

Re: [PATCH] mm: Introduce GFP_PGTABLE

2019-01-13 Thread Anshuman Khandual
On 01/13/2019 11:05 PM, Michal Hocko wrote: > On Sat 12-01-19 15:56:38, Anshuman Khandual wrote: >> All architectures have been defining their own PGALLOC_GFP as (GFP_KERNEL | >> __GFP_ZERO) and using it for allocating page table pages. This causes some >> code duplication which can be easily av

Re: [PATCH] mm: Introduce GFP_PGTABLE

2019-01-13 Thread Michal Hocko
On Sat 12-01-19 15:56:38, Anshuman Khandual wrote: > All architectures have been defining their own PGALLOC_GFP as (GFP_KERNEL | > __GFP_ZERO) and using it for allocating page table pages. This causes some > code duplication which can be easily avoided. GFP_KERNEL allocated and > cleared out pages

Re: [PATCH] mm: Introduce GFP_PGTABLE

2019-01-12 Thread Matthew Wilcox
On Sat, Jan 12, 2019 at 02:49:29PM +0100, Christophe Leroy wrote: > As far as I can see, > > #define GFP_KERNEL_ACCOUNT (GFP_KERNEL | __GFP_ACCOUNT) > > So what's the difference between: > > (GFP_KERNEL_ACCOUNT | __GFP_ZERO) & ~__GFP_ACCOUNT > > and > > (GFP_KERNEL | __GFP_ZERO) & ~__GFP_ACCOU

Re: [PATCH] mm: Introduce GFP_PGTABLE

2019-01-12 Thread Christophe Leroy
Le 12/01/2019 à 13:12, Matthew Wilcox a écrit : On Sat, Jan 12, 2019 at 03:56:38PM +0530, Anshuman Khandual wrote: All architectures have been defining their own PGALLOC_GFP as (GFP_KERNEL | __GFP_ZERO) and using it for allocating page table pages. Except that's not true. +++ b/arch/x86/m

Re: [PATCH] mm: Introduce GFP_PGTABLE

2019-01-12 Thread Anshuman Khandual
On 01/12/2019 05:42 PM, Matthew Wilcox wrote: > On Sat, Jan 12, 2019 at 03:56:38PM +0530, Anshuman Khandual wrote: >> All architectures have been defining their own PGALLOC_GFP as (GFP_KERNEL | >> __GFP_ZERO) and using it for allocating page table pages. > > Except that's not true. > >> +++ b/

Re: [PATCH] mm: Introduce GFP_PGTABLE

2019-01-12 Thread Matthew Wilcox
On Sat, Jan 12, 2019 at 03:56:38PM +0530, Anshuman Khandual wrote: > All architectures have been defining their own PGALLOC_GFP as (GFP_KERNEL | > __GFP_ZERO) and using it for allocating page table pages. Except that's not true. > +++ b/arch/x86/mm/pgtable.c > @@ -13,19 +13,17 @@ phys_addr_t phys

[PATCH] mm: Introduce GFP_PGTABLE

2019-01-12 Thread Anshuman Khandual
All architectures have been defining their own PGALLOC_GFP as (GFP_KERNEL | __GFP_ZERO) and using it for allocating page table pages. This causes some code duplication which can be easily avoided. GFP_KERNEL allocated and cleared out pages (__GFP_ZERO) are required for page tables on any given arch