mirror of
https://github.com/clearlinux/clear-linux-documentation.git
synced 2026-08-28 03:16:49 +00:00
183 lines
9.2 KiB
HTML
183 lines
9.2 KiB
HTML
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en" data-content_root="../../">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
|
|
<title>Configure Huge Pages — Documentation for Clear Linux* project</title>
|
|
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
|
|
<link rel="stylesheet" type="text/css" href="../../_static/bizstyle.css?v=5283bb3d" />
|
|
<link rel="stylesheet" type="text/css" href="../../_static/copybutton.css?v=76b2166b" />
|
|
|
|
<script src="../../_static/documentation_options.js?v=5929fcd5"></script>
|
|
<script src="../../_static/doctools.js?v=9bcbadda"></script>
|
|
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
|
|
<script src="../../_static/clipboard.min.js?v=a7894cd8"></script>
|
|
<script src="../../_static/copybutton.js?v=a56c686a"></script>
|
|
<script src="../../_static/bizstyle.js"></script>
|
|
<link rel="canonical" href="https://clearlinux.github.io/clear-linux-documentation/guides/maintenance/configure-hugepages.html" />
|
|
<link rel="icon" href="../../_static/favicon.ico"/>
|
|
<link rel="author" title="About these documents" href="../../about.html" />
|
|
<link rel="index" title="Index" href="../../genindex.html" />
|
|
<link rel="search" title="Search" href="../../search.html" />
|
|
<link rel="next" title="Modify a Clear Linux OS-based container image" href="container-image-modify.html" />
|
|
<link rel="prev" title="Architect the life-cycle of Clear Linux* OS" href="architect-lifecycle.html" />
|
|
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
|
<!--[if lt IE 9]>
|
|
<script src="_static/css3-mediaqueries.js"></script>
|
|
<![endif]-->
|
|
</head><body>
|
|
<div class="related" role="navigation" aria-label="Related">
|
|
<h3>Navigation</h3>
|
|
<ul>
|
|
<li class="right" style="margin-right: 10px">
|
|
<a href="../../genindex.html" title="General Index"
|
|
accesskey="I">index</a></li>
|
|
<li class="right" >
|
|
<a href="container-image-modify.html" title="Modify a Clear Linux OS-based container image"
|
|
accesskey="N">next</a> |</li>
|
|
<li class="right" >
|
|
<a href="architect-lifecycle.html" title="Architect the life-cycle of Clear Linux* OS"
|
|
accesskey="P">previous</a> |</li>
|
|
<li class="nav-item nav-item-0"><a href="../../index.html">Documentation for Clear Linux* project</a> »</li>
|
|
<li class="nav-item nav-item-1"><a href="../index.html" accesskey="U">Guides</a> »</li>
|
|
<li class="nav-item nav-item-this"><a href="">Configure Huge Pages</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="document">
|
|
<div class="documentwrapper">
|
|
<div class="bodywrapper">
|
|
<div class="body" role="main">
|
|
|
|
<section id="configure-huge-pages">
|
|
<span id="enable-huge-pages"></span><h1>Configure Huge Pages<a class="headerlink" href="#configure-huge-pages" title="Link to this heading">¶</a></h1>
|
|
<p>In Clear Linux OS hugepages are enabled by default. The default hugepage size is 2MB.
|
|
The total number of hugepages is set to 0 by default. This guide shows you how
|
|
to add hugepages to the system and how to change the default hugepage size.</p>
|
|
<ol class="arabic">
|
|
<li><p>To check the enabled state, run the following command.</p>
|
|
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>cat<span class="w"> </span>/sys/kernel/mm/transparent_hugepage/enabled
|
|
</pre></div>
|
|
</div>
|
|
<p>The output will look like</p>
|
|
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">[always] madvise never</span>
|
|
</pre></div>
|
|
</div>
|
|
<div class="admonition note">
|
|
<p class="admonition-title">Note</p>
|
|
<p>The active option is enclosed in brackets. In this case, always is active,
|
|
which means hugepages are enabled for every process. The <cite>madvise</cite>
|
|
option means that hugepages are enabled for processes that explicitly
|
|
call <a class="reference external" href="https://linux.die.net/man/2/madvise">madvise</a>.</p>
|
|
</div>
|
|
</li>
|
|
<li><p>To check the size of hugepages, run the below command.</p>
|
|
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>cat<span class="w"> </span>/proc/meminfo<span class="w"> </span><span class="p">|</span><span class="w"> </span>grep<span class="w"> </span>Huge
|
|
</pre></div>
|
|
</div>
|
|
<p>The output should look similar to the following. Although hugepages is
|
|
enabled, there are no hugepages available to allocate.</p>
|
|
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">AnonHugePages: 624640 kB</span>
|
|
<span class="go">ShmemHugePages: 0 kB</span>
|
|
<span class="go">FileHugePages: 0 kB</span>
|
|
<span class="go">HugePages_Total: 0</span>
|
|
<span class="go">HugePages_Free: 0</span>
|
|
<span class="go">HugePages_Rsvd: 0</span>
|
|
<span class="go">HugePages_Surp: 0</span>
|
|
<span class="go">Hugepagesize: 2048 kB</span>
|
|
<span class="go">Hugetlb: 0 kB</span>
|
|
</pre></div>
|
|
</div>
|
|
</li>
|
|
<li><p>If you need 1GB (1,048,576 bytes) of hugepages enabled, then <cite>HugePages_Total</cite>
|
|
should be set to 512. Enable it temporarily using the following.</p>
|
|
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">echo</span><span class="w"> </span><span class="m">512</span><span class="w"> </span><span class="p">|</span><span class="w"> </span>sudo<span class="w"> </span>tee<span class="w"> </span>/sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
|
|
</pre></div>
|
|
</div>
|
|
<p>To view the change, run the command in the previous setp again.</p>
|
|
</li>
|
|
<li><p>Changing hugepages from the default 2MB to 1GB must be done at system boot
|
|
through kernel boot parameters. In this example, we configure the size and
|
|
number of allocatable huge pages at boot.</p>
|
|
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>mkdir<span class="w"> </span>-p<span class="w"> </span>/etc/kernel/cmdline.d
|
|
cat<span class="w"> </span><span class="s"><< EOF | sudo tee -a /etc/kernel/cmdline.d/hugepages.conf</span>
|
|
<span class="s">default_hugepagesz=1G</span>
|
|
<span class="s">hugepagesz=1G</span>
|
|
<span class="s">hugepages=10</span>
|
|
<span class="s">EOF</span>
|
|
sudo<span class="w"> </span>clr-boot-manager<span class="w"> </span>update
|
|
sudo<span class="w"> </span>reboot
|
|
</pre></div>
|
|
</div>
|
|
</li>
|
|
</ol>
|
|
</section>
|
|
|
|
|
|
<div class="clearer"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="sphinxsidebar" role="navigation" aria-label="Main">
|
|
<div class="sphinxsidebarwrapper">
|
|
<p class="logo"><a href="../../index.html">
|
|
<img class="logo" src="../../_static/clearlinux.png" alt="Logo of Clear Linux* Project Docs"/>
|
|
</a></p>
|
|
<div>
|
|
<h4>Previous topic</h4>
|
|
<p class="topless"><a href="architect-lifecycle.html"
|
|
title="previous chapter">Architect the life-cycle of Clear Linux* OS</a></p>
|
|
</div>
|
|
<div>
|
|
<h4>Next topic</h4>
|
|
<p class="topless"><a href="container-image-modify.html"
|
|
title="next chapter">Modify a Clear Linux OS-based container image</a></p>
|
|
</div>
|
|
<div role="note" aria-label="source link">
|
|
<h3>This Page</h3>
|
|
<ul class="this-page-menu">
|
|
<li><a href="../../_sources/guides/maintenance/configure-hugepages.rst.txt"
|
|
rel="nofollow">Show Source</a></li>
|
|
</ul>
|
|
</div>
|
|
<search id="searchbox" style="display: none" role="search">
|
|
<h3 id="searchlabel">Quick search</h3>
|
|
<div class="searchformwrapper">
|
|
<form class="search" action="../../search.html" method="get">
|
|
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
|
<input type="submit" value="Go" />
|
|
</form>
|
|
</div>
|
|
</search>
|
|
<script>document.getElementById('searchbox').style.display = "block"</script>
|
|
</div>
|
|
</div>
|
|
<div class="clearer"></div>
|
|
</div>
|
|
<div class="related" role="navigation" aria-label="Related">
|
|
<h3>Navigation</h3>
|
|
<ul>
|
|
<li class="right" style="margin-right: 10px">
|
|
<a href="../../genindex.html" title="General Index"
|
|
>index</a></li>
|
|
<li class="right" >
|
|
<a href="container-image-modify.html" title="Modify a Clear Linux OS-based container image"
|
|
>next</a> |</li>
|
|
<li class="right" >
|
|
<a href="architect-lifecycle.html" title="Architect the life-cycle of Clear Linux* OS"
|
|
>previous</a> |</li>
|
|
<li class="nav-item nav-item-0"><a href="../../index.html">Documentation for Clear Linux* project</a> »</li>
|
|
<li class="nav-item nav-item-1"><a href="../index.html" >Guides</a> »</li>
|
|
<li class="nav-item nav-item-this"><a href="">Configure Huge Pages</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="footer" role="contentinfo">
|
|
© Copyright 2022 Intel Corporation. All Rights Reserved..
|
|
Last updated on Nov 04, 2024.
|
|
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.1.3.
|
|
</div>
|
|
</body>
|
|
</html> |