hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/Documentation/admin-guide/mm/hugetlbpage.rst
....@@ -100,6 +100,52 @@
100100 be specified in bytes with optional scale suffix [kKmMgG]. The default huge
101101 page size may be selected with the "default_hugepagesz=<size>" boot parameter.
102102
103
+Hugetlb boot command line parameter semantics
104
+
105
+hugepagesz
106
+ Specify a huge page size. Used in conjunction with hugepages
107
+ parameter to preallocate a number of huge pages of the specified
108
+ size. Hence, hugepagesz and hugepages are typically specified in
109
+ pairs such as::
110
+
111
+ hugepagesz=2M hugepages=512
112
+
113
+ hugepagesz can only be specified once on the command line for a
114
+ specific huge page size. Valid huge page sizes are architecture
115
+ dependent.
116
+hugepages
117
+ Specify the number of huge pages to preallocate. This typically
118
+ follows a valid hugepagesz or default_hugepagesz parameter. However,
119
+ if hugepages is the first or only hugetlb command line parameter it
120
+ implicitly specifies the number of huge pages of default size to
121
+ allocate. If the number of huge pages of default size is implicitly
122
+ specified, it can not be overwritten by a hugepagesz,hugepages
123
+ parameter pair for the default size.
124
+
125
+ For example, on an architecture with 2M default huge page size::
126
+
127
+ hugepages=256 hugepagesz=2M hugepages=512
128
+
129
+ will result in 256 2M huge pages being allocated and a warning message
130
+ indicating that the hugepages=512 parameter is ignored. If a hugepages
131
+ parameter is preceded by an invalid hugepagesz parameter, it will
132
+ be ignored.
133
+default_hugepagesz
134
+ Specify the default huge page size. This parameter can
135
+ only be specified once on the command line. default_hugepagesz can
136
+ optionally be followed by the hugepages parameter to preallocate a
137
+ specific number of huge pages of default size. The number of default
138
+ sized huge pages to preallocate can also be implicitly specified as
139
+ mentioned in the hugepages section above. Therefore, on an
140
+ architecture with 2M default huge page size::
141
+
142
+ hugepages=256
143
+ default_hugepagesz=2M hugepages=256
144
+ hugepages=256 default_hugepagesz=2M
145
+
146
+ will all result in 256 2M huge pages being allocated. Valid default
147
+ huge page size is architecture dependent.
148
+
103149 When multiple huge page sizes are supported, ``/proc/sys/vm/nr_hugepages``
104150 indicates the current number of pre-allocated huge pages of the default size.
105151 Thus, one can use the following command to dynamically allocate/deallocate