1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Chapter&#160;4.&#160;Memory Management in Linux</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="The Linux Kernel API"><link rel="up" href="index.html" title="The Linux Kernel API"><link rel="prev" href="API-ida-init.html" title="ida_init"><link rel="next" href="API-kmalloc.html" title="kmalloc"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter&#160;4.&#160;Memory Management in Linux</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-ida-init.html">Prev</a>&#160;</td><th width="60%" align="center">&#160;</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-kmalloc.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="mm"></a>Chapter&#160;4.&#160;Memory Management in Linux</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="sect1"><a href="mm.html#idp1123724580">The Slab Cache</a></span></dt><dt><span class="sect1"><a href="ch04s02.html">User Space Memory Access</a></span></dt><dt><span class="sect1"><a href="ch04s03.html">More Memory Management Functions</a></span></dt></dl></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp1123724580"></a>The Slab Cache</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-kmalloc.html"><span class="phrase">kmalloc</span></a></span><span class="refpurpose"> &#8212; 
2  allocate memory
3 </span></dt><dt><span class="refentrytitle"><a href="API-kmalloc-array.html"><span class="phrase">kmalloc_array</span></a></span><span class="refpurpose"> &#8212; 
4     allocate memory for an array.
5 </span></dt><dt><span class="refentrytitle"><a href="API-kcalloc.html"><span class="phrase">kcalloc</span></a></span><span class="refpurpose"> &#8212; 
6     allocate memory for an array. The memory is set to zero.
7 </span></dt><dt><span class="refentrytitle"><a href="API-kzalloc.html"><span class="phrase">kzalloc</span></a></span><span class="refpurpose"> &#8212; 
8     allocate memory. The memory is set to zero.
9 </span></dt><dt><span class="refentrytitle"><a href="API-kzalloc-node.html"><span class="phrase">kzalloc_node</span></a></span><span class="refpurpose"> &#8212; 
10     allocate zeroed memory from a particular memory node.
11 </span></dt><dt><span class="refentrytitle"><a href="API-kmem-cache-alloc.html"><span class="phrase">kmem_cache_alloc</span></a></span><span class="refpurpose"> &#8212; 
12  Allocate an object
13 </span></dt><dt><span class="refentrytitle"><a href="API-kmem-cache-alloc-node.html"><span class="phrase">kmem_cache_alloc_node</span></a></span><span class="refpurpose"> &#8212; 
14     Allocate an object on the specified node
15 </span></dt><dt><span class="refentrytitle"><a href="API-kmem-cache-free.html"><span class="phrase">kmem_cache_free</span></a></span><span class="refpurpose"> &#8212; 
16     Deallocate an object
17 </span></dt><dt><span class="refentrytitle"><a href="API-kfree.html"><span class="phrase">kfree</span></a></span><span class="refpurpose"> &#8212; 
18     free previously allocated memory
19 </span></dt><dt><span class="refentrytitle"><a href="API-ksize.html"><span class="phrase">ksize</span></a></span><span class="refpurpose"> &#8212; 
20     get the actual amount of memory allocated for a given object
21 </span></dt><dt><span class="refentrytitle"><a href="API-kfree-const.html"><span class="phrase">kfree_const</span></a></span><span class="refpurpose"> &#8212; 
22  conditionally free memory
23 </span></dt><dt><span class="refentrytitle"><a href="API-kstrdup.html"><span class="phrase">kstrdup</span></a></span><span class="refpurpose"> &#8212; 
24     allocate space for and copy an existing string
25 </span></dt><dt><span class="refentrytitle"><a href="API-kstrdup-const.html"><span class="phrase">kstrdup_const</span></a></span><span class="refpurpose"> &#8212; 
26     conditionally duplicate an existing const string
27 </span></dt><dt><span class="refentrytitle"><a href="API-kstrndup.html"><span class="phrase">kstrndup</span></a></span><span class="refpurpose"> &#8212; 
28     allocate space for and copy an existing string
29 </span></dt><dt><span class="refentrytitle"><a href="API-kmemdup.html"><span class="phrase">kmemdup</span></a></span><span class="refpurpose"> &#8212; 
30     duplicate region of memory
31 </span></dt><dt><span class="refentrytitle"><a href="API-memdup-user.html"><span class="phrase">memdup_user</span></a></span><span class="refpurpose"> &#8212; 
32     duplicate memory region from user space
33 </span></dt><dt><span class="refentrytitle"><a href="API-get-user-pages-fast.html"><span class="phrase">get_user_pages_fast</span></a></span><span class="refpurpose"> &#8212; 
34     pin user pages in memory
35 </span></dt></dl></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-ida-init.html">Prev</a>&#160;</td><td width="20%" align="center">&#160;</td><td width="40%" align="right">&#160;<a accesskey="n" href="API-kmalloc.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">ida_init</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">kmalloc</span></td></tr></table></div></body></html>
36