diff mbox

[v2,2/3] powerpc/mm/book(e)(3s)/32: Add page table accounting

Message ID 20170501063438.25237-3-bsingharora@gmail.com (mailing list archive)
State Superseded
Headers show

Commit Message

Balbir Singh May 1, 2017, 6:34 a.m. UTC
Add support in pte_alloc_one() and pgd_alloc() by
passing __GFP_ACCOUNT in the flags

Signed-off-by: Balbir Singh <bsingharora@gmail.com>
---
 arch/powerpc/include/asm/nohash/32/pgalloc.h | 3 ++-
 arch/powerpc/mm/pgtable_32.c                 | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

kernel test robot May 1, 2017, 10:02 a.m. UTC | #1
Hi Balbir,

[auto build test ERROR on powerpc/next]
[also build test ERROR on v4.11 next-20170428]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Balbir-Singh/powerpc-mm-book-e-3s-64-Add-page-table-accounting/20170501-143900
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-virtex5_defconfig (attached as .config)
compiler: powerpc-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=powerpc 

All error/warnings (new ones prefixed by >>):

   In file included from include/linux/mm.h:9:0,
                    from include/linux/cpuset.h:16,
                    from kernel//sched/core.c:13:
   arch/powerpc/include/asm/nohash/32/pgalloc.h: In function 'pgd_alloc':
>> include/linux/gfp.h:240:20: warning: passing argument 1 of 'pgtable_gfp_flags' makes pointer from integer without a cast [-Wint-conversion]
    #define GFP_KERNEL (__GFP_RECLAIM | __GFP_IO | __GFP_FS)
                       ^
>> arch/powerpc/include/asm/nohash/32/pgalloc.h:35:22: note: in expansion of macro 'GFP_KERNEL'
       pgtable_gfp_flags(GFP_KERNEL));
                         ^~~~~~~~~~
   In file included from arch/powerpc/include/asm/tlb.h:19:0,
                    from kernel//sched/core.c:30:
   arch/powerpc/include/asm/pgalloc.h:7:21: note: expected 'struct mm_struct *' but argument is of type 'unsigned int'
    static inline gfp_t pgtable_gfp_flags(struct mm_struct *mm, gfp_t gfp)
                        ^~~~~~~~~~~~~~~~~
   In file included from arch/powerpc/include/asm/nohash/pgalloc.h:21:0,
                    from arch/powerpc/include/asm/pgalloc.h:23,
                    from arch/powerpc/include/asm/tlb.h:19,
                    from kernel//sched/core.c:30:
>> arch/powerpc/include/asm/nohash/32/pgalloc.h:35:4: error: too few arguments to function 'pgtable_gfp_flags'
       pgtable_gfp_flags(GFP_KERNEL));
       ^~~~~~~~~~~~~~~~~
   In file included from arch/powerpc/include/asm/tlb.h:19:0,
                    from kernel//sched/core.c:30:
   arch/powerpc/include/asm/pgalloc.h:7:21: note: declared here
    static inline gfp_t pgtable_gfp_flags(struct mm_struct *mm, gfp_t gfp)
                        ^~~~~~~~~~~~~~~~~

vim +/pgtable_gfp_flags +35 arch/powerpc/include/asm/nohash/32/pgalloc.h

    29				pgtable_cache[(shift) - 1];	\
    30			})
    31	
    32	static inline pgd_t *pgd_alloc(struct mm_struct *mm)
    33	{
    34		return kmem_cache_alloc(PGT_CACHE(PGD_INDEX_SIZE),
  > 35				pgtable_gfp_flags(GFP_KERNEL));
    36	}
    37	
    38	static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
kernel test robot May 1, 2017, 10:31 a.m. UTC | #2
Hi Balbir,

[auto build test ERROR on powerpc/next]
[also build test ERROR on v4.11 next-20170428]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Balbir-Singh/powerpc-mm-book-e-3s-64-Add-page-table-accounting/20170501-143900
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-virtex5_defconfig (attached as .config)
compiler: powerpc-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=powerpc 

All error/warnings (new ones prefixed by >>):

   In file included from arch/powerpc/mm/mem.c:25:0:
   arch/powerpc/include/asm/nohash/32/pgalloc.h: In function 'pgd_alloc':
>> include/linux/gfp.h:240:20: error: passing argument 1 of 'pgtable_gfp_flags' makes pointer from integer without a cast [-Werror=int-conversion]
    #define GFP_KERNEL (__GFP_RECLAIM | __GFP_IO | __GFP_FS)
                       ^
   arch/powerpc/include/asm/nohash/32/pgalloc.h:35:22: note: in expansion of macro 'GFP_KERNEL'
       pgtable_gfp_flags(GFP_KERNEL));
                         ^~~~~~~~~~
   In file included from arch/powerpc/mm/mem.c:40:0:
   arch/powerpc/include/asm/pgalloc.h:7:21: note: expected 'struct mm_struct *' but argument is of type 'unsigned int'
    static inline gfp_t pgtable_gfp_flags(struct mm_struct *mm, gfp_t gfp)
                        ^~~~~~~~~~~~~~~~~
   In file included from arch/powerpc/include/asm/nohash/pgalloc.h:21:0,
                    from arch/powerpc/include/asm/pgalloc.h:23,
                    from arch/powerpc/mm/mem.c:40:
   arch/powerpc/include/asm/nohash/32/pgalloc.h:35:4: error: too few arguments to function 'pgtable_gfp_flags'
       pgtable_gfp_flags(GFP_KERNEL));
       ^~~~~~~~~~~~~~~~~
   In file included from arch/powerpc/mm/mem.c:40:0:
   arch/powerpc/include/asm/pgalloc.h:7:21: note: declared here
    static inline gfp_t pgtable_gfp_flags(struct mm_struct *mm, gfp_t gfp)
                        ^~~~~~~~~~~~~~~~~
   cc1: all warnings being treated as errors
--
   In file included from include/linux/slab.h:14:0,
                    from kernel/fork.c:14:
   arch/powerpc/include/asm/nohash/32/pgalloc.h: In function 'pgd_alloc':
   include/linux/gfp.h:240:20: warning: passing argument 1 of 'pgtable_gfp_flags' makes pointer from integer without a cast [-Wint-conversion]
    #define GFP_KERNEL (__GFP_RECLAIM | __GFP_IO | __GFP_FS)
                       ^
   arch/powerpc/include/asm/nohash/32/pgalloc.h:35:22: note: in expansion of macro 'GFP_KERNEL'
       pgtable_gfp_flags(GFP_KERNEL));
                         ^~~~~~~~~~
   In file included from kernel/fork.c:92:0:
   arch/powerpc/include/asm/pgalloc.h:7:21: note: expected 'struct mm_struct *' but argument is of type 'unsigned int'
    static inline gfp_t pgtable_gfp_flags(struct mm_struct *mm, gfp_t gfp)
                        ^~~~~~~~~~~~~~~~~
   In file included from arch/powerpc/include/asm/nohash/pgalloc.h:21:0,
                    from arch/powerpc/include/asm/pgalloc.h:23,
                    from kernel/fork.c:92:
   arch/powerpc/include/asm/nohash/32/pgalloc.h:35:4: error: too few arguments to function 'pgtable_gfp_flags'
       pgtable_gfp_flags(GFP_KERNEL));
       ^~~~~~~~~~~~~~~~~
   In file included from kernel/fork.c:92:0:
   arch/powerpc/include/asm/pgalloc.h:7:21: note: declared here
    static inline gfp_t pgtable_gfp_flags(struct mm_struct *mm, gfp_t gfp)
                        ^~~~~~~~~~~~~~~~~
   In file included from arch/powerpc/include/asm/nohash/pgalloc.h:21:0,
                    from arch/powerpc/include/asm/pgalloc.h:23,
                    from kernel/fork.c:92:
>> arch/powerpc/include/asm/nohash/32/pgalloc.h:36:1: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^

vim +/pgtable_gfp_flags +240 include/linux/gfp.h

251603549 Vlastimil Babka  2016-07-28  234   *   compound allocations that will generally fail quickly if memory is not
251603549 Vlastimil Babka  2016-07-28  235   *   available and will not wake kswapd/kcompactd on failure. The _LIGHT
251603549 Vlastimil Babka  2016-07-28  236   *   version does not attempt reclaim/compaction at all and is by default used
251603549 Vlastimil Babka  2016-07-28  237   *   in page fault path, while the non-light is used by khugepaged.
d0164adc8 Mel Gorman       2015-11-06  238   */
d0164adc8 Mel Gorman       2015-11-06  239  #define GFP_ATOMIC	(__GFP_HIGH|__GFP_ATOMIC|__GFP_KSWAPD_RECLAIM)
dd56b0464 Mel Gorman       2015-11-06 @240  #define GFP_KERNEL	(__GFP_RECLAIM | __GFP_IO | __GFP_FS)
a9bb7e620 Vladimir Davydov 2016-01-14  241  #define GFP_KERNEL_ACCOUNT (GFP_KERNEL | __GFP_ACCOUNT)
d0164adc8 Mel Gorman       2015-11-06  242  #define GFP_NOWAIT	(__GFP_KSWAPD_RECLAIM)
71baba4b9 Mel Gorman       2015-11-06  243  #define GFP_NOIO	(__GFP_RECLAIM)

:::::: The code at line 240 was first introduced by commit
:::::: dd56b046426760aa0c852ad6e4b6b07891222d65 mm: page_alloc: hide some GFP internals and document the bits and flag combinations

:::::: TO: Mel Gorman <mgorman@techsingularity.net>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
Balbir Singh May 1, 2017, 11:09 a.m. UTC | #3
On Mon, May 1, 2017 at 8:31 PM, kbuild test robot <lkp@intel.com> wrote:
> Hi Balbir,
>
> [auto build test ERROR on powerpc/next]
> [also build test ERROR on v4.11 next-20170428]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>
> url:    https://github.com/0day-ci/linux/commits/Balbir-Singh/powerpc-mm-book-e-3s-64-Add-page-table-accounting/20170501-143900
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
> config: powerpc-virtex5_defconfig (attached as .config)
> compiler: powerpc-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
> reproduce:
>         wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # save the attached .config to linux build tree
>         make.cross ARCH=powerpc
>
> All error/warnings (new ones prefixed by >>):
>
>    In file included from arch/powerpc/mm/mem.c:25:0:
>    arch/powerpc/include/asm/nohash/32/pgalloc.h: In function 'pgd_alloc':
>>> include/linux/gfp.h:240:20: error: passing argument 1 of 'pgtable_gfp_flags' makes pointer from integer without a cast [-Werror=int-conversion]
>     #define GFP_KERNEL (__GFP_RECLAIM | __GFP_IO | __GFP_FS)
>                        ^
>    arch/powerpc/include/asm/nohash/32/pgalloc.h:35:22: note: in expansion of macro 'GFP_KERNEL'
>        pgtable_gfp_flags(GFP_KERNEL));

That's a silly build error that escaped my build scripts, I'll send
out a better v3 with 32 bits fixed.

Balbir
diff mbox

Patch

diff --git a/arch/powerpc/include/asm/nohash/32/pgalloc.h b/arch/powerpc/include/asm/nohash/32/pgalloc.h
index 6331392..1900d9c 100644
--- a/arch/powerpc/include/asm/nohash/32/pgalloc.h
+++ b/arch/powerpc/include/asm/nohash/32/pgalloc.h
@@ -31,7 +31,8 @@  extern struct kmem_cache *pgtable_cache[];
 
 static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 {
-	return kmem_cache_alloc(PGT_CACHE(PGD_INDEX_SIZE), GFP_KERNEL);
+	return kmem_cache_alloc(PGT_CACHE(PGD_INDEX_SIZE),
+			pgtable_gfp_flags(GFP_KERNEL));
 }
 
 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index a65c0b4..dc1e0c2 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -60,7 +60,7 @@  pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
 {
 	struct page *ptepage;
 
-	gfp_t flags = GFP_KERNEL | __GFP_ZERO;
+	gfp_t flags = GFP_KERNEL | __GFP_ZERO | __GFP_ACCOUNT;
 
 	ptepage = alloc_pages(flags, 0);
 	if (!ptepage)