linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4]  mm: fix the "counter.sh" failure for libhugetlbfs
@ 2016-12-05  9:17 Huang Shijie
  2016-12-05  9:17 ` [PATCH v3 1/4] mm: hugetlb: rename some allocation functions Huang Shijie
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Huang Shijie @ 2016-12-05  9:17 UTC (permalink / raw)
  To: akpm, catalin.marinas
  Cc: n-horiguchi, mhocko, kirill.shutemov, aneesh.kumar,
	gerald.schaefer, mike.kravetz, linux-mm, will.deacon,
	steve.capper, kaly.xin, nd, linux-arm-kernel, vbabka,
	Huang Shijie

(1) Background
   For the arm64, the hugetlb page size can be 32M (PMD + Contiguous bit).
   In the 4K page environment, the max page order is 10 (max_order - 1),
   so 32M page is the gigantic page.    

   The arm64 MMU supports a Contiguous bit which is a hint that the TTE
   is one of a set of contiguous entries which can be cached in a single
   TLB entry.  Please refer to the arm64v8 mannul :
       DDI0487A_f_armv8_arm.pdf (in page D4-1811)

(2) The bug   
   After I tested the libhugetlbfs, I found the test case "counter.sh"
   will fail with the gigantic page (32M page in arm64 board).

   The counter.sh is just a wrapper for counter.c.
   You can find them in:
       https://github.com/libhugetlbfs/libhugetlbfs/blob/master/tests/counters.c
       https://github.com/libhugetlbfs/libhugetlbfs/blob/master/tests/counters.sh

   The error log shows below:

   ----------------------------------------------------------
        ...........................................
	LD_PRELOAD=libhugetlbfs.so shmoverride_unlinked (32M: 64):	PASS
	LD_PRELOAD=libhugetlbfs.so HUGETLB_SHM=yes shmoverride_unlinked (32M: 64):	PASS
	quota.sh (32M: 64):	PASS
	counters.sh (32M: 64):	FAIL mmap failed: Invalid argument
	********** TEST SUMMARY
	*                      32M           
	*                      32-bit 64-bit 
	*     Total testcases:     0     87   
	*             Skipped:     0      0   
	*                PASS:     0     86   
	*                FAIL:     0      1   
	*    Killed by signal:     0      0   
	*   Bad configuration:     0      0   
	*       Expected FAIL:     0      0   
	*     Unexpected PASS:     0      0   
	* Strange test result:     0      0   
	**********
   ----------------------------------------------------------

   The failure is caused by:
    1) kernel fails to allocate a gigantic page for the surplus case.
       And the gather_surplus_pages() will return NULL in the end.

    2) The condition checks for some functions are wrong:
        return_unused_surplus_pages()
        nr_overcommit_hugepages_store()
        hugetlb_overcommit_handler()
   
   This patch set adds support for gigantic surplus hugetlb pages,
   allowing the counter.sh unit test to pass. 
   Test this patch set with Juno-r1 board.

   	
v2 -- > v3:
   1.) In patch 2, change argument "no_init" to "do_prep" 
   2.) In patch 3, also change alloc_fresh_huge_page().
       In the v2, this patch only changes the alloc_fresh_gigantic_page().  
   3.) Merge old patch #4,#5 into the last one.    
   4.) Follow Babka's suggestion, do the NULL check for @mask.
   5.) others.


v1 -- > v2:
   1.) fix the compiler error in X86.
   2.) add new patches for NUMA.
       The patch #2 ~ #5 are new patches.

Huang Shijie (4):
  mm: hugetlb: rename some allocation functions
  mm: hugetlb: add a new parameter for some functions
  mm: hugetlb: change the return type for some functions
  mm: hugetlb: support gigantic surplus pages

 include/linux/mempolicy.h |   8 +++
 mm/hugetlb.c              | 146 +++++++++++++++++++++++++++++++++++-----------
 mm/mempolicy.c            |  44 ++++++++++++++
 3 files changed, 163 insertions(+), 35 deletions(-)

-- 
2.5.5

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-12-09  9:58 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-05  9:17 [PATCH v3 0/4] mm: fix the "counter.sh" failure for libhugetlbfs Huang Shijie
2016-12-05  9:17 ` [PATCH v3 1/4] mm: hugetlb: rename some allocation functions Huang Shijie
2016-12-05  9:17 ` [PATCH v3 2/4] mm: hugetlb: add a new parameter for some functions Huang Shijie
2016-12-05  9:17 ` [PATCH v3 3/4] mm: hugetlb: change the return type " Huang Shijie
2016-12-05  9:17 ` [PATCH v3 4/4] mm: hugetlb: support gigantic surplus pages Huang Shijie
2016-12-05  9:31 ` [PATCH v3 0/4] mm: fix the "counter.sh" failure for libhugetlbfs Michal Hocko
2016-12-06 10:03   ` Huang Shijie
2016-12-07 15:02     ` Michal Hocko
2016-12-08  9:36       ` Huang Shijie
2016-12-08  9:52         ` Michal Hocko
2016-12-09  9:58           ` Huang Shijie
2016-12-07  8:46   ` Huang Shijie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).