1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" Copyright 2003 Andries E. Brouwer (aeb@cwi.nl)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
26 .\" Japanese Version Copyright (c) 2004 Yuichi SATO
27 .\" all rights reserved.
28 .\" Translated 2004-06-06, Yuichi SATO <ysato444@yahoo.co.jp>
29 .\" Updated 2007-06-11, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.54
31 .\"WORD: huge page ヒュージページ
33 .TH ALLOC_HUGEPAGES 2 2007-05-31 "Linux" "Linux Programmer's Manual"
35 alloc_hugepages, free_hugepages \- 大きなサイズのページの割り当てと解放を行う
38 .BI "void *alloc_hugepages(int " key ", void *" addr ", size_t " len ,
39 .BI " int " prot ", int " flag );
40 .\" asmlinkage unsigned long sys_alloc_hugepages(int key, unsigned long addr,
41 .\" unsigned long len, int prot, int flag);
43 .BI "int free_hugepages(void *" addr );
44 .\" asmlinkage int sys_free_hugepages(unsigned long addr);
48 .BR alloc_hugepages ()
51 は Linux 2.5.36 で導入され、2.5.54 で再び削除された。
52 これらのシステムコールは i386 と ia64 のみで
54 .B CONFIG_HUGETLB_PAGE
56 Linux 2.4.20 では syscall 番号が存在するが、
61 i386 では、メモリ管理ハードウェアは通常のページ (4 KiB) と
62 大きなサイズのページ (以下、ヒュージページ; 2MiB または 4 MiB) を
64 同様に、ia64 もいくつかのサイズのヒュージページを扱うことができる。
65 これらのシステムコールは、ヒュージページをプロセスのメモリにマップしたり、
67 ヒュージページはメモリ内にロックされ、スワップされない。
71 0 の場合、ページは非公開になり、子プロセスに継承されない。
74 を使う他のアプリケーションと共有され、子プロセスに継承される。
79 引き数は、どのページを解放するかを指定する:
82 .BR alloc_hugepages ()
86 .BR alloc_hugepages ()
89 引き数はヒントであり、カーネルはそれに従うかもしれないし、
95 これはヒュージページのサイズの倍数にしなければならない。
116 で (セグメントが) 何も存在しない場合、
117 新しいヒュージページセグメントが作成される。
126 .BR alloc_hugepages ()
128 .BR free_hugepages ()
136 このシステムコールはカーネルでサポートされていない。
139 .I /proc/sys/vm/nr_hugepages
144 設定された hugetlb ページの数と、
145 3 つの変数 HugePages_Total, HugePages_Free, Hugepagesize の
148 このシステムコールは Intel プロセッサ上の Linux に固有のものであり、
149 移植性が必要なプログラムで使うべきでない。
152 これらは Linux 2.5.36 から 2.5.54 にのみ存在する。
153 代わりに今は hugetlbfs ファイルシステムを使うことができる。
154 (CPU がサポートしている場合) ヒュージページを持つメモリは、
156 を使ってこの仮想ファイルシステムでファイルをマップすることで取得できる。
161 .\" ("Processor type and features" 以下の) CONFIG_HUGETLB_PAGE
162 .\" ("Filesystems" 以下の).CONFIG_HUGETLBFS が必要である。
163 .\" mount -t hugetlbfs hugetlbfs /huge