Skip to content

Commit 15610c8

Browse files
Davidlohr Buesotorvalds
authored andcommitted
hugepage: mention libhugetlbfs in doc
Explicitly mention/recommend using the libhugetlbfs test cases when changing related kernel code. Developers that are unaware of the project can easily miss this and introduce potential regressions that may or may not be caught by community review. Also do some cleanups that make the document visually easier to view at a first glance. Signed-off-by: Davidlohr Bueso <davidlohr@hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 2cad401 commit 15610c8

1 file changed

Lines changed: 12 additions & 13 deletions

File tree

‎Documentation/vm/hugetlbpage.txt‎

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ which function as described above for the default huge page-sized case.
165165

166166

167167
Interaction of Task Memory Policy with Huge Page Allocation/Freeing
168+
===================================================================
168169

169170
Whether huge pages are allocated and freed via the /proc interface or
170171
the /sysfs interface using the nr_hugepages_mempolicy attribute, the NUMA
@@ -229,6 +230,7 @@ resulting effect on persistent huge page allocation is as follows:
229230
of huge pages over all on-lines nodes with memory.
230231

231232
Per Node Hugepages Attributes
233+
=============================
232234

233235
A subset of the contents of the root huge page control directory in sysfs,
234236
described above, will be replicated under each the system device of each
@@ -258,6 +260,7 @@ applied, from which node the huge page allocation will be attempted.
258260

259261

260262
Using Huge Pages
263+
================
261264

262265
If the user applications are going to request huge pages using mmap system
263266
call, then it is required that system administrator mount a file system of
@@ -296,20 +299,16 @@ calls, though the mount of filesystem will be required for using mmap calls
296299
without MAP_HUGETLB. For an example of how to use mmap with MAP_HUGETLB see
297300
map_hugetlb.c.
298301

299-
*******************************************************************
302+
Examples
303+
========
300304

301-
/*
302-
* map_hugetlb: see tools/testing/selftests/vm/map_hugetlb.c
303-
*/
305+
1) map_hugetlb: see tools/testing/selftests/vm/map_hugetlb.c
304306

305-
*******************************************************************
307+
2) hugepage-shm: see tools/testing/selftests/vm/hugepage-shm.c
306308

307-
/*
308-
* hugepage-shm: see tools/testing/selftests/vm/hugepage-shm.c
309-
*/
309+
3) hugepage-mmap: see tools/testing/selftests/vm/hugepage-mmap.c
310310

311-
*******************************************************************
312-
313-
/*
314-
* hugepage-mmap: see tools/testing/selftests/vm/hugepage-mmap.c
315-
*/
311+
4) The libhugetlbfs (http://libhugetlbfs.sourceforge.net) library provides a
312+
wide range of userspace tools to help with huge page usability, environment
313+
setup, and control. Furthermore it provides useful test cases that should be
314+
used when modifying code to ensure no regressions are introduced.

0 commit comments

Comments
 (0)