.\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" Copyright 2003 Andries E. Brouwer (aeb@cwi.nl) .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" .\" Japanese Version Copyright (c) 2004 Yuichi SATO .\" all rights reserved. .\" Translated 2004-06-06, Yuichi SATO .\" Updated 2007-06-11, Akihiro MOTOKI , LDP v2.54 .\" .\"WORD: huge page ヒュージページ .\" .TH ALLOC_HUGEPAGES 2 2007-05-31 "Linux" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O alloc_hugepages, free_hugepages \- allocate or free huge pages alloc_hugepages, free_hugepages \- 大きなサイズのページの割り当てと解放を行う .\"O .SH SYNOPSIS .SH 書式 .nf .BI "void *alloc_hugepages(int " key ", void *" addr ", size_t " len , .BI " int " prot ", int " flag ); .\" asmlinkage unsigned long sys_alloc_hugepages(int key, unsigned long addr, .\" unsigned long len, int prot, int flag); .sp .BI "int free_hugepages(void *" addr ); .\" asmlinkage int sys_free_hugepages(unsigned long addr); .fi .\"O .SH DESCRIPTION .SH 説明 .\"O The system calls .\"O .BR alloc_hugepages () .\"O and .\"O .BR free_hugepages () .\"O were introduced in Linux 2.5.36 and removed again in 2.5.54. システムコール .BR alloc_hugepages () と .BR free_hugepages () は Linux 2.5.36 で導入され、2.5.54 で再び削除された。 .\"O They existed only on i386 and ia64 (when built with .\"O .BR CONFIG_HUGETLB_PAGE ). これらのシステムコールは i386 と ia64 のみで (かつ .B CONFIG_HUGETLB_PAGE を指定してビルドされた場合に) 存在する。 .\"O In Linux 2.4.20 the syscall numbers exist, .\"O but the calls fail with the error .\"O .BR ENOSYS . Linux 2.4.20 では syscall 番号が存在するが、 呼び出すとエラー .B ENOSYS で失敗する。 .LP .\"O On i386 the memory management hardware knows about ordinary pages (4 KiB) .\"O and huge pages (2 or 4 MiB). .\"O Similarly ia64 knows about huge pages of .\"O several sizes. .\"O These system calls serve to map huge pages into the .\"O process's memory or to free them again. i386 では、メモリ管理ハードウェアは通常のページ (4 KiB) と 大きなサイズのページ (以下、ヒュージページ; 2MiB または 4 MiB) を 扱うことができる。 同様に、ia64 もいくつかのサイズのヒュージページを扱うことができる。 これらのシステムコールは、ヒュージページをプロセスのメモリにマップしたり、 再び解放したりする。 .\"O Huge pages are locked into memory, and are not swapped. ヒュージページはメモリ内にロックされ、スワップされない。 .LP .\"O The .\"O .I key .\"O argument is an identifier. .\"O When zero the pages are private, and .\"O not inherited by children. .I key 引き数は識別子である。 0 の場合、ページは非公開になり、子プロセスに継承されない。 .\"O When positive the pages are shared with other applications using the same .\"O .IR key , .\"O and inherited by child processes. 正の場合、ページは同じ .I key を使う他のアプリケーションと共有され、子プロセスに継承される。 .LP .\"O The .\"O .I addr .\"O argument of .\"O .BR free_hugepages () .\"O tells which page is being freed: it was the return value of a .\"O call to .\"O .BR alloc_hugepages (). .\"O (The memory is first actually freed when all users have released it.) .BR free_hugepages () の .I addr 引き数は、どのページを解放するかを指定する: .I addr は .BR alloc_hugepages () の呼び出しの返り値である (全てのユーザがメモリを解放したときに、 そのメモリは初めて実際に解放される)。 .\"O The .\"O .I addr .\"O argument of .\"O .BR alloc_hugepages () .\"O is a hint, that the kernel may or may not follow. .BR alloc_hugepages () の .I addr 引き数はヒントであり、カーネルはそれに従うかもしれないし、 従わないかもしれない。 .\"O Addresses must be properly aligned. アドレスは正しく配置されなければならない。 .LP .\"O The .\"O .I len .\"O argument is the length of the required segment. .\"O It must be a multiple of the huge page size. .I len 引き数は要求されたセグメントの長さである。 これはヒュージページのサイズの倍数にしなければならない。 .LP .\"O The .\"O .I prot .\"O argument specifies the memory protection of the segment. .\"O It is one of .\"O .BR PROT_READ , .\"O .BR PROT_WRITE , .\"O .BR PROT_EXEC . .I prot 引き数はセグメントのメモリ保護を指定する。 これは .BR PROT_READ , .BR PROT_WRITE , .B PROT_EXEC のいずれかである。 .LP .\"O The .\"O .I flag .\"O argument is ignored, unless .\"O .I key .\"O is positive. .\"O In that case, if .\"O .I flag .\"O is .\"O .BR IPC_CREAT , .\"O then a new huge page segment is created when none .\"O with the given key existed. .\"O If this flag is not set, then .\"O .B ENOENT .\"O is returned when no segment with the given key exists. .I key が正でない限り、 .I flag 引き数は無視される。 .I key が正で、かつ .I flag が .B IPC_CREAT であり、かつ指定された .I key で (セグメントが) 何も存在しない場合、 新しいヒュージページセグメントが作成される。 .I flag が設定されておらず、かつ指定された .I key のセグメントが存在しない場合、 .B ENOENT が返される。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O On success, .\"O .BR alloc_hugepages () .\"O returns the allocated virtual address, and .\"O .BR free_hugepages () .\"O returns zero. .\"O On error, \-1 is returned, and .\"O .I errno .\"O is set appropriately. 成功した場合、 .BR alloc_hugepages () は割り当てられた仮想アドレスを返し、 .BR free_hugepages () は 0 を返す。 失敗した場合、\-1 を返し、 .I errno が適切に設定される。 .\"O .SH ERRORS .SH エラー .TP .B ENOSYS .\"O The system call is not supported on this kernel. このシステムコールはカーネルでサポートされていない。 .\"O .SH FILES .SH ファイル .TP .I /proc/sys/vm/nr_hugepages .\"O Number of configured hugetlb pages. .\"O This can be read and written. 設定された hugetlb ページの数。 このファイルは読み書きできる。 .TP .I /proc/meminfo .\"O Gives info on the number of configured hugetlb pages and on their size .\"O in the three variables HugePages_Total, HugePages_Free, Hugepagesize. 設定された hugetlb ページの数と、 3 つの変数 HugePages_Total, HugePages_Free, Hugepagesize の サイズについての情報を提供する。 .\"O .SH "CONFORMING TO" .SH 準拠 .\"O These calls are specific to Linux on Intel processors, and should not be .\"O used in programs intended to be portable. このシステムコールは Intel プロセッサ上の Linux に固有のものであり、 移植性が必要なプログラムで使うべきでない。 .\"O .SH NOTES .SH 注意 .\"O These system calls are gone; .\"O they existed only in Linux 2.5.36 through to 2.5.54. .\"O Now the hugetlbfs file system can be used instead. .\"O Memory backed by huge pages (if the CPU supports them) is obtained by .\"O using .\"O .BR mmap (2) .\"O to map files in this virtual file system. これらのシステムコールはなくなった。 これらは Linux 2.5.36 から 2.5.54 にのみ存在する。 代わりに今は hugetlbfs ファイルシステムを使うことができる。 (CPU がサポートしている場合) ヒュージページを持つメモリは、 .BR mmap (2) を使ってこの仮想ファイルシステムでファイルをマップすることで取得できる。 .LP .\"O The maximal number of huge pages can be specified using the .\"O .B hugepages= .\"O boot parameter. ヒュージページの最大数は、 .B hugepages= 起動パラメータを使って指定できる。 .\"O .\"O .\" requires CONFIG_HUGETLB_PAGE (under "Processor type and features") .\"O .\" and CONFIG_HUGETLBFS (under "Filesystems"). .\" ("Processor type and features" 以下の) CONFIG_HUGETLB_PAGE .\" ("Filesystems" 以下の).CONFIG_HUGETLBFS が必要である。 .\" mount -t hugetlbfs hugetlbfs /huge .\" SHM_HUGETLB