__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<!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>Slab Allocation — The Linux Kernel documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/alabaster.css?v=3918102e" />
<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>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="High Memory Handling" href="highmem.html" />
<link rel="prev" title="Virtually Contiguous Memory Allocation" href="vmalloc.html" />
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
</head><body>
<div class="document">
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/logo.svg" alt="Logo of The Linux Kernel"/>
</a></p>
<h1 class="logo"><a href="../index.html">The Linux Kernel</a></h1>
<p class="blurb">6.18.50</p>
<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>
<p>
<h3 class="kernel-toc-contents">Contents</h3>
<input type="checkbox" class="kernel-toc-toggle" id = "kernel-toc-toggle" checked>
<label class="kernel-toc-title" for="kernel-toc-toggle"></label>
<div class="kerneltoc" id="kerneltoc">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../process/development-process.html">Development process</a></li>
<li class="toctree-l1"><a class="reference internal" href="../process/submitting-patches.html">Submitting patches</a></li>
<li class="toctree-l1"><a class="reference internal" href="../process/code-of-conduct.html">Code of conduct</a></li>
<li class="toctree-l1"><a class="reference internal" href="../maintainer/index.html">Maintainer handbook</a></li>
<li class="toctree-l1"><a class="reference internal" href="../process/index.html">All development-process docs</a></li>
</ul>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../core-api/index.html">Core API</a></li>
<li class="toctree-l1"><a class="reference internal" href="../driver-api/index.html">Driver APIs</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../subsystem-apis.html">Subsystems</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="../subsystem-apis.html#core-subsystems">Core subsystems</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../core-api/index.html">Core API Documentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../driver-api/index.html">Driver implementer’s API guide</a></li>
<li class="toctree-l3 current"><a class="reference internal" href="index.html">Memory Management Documentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../power/index.html">Power Management</a></li>
<li class="toctree-l3"><a class="reference internal" href="../scheduler/index.html">Scheduler</a></li>
<li class="toctree-l3"><a class="reference internal" href="../timers/index.html">Timers</a></li>
<li class="toctree-l3"><a class="reference internal" href="../locking/index.html">Locking</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#human-interfaces">Human interfaces</a></li>
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#networking-interfaces">Networking interfaces</a></li>
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#storage-interfaces">Storage interfaces</a></li>
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#other-subsystems">Other subsystems</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../locking/index.html">Locking</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../process/license-rules.html">Licensing rules</a></li>
<li class="toctree-l1"><a class="reference internal" href="../doc-guide/index.html">Writing documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dev-tools/index.html">Development tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dev-tools/testing-overview.html">Testing guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../kernel-hacking/index.html">Hacking guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../trace/index.html">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fault-injection/index.html">Fault injection</a></li>
<li class="toctree-l1"><a class="reference internal" href="../livepatch/index.html">Livepatching</a></li>
<li class="toctree-l1"><a class="reference internal" href="../rust/index.html">Rust</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../admin-guide/index.html">Administration</a></li>
<li class="toctree-l1"><a class="reference internal" href="../kbuild/index.html">Build system</a></li>
<li class="toctree-l1"><a class="reference internal" href="../admin-guide/reporting-issues.html">Reporting issues</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tools/index.html">Userspace tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../userspace-api/index.html">Userspace API</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../firmware-guide/index.html">Firmware</a></li>
<li class="toctree-l1"><a class="reference internal" href="../devicetree/index.html">Firmware and Devicetree</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../arch/index.html">CPU architectures</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../staging/index.html">Unsorted documentation</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../translations/index.html">Translations</a></li>
</ul>
</div>
<script type="text/javascript"> <!--
var sbar = document.getElementsByClassName("sphinxsidebar")[0];
let currents = document.getElementsByClassName("current")
if (currents.length) {
sbar.scrollTop = currents[currents.length - 1].offsetTop;
}
--> </script>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/mm/slab.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="slab-allocation">
<h1>Slab Allocation<a class="headerlink" href="#slab-allocation" title="Link to this heading">¶</a></h1>
<section id="functions-and-structures">
<h2>Functions and structures<a class="headerlink" href="#functions-and-structures" title="Link to this heading">¶</a></h2>
<dl class="c macro">
<dt class="sig sig-object c" id="c.folio_slab">
<span class="sig-name descname"><span class="n"><span class="pre">folio_slab</span></span></span><a class="headerlink" href="#c.folio_slab" title="Link to this definition">¶</a><br /></dt>
<dd></dd></dl>
<p><code class="docutils literal notranslate"><span class="pre">folio_slab</span> <span class="pre">(folio)</span></code></p>
<blockquote>
<div><p>Converts from folio to slab.</p>
</div></blockquote>
<div class="kernelindent docutils container">
<p><strong>Parameters</strong></p>
<dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">folio</span></code></dt><dd><p>The folio.</p>
</dd>
</dl>
<p><strong>Description</strong></p>
<p>Currently <code class="xref c c-struct broken_xref docutils literal notranslate"><span class="pre">struct</span> <span class="pre">slab</span></code> is a different representation of a folio where
<code class="xref c c-func broken_xref docutils literal notranslate"><span class="pre">folio_test_slab()</span></code> is true.</p>
<p><strong>Return</strong></p>
<p>The slab which contains this folio.</p>
</div>
<dl class="c macro">
<dt class="sig sig-object c" id="c.slab_folio">
<span class="sig-name descname"><span class="n"><span class="pre">slab_folio</span></span></span><a class="headerlink" href="#c.slab_folio" title="Link to this definition">¶</a><br /></dt>
<dd></dd></dl>
<p><code class="docutils literal notranslate"><span class="pre">slab_folio</span> <span class="pre">(s)</span></code></p>
<blockquote>
<div><p>The folio allocated for a slab</p>
</div></blockquote>
<div class="kernelindent docutils container">
<p><strong>Parameters</strong></p>
<dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">s</span></code></dt><dd><p>The slab.</p>
</dd>
</dl>
<p><strong>Description</strong></p>
<p>Slabs are allocated as folios that contain the individual objects and are
using some fields in the first <code class="xref c c-struct broken_xref docutils literal notranslate"><span class="pre">struct</span> <span class="pre">page</span></code> of the folio - those fields are
now accessed by <code class="xref c c-struct broken_xref docutils literal notranslate"><span class="pre">struct</span> <span class="pre">slab</span></code>. It is occasionally necessary to convert back to
a folio in order to communicate with the rest of the mm. Please use this
helper function instead of casting yourself, as the implementation may change
in the future.</p>
</div>
<dl class="c macro">
<dt class="sig sig-object c" id="c.page_slab">
<span class="sig-name descname"><span class="n"><span class="pre">page_slab</span></span></span><a class="headerlink" href="#c.page_slab" title="Link to this definition">¶</a><br /></dt>
<dd></dd></dl>
<p><code class="docutils literal notranslate"><span class="pre">page_slab</span> <span class="pre">(p)</span></code></p>
<blockquote>
<div><p>Converts from first <code class="xref c c-struct broken_xref docutils literal notranslate"><span class="pre">struct</span> <span class="pre">page</span></code> to slab.</p>
</div></blockquote>
<div class="kernelindent docutils container">
<p><strong>Parameters</strong></p>
<dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">p</span></code></dt><dd><p>The first (either head of compound or single) page of slab.</p>
</dd>
</dl>
<p><strong>Description</strong></p>
<p>A temporary wrapper to convert <code class="xref c c-struct broken_xref docutils literal notranslate"><span class="pre">struct</span> <span class="pre">page</span></code> to <code class="xref c c-struct broken_xref docutils literal notranslate"><span class="pre">struct</span> <span class="pre">slab</span></code> in situations where
we know the page is the compound head, or single order-0 page.</p>
<p>Long-term ideally everything would work with <code class="xref c c-struct broken_xref docutils literal notranslate"><span class="pre">struct</span> <span class="pre">slab</span></code> directly or go
through folio to <code class="xref c c-struct broken_xref docutils literal notranslate"><span class="pre">struct</span> <span class="pre">slab</span></code>.</p>
<p><strong>Return</strong></p>
<p>The slab which contains this page</p>
</div>
<dl class="c macro">
<dt class="sig sig-object c" id="c.slab_page">
<span class="sig-name descname"><span class="n"><span class="pre">slab_page</span></span></span><a class="headerlink" href="#c.slab_page" title="Link to this definition">¶</a><br /></dt>
<dd></dd></dl>
<p><code class="docutils literal notranslate"><span class="pre">slab_page</span> <span class="pre">(s)</span></code></p>
<blockquote>
<div><p>The first <code class="xref c c-struct broken_xref docutils literal notranslate"><span class="pre">struct</span> <span class="pre">page</span></code> allocated for a slab</p>
</div></blockquote>
<div class="kernelindent docutils container">
<p><strong>Parameters</strong></p>
<dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">s</span></code></dt><dd><p>The slab.</p>
</dd>
</dl>
<p><strong>Description</strong></p>
<p>A convenience wrapper for converting slab to the first <code class="xref c c-struct broken_xref docutils literal notranslate"><span class="pre">struct</span> <span class="pre">page</span></code> of the
underlying folio, to communicate with code not yet converted to folio or
<code class="xref c c-struct broken_xref docutils literal notranslate"><span class="pre">struct</span> <span class="pre">slab</span></code>.</p>
</div>
<dl class="c enum">
<dt class="sig sig-object c" id="c.slab_flags">
<span class="k"><span class="pre">enum</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">slab_flags</span></span></span><a class="headerlink" href="#c.slab_flags" title="Link to this definition">¶</a><br /></dt>
<dd><p>How the slab flags bits are used.</p>
</dd></dl>
<div class="kernelindent docutils container">
<p><strong>Constants</strong></p>
<dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">SL_locked</span></code></dt><dd><p>Is locked with <code class="xref c c-func broken_xref docutils literal notranslate"><span class="pre">slab_lock()</span></code></p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">SL_partial</span></code></dt><dd><p>On the per-node partial list</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">SL_pfmemalloc</span></code></dt><dd><p>Was allocated from PF_MEMALLOC reserves</p>
</dd>
</dl>
</div>
<p><strong>Description</strong></p>
<p>The slab flags share space with the page flags but some bits have
different interpretations. The high bits are used for information
like zone/node/section.</p>
</section>
</section>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©The kernel development community.
|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 8.1.3</a>
& <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>
|
<a href="../_sources/mm/slab.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| damon | Folder | 0755 |
|
|
| active_mm.html | File | 12.8 KB | 0644 |
|
| allocation-profiling.html | File | 13.65 KB | 0644 |
|
| arch_pgtable_helpers.html | File | 20.2 KB | 0644 |
|
| balance.html | File | 14.36 KB | 0644 |
|
| bootmem.html | File | 8 KB | 0644 |
|
| free_page_reporting.html | File | 10.17 KB | 0644 |
|
| highmem.html | File | 75.38 KB | 0644 |
|
| hmm.html | File | 40.36 KB | 0644 |
|
| hugetlbfs_reserv.html | File | 47.17 KB | 0644 |
|
| hwpoison.html | File | 15.86 KB | 0644 |
|
| index.html | File | 13.59 KB | 0644 |
|
| ksm.html | File | 17.68 KB | 0644 |
|
| memory-model.html | File | 21.35 KB | 0644 |
|
| mmu_notifier.html | File | 13.02 KB | 0644 |
|
| multigen_lru.html | File | 25.56 KB | 0644 |
|
| numa.html | File | 17.7 KB | 0644 |
|
| oom.html | File | 8.02 KB | 0644 |
|
| overcommit-accounting.html | File | 12.24 KB | 0644 |
|
| page_allocation.html | File | 8.03 KB | 0644 |
|
| page_cache.html | File | 8.4 KB | 0644 |
|
| page_frags.html | File | 10.44 KB | 0644 |
|
| page_migration.html | File | 22.8 KB | 0644 |
|
| page_owner.html | File | 19.73 KB | 0644 |
|
| page_reclaim.html | File | 7.99 KB | 0644 |
|
| page_table_check.html | File | 12.38 KB | 0644 |
|
| page_tables.html | File | 25.13 KB | 0644 |
|
| physical_memory.html | File | 58.06 KB | 0644 |
|
| process_addrs.html | File | 75.38 KB | 0644 |
|
| remap_file_pages.html | File | 10.2 KB | 0644 |
|
| shmfs.html | File | 8.03 KB | 0644 |
|
| slab.html | File | 14.86 KB | 0644 |
|
| split_page_table_lock.html | File | 14.96 KB | 0644 |
|
| swap-table.html | File | 10.67 KB | 0644 |
|
| swap.html | File | 7.95 KB | 0644 |
|
| transhuge.html | File | 19.52 KB | 0644 |
|
| unevictable-lru.html | File | 56.55 KB | 0644 |
|
| vmalloc.html | File | 8.09 KB | 0644 |
|
| vmalloced-kernel-stacks.html | File | 17.72 KB | 0644 |
|
| vmemmap_dedup.html | File | 23.59 KB | 0644 |
|
| zsmalloc.html | File | 34.19 KB | 0644 |
|