sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget/translations/zh_CN/mm/zsmallocmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget/translations/zh_TW/mm/zsmallocmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget/translations/it_IT/mm/zsmallocmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget/translations/ja_JP/mm/zsmallocmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget/translations/ko_KR/mm/zsmallocmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget/translations/sp_SP/mm/zsmallocmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(hzsmalloch]hzsmalloc}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhh9/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc.rsthKubh paragraph)}(hXThis allocator is designed for use with zram. Thus, the allocator is supposed to work well under low memory conditions. In particular, it never attempts higher order page allocation which is very likely to fail under memory pressure. On the other hand, if we just use single (0-order) pages, it would suffer from very high fragmentation -- any object of size PAGE_SIZE/2 or larger would occupy an entire page. This was one of the major issues with its predecessor (xvmalloc).h]hXThis allocator is designed for use with zram. Thus, the allocator is supposed to work well under low memory conditions. In particular, it never attempts higher order page allocation which is very likely to fail under memory pressure. On the other hand, if we just use single (0-order) pages, it would suffer from very high fragmentation -- any object of size PAGE_SIZE/2 or larger would occupy an entire page. This was one of the major issues with its predecessor (xvmalloc).}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hX/To overcome these issues, zsmalloc allocates a bunch of 0-order pages and links them together using various 'struct page' fields. These linked pages act as a single higher-order page i.e. an object can span 0-order page boundaries. The code refers to these linked pages as a single entity called zspage.h]hX3To overcome these issues, zsmalloc allocates a bunch of 0-order pages and links them together using various ‘struct page’ fields. These linked pages act as a single higher-order page i.e. an object can span 0-order page boundaries. The code refers to these linked pages as a single entity called zspage.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hX?For simplicity, zsmalloc can only allocate objects of size up to PAGE_SIZE since this satisfies the requirements of all its current users (in the worst case, page is incompressible and is thus stored "as-is" i.e. in uncompressed form). For allocation requests larger than this size, failure is returned (see zs_malloc).h]hXCFor simplicity, zsmalloc can only allocate objects of size up to PAGE_SIZE since this satisfies the requirements of all its current users (in the worst case, page is incompressible and is thus stored “as-is” i.e. in uncompressed form). For allocation requests larger than this size, failure is returned (see zs_malloc).}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXAdditionally, zs_malloc() does not return a dereferenceable pointer. Instead, it returns an opaque handle (unsigned long) which encodes actual location of the allocated object. The reason for this indirection is that zsmalloc does not keep zspages permanently mapped since that would cause issues on 32-bit systems where the VA region for kernel space mappings is very small. So, using the allocated memory should be done through the proper handle-based APIs.h]hXAdditionally, zs_malloc() does not return a dereferenceable pointer. Instead, it returns an opaque handle (unsigned long) which encodes actual location of the allocated object. The reason for this indirection is that zsmalloc does not keep zspages permanently mapped since that would cause issues on 32-bit systems where the VA region for kernel space mappings is very small. So, using the allocated memory should be done through the proper handle-based APIs.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(hstath]hstat}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhK"ubh)}(hWith CONFIG_ZSMALLOC_STAT, we could see zsmalloc internal information via ``/sys/kernel/debug/zsmalloc/``. Here is a sample of stat output::h](hJWith CONFIG_ZSMALLOC_STAT, we could see zsmalloc internal information via }(hjhhhNhNubhliteral)}(h*``/sys/kernel/debug/zsmalloc/``h]h&/sys/kernel/debug/zsmalloc/}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh". Here is a sample of stat output:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK$hhhhubh literal_block)}(hX+# cat /sys/kernel/debug/zsmalloc/zram0/classes class size 10% 20% 30% 40% 50% 60% 70% 80% 90% 99% 100% obj_allocated obj_used pages_used pages_per_zspage freeable ... ... 30 512 0 12 4 1 0 1 0 0 1 0 414 3464 3346 433 1 14 31 528 2 7 2 2 1 0 1 0 0 2 117 4154 3793 536 4 44 32 544 6 3 4 1 2 1 0 0 0 1 260 4170 3965 556 2 26 ... ...h]hX+# cat /sys/kernel/debug/zsmalloc/zram0/classes class size 10% 20% 30% 40% 50% 60% 70% 80% 90% 99% 100% obj_allocated obj_used pages_used pages_per_zspage freeable ... ... 30 512 0 12 4 1 0 1 0 0 1 0 414 3464 3346 433 1 14 31 528 2 7 2 2 1 0 1 0 0 2 117 4154 3793 536 4 44 32 544 6 3 4 1 2 1 0 0 0 1 260 4170 3965 556 2 26 ... ...}hj&sbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1j$hhhK'hhhhubhdefinition_list)}(hhh](hdefinition_list_item)}(h class indexh](hterm)}(hclassh]hclass}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1jAhhhK3hj=ubh definition)}(hhh]h)}(hindexh]hindex}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hjSubah}(h]h ]h"]h$]h&]uh1jQhj=ubeh}(h]h ]h"]h$]h&]uh1j;hhhK3hj8ubj<)}(hsize object size zspage storesh](jB)}(hsizeh]hsize}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1jAhhhK5hjpubjR)}(hhh]h)}(hobject size zspage storesh]hobject size zspage stores}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK6hjubah}(h]h ]h"]h$]h&]uh1jQhjpubeh}(h]h ]h"]h$]h&]uh1j;hhhK5hj8hhubj<)}(hD10% the number of zspages with usage ratio less than 10% (see below)h](jB)}(h10%h]h10%}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jAhhhK7hjubjR)}(hhh]h)}(h@the number of zspages with usage ratio less than 10% (see below)h]h@the number of zspages with usage ratio less than 10% (see below)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK8hjubah}(h]h ]h"]h$]h&]uh1jQhjubeh}(h]h ]h"]h$]h&]uh1j;hhhK7hj8hhubj<)}(h>20% the number of zspages with usage ratio between 10% and 20%h](jB)}(h20%h]h20%}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jAhhhK9hjubjR)}(hhh]h)}(h:the number of zspages with usage ratio between 10% and 20%h]h:the number of zspages with usage ratio between 10% and 20%}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK:hjubah}(h]h ]h"]h$]h&]uh1jQhjubeh}(h]h ]h"]h$]h&]uh1j;hhhK9hj8hhubj<)}(h>30% the number of zspages with usage ratio between 20% and 30%h](jB)}(h30%h]h30%}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jAhhhK;hjubjR)}(hhh]h)}(h:the number of zspages with usage ratio between 20% and 30%h]h:the number of zspages with usage ratio between 20% and 30%}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK40% the number of zspages with usage ratio between 30% and 40%h](jB)}(h40%h]h40%}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1jAhhhK=hj,ubjR)}(hhh]h)}(h:the number of zspages with usage ratio between 30% and 40%h]h:the number of zspages with usage ratio between 30% and 40%}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK>hj>ubah}(h]h ]h"]h$]h&]uh1jQhj,ubeh}(h]h ]h"]h$]h&]uh1j;hhhK=hj8hhubj<)}(h>50% the number of zspages with usage ratio between 40% and 50%h](jB)}(h50%h]h50%}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1jAhhhK?hj[ubjR)}(hhh]h)}(h:the number of zspages with usage ratio between 40% and 50%h]h:the number of zspages with usage ratio between 40% and 50%}(hjphhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK@hjmubah}(h]h ]h"]h$]h&]uh1jQhj[ubeh}(h]h ]h"]h$]h&]uh1j;hhhK?hj8hhubj<)}(h>60% the number of zspages with usage ratio between 50% and 60%h](jB)}(h60%h]h60%}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jAhhhKAhjubjR)}(hhh]h)}(h:the number of zspages with usage ratio between 50% and 60%h]h:the number of zspages with usage ratio between 50% and 60%}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKBhjubah}(h]h ]h"]h$]h&]uh1jQhjubeh}(h]h ]h"]h$]h&]uh1j;hhhKAhj8hhubj<)}(h>70% the number of zspages with usage ratio between 60% and 70%h](jB)}(h70%h]h70%}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jAhhhKChjubjR)}(hhh]h)}(h:the number of zspages with usage ratio between 60% and 70%h]h:the number of zspages with usage ratio between 60% and 70%}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKDhjubah}(h]h ]h"]h$]h&]uh1jQhjubeh}(h]h ]h"]h$]h&]uh1j;hhhKChj8hhubj<)}(h>80% the number of zspages with usage ratio between 70% and 80%h](jB)}(h80%h]h80%}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jAhhhKEhjubjR)}(hhh]h)}(h:the number of zspages with usage ratio between 70% and 80%h]h:the number of zspages with usage ratio between 70% and 80%}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKFhjubah}(h]h ]h"]h$]h&]uh1jQhjubeh}(h]h ]h"]h$]h&]uh1j;hhhKEhj8hhubj<)}(h>90% the number of zspages with usage ratio between 80% and 90%h](jB)}(h90%h]h90%}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jAhhhKGhjubjR)}(hhh]h)}(h:the number of zspages with usage ratio between 80% and 90%h]h:the number of zspages with usage ratio between 80% and 90%}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKHhj)ubah}(h]h ]h"]h$]h&]uh1jQhjubeh}(h]h ]h"]h$]h&]uh1j;hhhKGhj8hhubj<)}(h>99% the number of zspages with usage ratio between 90% and 99%h](jB)}(h99%h]h99%}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1jAhhhKIhjFubjR)}(hhh]h)}(h:the number of zspages with usage ratio between 90% and 99%h]h:the number of zspages with usage ratio between 90% and 99%}(hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKJhjXubah}(h]h ]h"]h$]h&]uh1jQhjFubeh}(h]h ]h"]h$]h&]uh1j;hhhKIhj8hhubj<)}(h0100% the number of zspages with usage ratio 100%h](jB)}(h100%h]h100%}(hjyhhhNhNubah}(h]h ]h"]h$]h&]uh1jAhhhKKhjuubjR)}(hhh]h)}(h+the number of zspages with usage ratio 100%h]h+the number of zspages with usage ratio 100%}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKLhjubah}(h]h ]h"]h$]h&]uh1jQhjuubeh}(h]h ]h"]h$]h&]uh1j;hhhKKhj8hhubj<)}(h-obj_allocated the number of objects allocatedh](jB)}(h obj_allocatedh]h obj_allocated}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jAhhhKMhjubjR)}(hhh]h)}(hthe number of objects allocatedh]hthe number of objects allocated}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKNhjubah}(h]h ]h"]h$]h&]uh1jQhjubeh}(h]h ]h"]h$]h&]uh1j;hhhKMhj8hhubj<)}(h4obj_used the number of objects allocated to the userh](jB)}(hobj_usedh]hobj_used}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jAhhhKOhjubjR)}(hhh]h)}(h+the number of objects allocated to the userh]h+the number of objects allocated to the user}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKPhjubah}(h]h ]h"]h$]h&]uh1jQhjubeh}(h]h ]h"]h$]h&]uh1j;hhhKOhj8hhubj<)}(h6pages_used the number of pages allocated for the classh](jB)}(h pages_usedh]h pages_used}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jAhhhKQhjubjR)}(hhh]h)}(h+the number of pages allocated for the classh]h+the number of pages allocated for the class}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKRhjubah}(h]h ]h"]h$]h&]uh1jQhjubeh}(h]h ]h"]h$]h&]uh1j;hhhKQhj8hhubj<)}(h=pages_per_zspage the number of 0-order pages to make a zspageh](jB)}(hpages_per_zspageh]hpages_per_zspage}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1jAhhhKShj1ubjR)}(hhh]h)}(h,the number of 0-order pages to make a zspageh]h,the number of 0-order pages to make a zspage}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKThjCubah}(h]h ]h"]h$]h&]uh1jQhj1ubeh}(h]h ]h"]h$]h&]uh1j;hhhKShj8hhubj<)}(hCfreeable the approximate number of pages class compaction can free h](jB)}(hfreeableh]hfreeable}(hjdhhhNhNubah}(h]h ]h"]h$]h&]uh1jAhhhKVhj`ubjR)}(hhh]h)}(h9the approximate number of pages class compaction can freeh]h9the approximate number of pages class compaction can free}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKVhjrubah}(h]h ]h"]h$]h&]uh1jQhj`ubeh}(h]h ]h"]h$]h&]uh1j;hhhKVhj8hhubeh}(h]h ]h"]h$]h&]uh1j6hhhhhhhNubh)}(hX^Each zspage maintains inuse counter which keeps track of the number of objects stored in the zspage. The inuse counter determines the zspage's "fullness group" which is calculated as the ratio of the "inuse" objects to the total number of objects the zspage can hold (objs_per_zspage). The closer the inuse counter is to objs_per_zspage, the better.h]hXhEach zspage maintains inuse counter which keeps track of the number of objects stored in the zspage. The inuse counter determines the zspage’s “fullness group” which is calculated as the ratio of the “inuse” objects to the total number of objects the zspage can hold (objs_per_zspage). The closer the inuse counter is to objs_per_zspage, the better.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKXhhhhubeh}(h]statah ]h"]statah$]h&]uh1hhhhhhhhK"ubh)}(hhh](h)}(h Internalsh]h Internals}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK_ubh)}(hX$zsmalloc has 255 size classes, each of which can hold a number of zspages. Each zspage can contain up to ZSMALLOC_CHAIN_SIZE physical (0-order) pages. The optimal zspage chain size for each size class is calculated during the creation of the zsmalloc pool (see calculate_zspage_chain_size()).h]hX$zsmalloc has 255 size classes, each of which can hold a number of zspages. Each zspage can contain up to ZSMALLOC_CHAIN_SIZE physical (0-order) pages. The optimal zspage chain size for each size class is calculated during the creation of the zsmalloc pool (see calculate_zspage_chain_size()).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKahjhhubh)}(hAs an optimization, zsmalloc merges size classes that have similar characteristics in terms of the number of pages per zspage and the number of objects that each zspage can store.h]hAs an optimization, zsmalloc merges size classes that have similar characteristics in terms of the number of pages per zspage and the number of objects that each zspage can store.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKfhjhhubh)}(h4For instance, consider the following size classes:::h]h3For instance, consider the following size classes::}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKjhjhhubj%)}(hX0class size 10% .... 100% obj_allocated obj_used pages_used pages_per_zspage freeable ... 94 1536 0 .... 0 0 0 0 3 0 100 1632 0 .... 0 0 0 0 2 0 ...h]hX0class size 10% .... 100% obj_allocated obj_used pages_used pages_per_zspage freeable ... 94 1536 0 .... 0 0 0 0 3 0 100 1632 0 .... 0 0 0 0 2 0 ...}hjsbah}(h]h ]h"]h$]h&]j4j5uh1j$hhhKlhjhhubh)}(hX/Size classes #95-99 are merged with size class #100. This means that when we need to store an object of size, say, 1568 bytes, we end up using size class #100 instead of size class #96. Size class #100 is meant for objects of size 1632 bytes, so each object of size 1568 bytes wastes 1632-1568=64 bytes.h]hX/Size classes #95-99 are merged with size class #100. This means that when we need to store an object of size, say, 1568 bytes, we end up using size class #100 instead of size class #96. Size class #100 is meant for objects of size 1632 bytes, so each object of size 1568 bytes wastes 1632-1568=64 bytes.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKshjhhubh)}(hSize class #100 consists of zspages with 2 physical pages each, which can hold a total of 5 objects. If we need to store 13 objects of size 1568, we end up allocating three zspages, or 6 physical pages.h]hSize class #100 consists of zspages with 2 physical pages each, which can hold a total of 5 objects. If we need to store 13 objects of size 1568, we end up allocating three zspages, or 6 physical pages.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKxhjhhubh)}(hHowever, if we take a closer look at size class #96 (which is meant for objects of size 1568 bytes) and trace `calculate_zspage_chain_size()`, we find that the most optimal zspage configuration for this class is a chain of 5 physical pages:::h](hnHowever, if we take a closer look at size class #96 (which is meant for objects of size 1568 bytes) and trace }(hjhhhNhNubhtitle_reference)}(h`calculate_zspage_chain_size()`h]hcalculate_zspage_chain_size()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhd, we find that the most optimal zspage configuration for this class is a chain of 5 physical pages::}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK|hjhhubj%)}(hXpages per zspage wasted bytes used% 1 960 76 2 352 95 3 1312 89 4 704 95 5 96 99h]hXpages per zspage wasted bytes used% 1 960 76 2 352 95 3 1312 89 4 704 95 5 96 99}hj2sbah}(h]h ]h"]h$]h&]j4j5uh1j$hhhKhjhhubh)}(hXThis means that a class #96 configuration with 5 physical pages can store 13 objects of size 1568 in a single zspage, using a total of 5 physical pages. This is more efficient than the class #100 configuration, which would use 6 physical pages to store the same number of objects.h]hXThis means that a class #96 configuration with 5 physical pages can store 13 objects of size 1568 in a single zspage, using a total of 5 physical pages. This is more efficient than the class #100 configuration, which would use 6 physical pages to store the same number of objects.}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hAs the zspage chain size for class #96 increases, its key characteristics such as pages per-zspage and objects per-zspage also change. This leads to dewer class mergers, resulting in a more compact grouping of classes, which reduces memory wastage.h]hAs the zspage chain size for class #96 increases, its key characteristics such as pages per-zspage and objects per-zspage also change. This leads to dewer class mergers, resulting in a more compact grouping of classes, which reduces memory wastage.}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hWLet's take a closer look at the bottom of `/sys/kernel/debug/zsmalloc/zramX/classes`:::h](h,Let’s take a closer look at the bottom of }(hj\hhhNhNubj)}(h*`/sys/kernel/debug/zsmalloc/zramX/classes`h]h(/sys/kernel/debug/zsmalloc/zramX/classes}(hjdhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj\ubh::}(hj\hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj%)}(hX1class size 10% .... 100% obj_allocated obj_used pages_used pages_per_zspage freeable ... 202 3264 0 .. 0 0 0 0 4 0 254 4096 0 .. 0 0 0 0 1 0 ...h]hX1class size 10% .... 100% obj_allocated obj_used pages_used pages_per_zspage freeable ... 202 3264 0 .. 0 0 0 0 4 0 254 4096 0 .. 0 0 0 0 1 0 ...}hj|sbah}(h]h ]h"]h$]h&]j4j5uh1j$hhhKhjhhubh)}(hXSize class #202 stores objects of size 3264 bytes and has a maximum of 4 pages per zspage. Any object larger than 3264 bytes is considered huge and belongs to size class #254, which stores each object in its own physical page (objects in huge classes do not share pages).h]hXSize class #202 stores objects of size 3264 bytes and has a maximum of 4 pages per zspage. Any object larger than 3264 bytes is considered huge and belongs to size class #254, which stores each object in its own physical page (objects in huge classes do not share pages).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hIncreasing the size of the chain of zspages also results in a higher watermark for the huge size class and fewer huge classes overall. This allows for more efficient storage of large objects.h]hIncreasing the size of the chain of zspages also results in a higher watermark for the huge size class and fewer huge classes overall. This allows for more efficient storage of large objects.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hFFor zspage chain size of 8, huge class watermark becomes 3632 bytes:::h]hEFor zspage chain size of 8, huge class watermark becomes 3632 bytes::}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj%)}(hXclass size 10% .... 100% obj_allocated obj_used pages_used pages_per_zspage freeable ... 202 3264 0 .. 0 0 0 0 4 0 211 3408 0 .. 0 0 0 0 5 0 217 3504 0 .. 0 0 0 0 6 0 222 3584 0 .. 0 0 0 0 7 0 225 3632 0 .. 0 0 0 0 8 0 254 4096 0 .. 0 0 0 0 1 0 ...h]hXclass size 10% .... 100% obj_allocated obj_used pages_used pages_per_zspage freeable ... 202 3264 0 .. 0 0 0 0 4 0 211 3408 0 .. 0 0 0 0 5 0 217 3504 0 .. 0 0 0 0 6 0 222 3584 0 .. 0 0 0 0 7 0 225 3632 0 .. 0 0 0 0 8 0 254 4096 0 .. 0 0 0 0 1 0 ...}hjsbah}(h]h ]h"]h$]h&]j4j5uh1j$hhhKhjhhubh)}(hGFor zspage chain size of 16, huge class watermark becomes 3840 bytes:::h]hFFor zspage chain size of 16, huge class watermark becomes 3840 bytes::}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj%)}(hX'class size 10% .... 100% obj_allocated obj_used pages_used pages_per_zspage freeable ... 202 3264 0 .. 0 0 0 0 4 0 206 3328 0 .. 0 0 0 0 13 0 207 3344 0 .. 0 0 0 0 9 0 208 3360 0 .. 0 0 0 0 14 0 211 3408 0 .. 0 0 0 0 5 0 212 3424 0 .. 0 0 0 0 16 0 214 3456 0 .. 0 0 0 0 11 0 217 3504 0 .. 0 0 0 0 6 0 219 3536 0 .. 0 0 0 0 13 0 222 3584 0 .. 0 0 0 0 7 0 223 3600 0 .. 0 0 0 0 15 0 225 3632 0 .. 0 0 0 0 8 0 228 3680 0 .. 0 0 0 0 9 0 230 3712 0 .. 0 0 0 0 10 0 232 3744 0 .. 0 0 0 0 11 0 234 3776 0 .. 0 0 0 0 12 0 235 3792 0 .. 0 0 0 0 13 0 236 3808 0 .. 0 0 0 0 14 0 238 3840 0 .. 0 0 0 0 15 0 254 4096 0 .. 0 0 0 0 1 0 ...h]hX'class size 10% .... 100% obj_allocated obj_used pages_used pages_per_zspage freeable ... 202 3264 0 .. 0 0 0 0 4 0 206 3328 0 .. 0 0 0 0 13 0 207 3344 0 .. 0 0 0 0 9 0 208 3360 0 .. 0 0 0 0 14 0 211 3408 0 .. 0 0 0 0 5 0 212 3424 0 .. 0 0 0 0 16 0 214 3456 0 .. 0 0 0 0 11 0 217 3504 0 .. 0 0 0 0 6 0 219 3536 0 .. 0 0 0 0 13 0 222 3584 0 .. 0 0 0 0 7 0 223 3600 0 .. 0 0 0 0 15 0 225 3632 0 .. 0 0 0 0 8 0 228 3680 0 .. 0 0 0 0 9 0 230 3712 0 .. 0 0 0 0 10 0 232 3744 0 .. 0 0 0 0 11 0 234 3776 0 .. 0 0 0 0 12 0 235 3792 0 .. 0 0 0 0 13 0 236 3808 0 .. 0 0 0 0 14 0 238 3840 0 .. 0 0 0 0 15 0 254 4096 0 .. 0 0 0 0 1 0 ...}hjsbah}(h]h ]h"]h$]h&]j4j5uh1j$hhhKhjhhubh)}(hOOverall the combined zspage chain size effect on zsmalloc pool configuration:::h]hNOverall the combined zspage chain size effect on zsmalloc pool configuration::}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj%)}(hXpages per zspage number of size classes (clusters) huge size class watermark 4 69 3264 5 86 3408 6 93 3504 7 112 3584 8 123 3632 9 140 3680 10 143 3712 11 159 3744 12 164 3776 13 180 3792 14 183 3808 15 188 3840 16 191 3840h]hXpages per zspage number of size classes (clusters) huge size class watermark 4 69 3264 5 86 3408 6 93 3504 7 112 3584 8 123 3632 9 140 3680 10 143 3712 11 159 3744 12 164 3776 13 180 3792 14 183 3808 15 188 3840 16 191 3840}hjsbah}(h]h ]h"]h$]h&]j4j5uh1j$hhhKhjhhubh)}(hhh](h)}(hA synthetic testh]hA synthetic test}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(h=zram as a build artifacts storage (Linux kernel compilation).h]h=zram as a build artifacts storage (Linux kernel compilation).}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh bullet_list)}(hhh](h list_item)}(hXv`CONFIG_ZSMALLOC_CHAIN_SIZE=4` zsmalloc classes stats::: class size 10% .... 100% obj_allocated obj_used pages_used pages_per_zspage freeable ... Total 13 .. 51 413836 412973 159955 3 zram mm_stat::: 1691783168 628083717 655175680 0 655175680 60 0 34048 34049 h](h)}(h`CONFIG_ZSMALLOC_CHAIN_SIZE=4`h]j)}(hj&h]hCONFIG_ZSMALLOC_CHAIN_SIZE=4}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj$ubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubh)}(hzsmalloc classes stats:::h]hzsmalloc classes stats::}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubj%)}(hclass size 10% .... 100% obj_allocated obj_used pages_used pages_per_zspage freeable ... Total 13 .. 51 413836 412973 159955 3h]hclass size 10% .... 100% obj_allocated obj_used pages_used pages_per_zspage freeable ... Total 13 .. 51 413836 412973 159955 3}hjIsbah}(h]h ]h"]h$]h&]j4j5uh1j$hhhKhj ubh)}(hzram mm_stat:::h]hzram mm_stat::}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubj%)}(hU1691783168 628083717 655175680 0 655175680 60 0 34048 34049h]hU1691783168 628083717 655175680 0 655175680 60 0 34048 34049}hjesbah}(h]h ]h"]h$]h&]j4j5uh1j$hhhKhj ubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hXv`CONFIG_ZSMALLOC_CHAIN_SIZE=8` zsmalloc classes stats::: class size 10% .... 100% obj_allocated obj_used pages_used pages_per_zspage freeable ... Total 18 .. 87 414852 412978 156666 0 zram mm_stat::: 1691803648 627793930 641703936 0 641703936 60 0 33591 33591 h](h)}(h`CONFIG_ZSMALLOC_CHAIN_SIZE=8`h]j)}(hjh]hCONFIG_ZSMALLOC_CHAIN_SIZE=8}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj}ubah}(h]h ]h"]h$]h&]uh1hhhhKhjyubh)}(hzsmalloc classes stats:::h]hzsmalloc classes stats::}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjyubj%)}(hclass size 10% .... 100% obj_allocated obj_used pages_used pages_per_zspage freeable ... Total 18 .. 87 414852 412978 156666 0h]hclass size 10% .... 100% obj_allocated obj_used pages_used pages_per_zspage freeable ... Total 18 .. 87 414852 412978 156666 0}hjsbah}(h]h ]h"]h$]h&]j4j5uh1j$hhhKhjyubh)}(hzram mm_stat:::h]hzram mm_stat::}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjyubj%)}(hU1691803648 627793930 641703936 0 641703936 60 0 33591 33591h]hU1691803648 627793930 641703936 0 641703936 60 0 33591 33591}hjsbah}(h]h ]h"]h$]h&]j4j5uh1j$hhhKhjyubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]bullet*uh1jhhhKhjhhubh)}(hXUsing larger zspage chains may result in using fewer physical pages, as seen in the example where the number of physical pages used decreased from 159955 to 156666, at the same time maximum zsmalloc pool memory usage went down from 655175680 to 641703936 bytes.h]hXUsing larger zspage chains may result in using fewer physical pages, as seen in the example where the number of physical pages used decreased from 159955 to 156666, at the same time maximum zsmalloc pool memory usage went down from 655175680 to 641703936 bytes.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXHowever, this advantage may be offset by the potential for increased system memory pressure (as some zspages have larger chain sizes) in cases where there is heavy internal fragmentation and zspool compaction is unable to relocate objects and release zspages. In these cases, it is recommended to decrease the limit on the size of the zspage chains (as specified by the CONFIG_ZSMALLOC_CHAIN_SIZE option).h]hXHowever, this advantage may be offset by the potential for increased system memory pressure (as some zspages have larger chain sizes) in cases where there is heavy internal fragmentation and zspool compaction is unable to relocate objects and release zspages. In these cases, it is recommended to decrease the limit on the size of the zspage chains (as specified by the CONFIG_ZSMALLOC_CHAIN_SIZE option).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]a-synthetic-testah ]h"]a synthetic testah$]h&]uh1hhjhhhhhKubeh}(h] internalsah ]h"] internalsah$]h&]uh1hhhhhhhhK_ubh)}(hhh](h)}(h Functionsh]h Functions}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhM ubhindex)}(hhh]h}(h]h ]h"]h$]h&]entries](singleobj_to_location (C function)c.obj_to_locationhNtauh1jhjhhhNhNubhdesc)}(hhh](hdesc_signature)}(hWvoid obj_to_location (unsigned long obj, struct zpdesc **zpdesc, unsigned int *obj_idx)h]hdesc_signature_line)}(hVvoid obj_to_location(unsigned long obj, struct zpdesc **zpdesc, unsigned int *obj_idx)h](hdesc_sig_keyword_type)}(hvoidh]hvoid}(hj;hhhNhNubah}(h]h ]ktah"]h$]h&]uh1j9hj5hhhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chMAubhdesc_sig_space)}(h h]h }(hjMhhhNhNubah}(h]h ]wah"]h$]h&]uh1jKhj5hhhjJhMAubh desc_name)}(hobj_to_locationh]h desc_sig_name)}(hobj_to_locationh]hobj_to_location}(hjdhhhNhNubah}(h]h ]nah"]h$]h&]uh1jbhj^ubah}(h]h ](sig-namedescnameeh"]h$]h&]j4j5uh1j\hj5hhhjJhMAubhdesc_parameterlist)}(hB(unsigned long obj, struct zpdesc **zpdesc, unsigned int *obj_idx)h](hdesc_parameter)}(hunsigned long objh](j:)}(hunsignedh]hunsigned}(hjhhhNhNubah}(h]h ]jFah"]h$]h&]uh1j9hjubjL)}(h h]h }(hjhhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhjubj:)}(hlongh]hlong}(hjhhhNhNubah}(h]h ]jFah"]h$]h&]uh1j9hjubjL)}(h h]h }(hjhhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhjubjc)}(hobjh]hobj}(hjhhhNhNubah}(h]h ]joah"]h$]h&]uh1jbhjubeh}(h]h ]h"]h$]h&]noemphj4j5uh1jhj}ubj)}(hstruct zpdesc **zpdesch](hdesc_sig_keyword)}(hstructh]hstruct}(hjhhhNhNubah}(h]h ]kah"]h$]h&]uh1jhjubjL)}(h h]h }(hjhhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhjubh)}(hhh]jc)}(hzpdesch]hzpdesc}(hjhhhNhNubah}(h]h ]joah"]h$]h&]uh1jbhjubah}(h]h ]h"]h$]h&] refdomaincreftype identifier reftargetjmodnameN classnameN c:parent_keysphinx.domains.c LookupKey)}data]j ASTIdentifier)}jjfsbc.obj_to_locationasbuh1hhjubjL)}(h h]h }(hj#hhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhjubhdesc_sig_punctuation)}(hjh]h*}(hj3hhhNhNubah}(h]h ]pah"]h$]h&]uh1j1hjubj2)}(hjh]h*}(hjAhhhNhNubah}(h]h ]j=ah"]h$]h&]uh1j1hjubjc)}(hzpdesch]hzpdesc}(hjNhhhNhNubah}(h]h ]joah"]h$]h&]uh1jbhjubeh}(h]h ]h"]h$]h&]noemphj4j5uh1jhj}ubj)}(hunsigned int *obj_idxh](j:)}(hunsignedh]hunsigned}(hjghhhNhNubah}(h]h ]jFah"]h$]h&]uh1j9hjcubjL)}(h h]h }(hjuhhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhjcubj:)}(hinth]hint}(hjhhhNhNubah}(h]h ]jFah"]h$]h&]uh1j9hjcubjL)}(h h]h }(hjhhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhjcubj2)}(hjh]h*}(hjhhhNhNubah}(h]h ]j=ah"]h$]h&]uh1j1hjcubjc)}(hobj_idxh]hobj_idx}(hjhhhNhNubah}(h]h ]joah"]h$]h&]uh1jbhjcubeh}(h]h ]h"]h$]h&]noemphj4j5uh1jhj}ubeh}(h]h ]h"]h$]h&]j4j5uh1j{hj5hhhjJhMAubeh}(h]h ]h"]h$]h&]j4j5 add_permalinkuh1j3sphinx_line_type declaratorhj/hhhjJhMAubah}(h]j&ah ](sig sig-objecteh"]h$]h&] is_multiline _toc_parts) _toc_namehuh1j-hjJhMAhj*hhubh desc_content)}(hhh]h)}(h3get (, ) from encoded object valueh]h3get (, ) from encoded object value}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chM<hjhhubah}(h]h ]h"]h$]h&]uh1jhj*hhhjJhMAubeh}(h]h ](jfunctioneh"]h$]h&]domainjobjtypejdesctypejnoindex noindexentrynocontentsentryuh1j(hhhjhNhNubh container)}(h**Parameters** ``unsigned long obj`` the encoded object value ``struct zpdesc **zpdesc`` zpdesc object resides in zspage ``unsigned int *obj_idx`` object indexh](h)}(h**Parameters**h]hstrong)}(hj h]h Parameters}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubah}(h]h ]h"]h$]h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chM@hj ubj7)}(hhh](j<)}(h/``unsigned long obj`` the encoded object value h](jB)}(h``unsigned long obj``h]j )}(hj+ h]hunsigned long obj}(hj- hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj) ubah}(h]h ]h"]h$]h&]uh1jAhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chM=hj% ubjR)}(hhh]h)}(hthe encoded object valueh]hthe encoded object value}(hjD hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj@ hM=hjA ubah}(h]h ]h"]h$]h&]uh1jQhj% ubeh}(h]h ]h"]h$]h&]uh1j;hj@ hM=hj" ubj<)}(h;``struct zpdesc **zpdesc`` zpdesc object resides in zspage h](jB)}(h``struct zpdesc **zpdesc``h]j )}(hjd h]hstruct zpdesc **zpdesc}(hjf hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjb ubah}(h]h ]h"]h$]h&]uh1jAhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chM>hj^ ubjR)}(hhh]h)}(hzpdesc object resides in zspageh]hzpdesc object resides in zspage}(hj} hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjy hM>hjz ubah}(h]h ]h"]h$]h&]uh1jQhj^ ubeh}(h]h ]h"]h$]h&]uh1j;hjy hM>hj" ubj<)}(h&``unsigned int *obj_idx`` object indexh](jB)}(h``unsigned int *obj_idx``h]j )}(hj h]hunsigned int *obj_idx}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubah}(h]h ]h"]h$]h&]uh1jAhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chM@hj ubjR)}(hhh]h)}(h object indexh]h object index}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chM?hj ubah}(h]h ]h"]h$]h&]uh1jQhj ubeh}(h]h ]h"]h$]h&]uh1j;hj hM@hj" ubeh}(h]h ]h"]h$]h&]uh1j6hj ubeh}(h]h ] kernelindentah"]h$]h&]uh1j hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j$location_to_obj (C function)c.location_to_objhNtauh1jhjhhhNhNubj))}(hhh](j.)}(hKunsigned long location_to_obj (struct zpdesc *zpdesc, unsigned int obj_idx)h]j4)}(hJunsigned long location_to_obj(struct zpdesc *zpdesc, unsigned int obj_idx)h](j:)}(hunsignedh]hunsigned}(hj hhhNhNubah}(h]h ]jFah"]h$]h&]uh1j9hj hhhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chMRubjL)}(h h]h }(hj hhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhj hhhj hMRubj:)}(hlongh]hlong}(hj hhhNhNubah}(h]h ]jFah"]h$]h&]uh1j9hj hhhj hMRubjL)}(h h]h }(hj" hhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhj hhhj hMRubj])}(hlocation_to_objh]jc)}(hlocation_to_objh]hlocation_to_obj}(hj4 hhhNhNubah}(h]h ]joah"]h$]h&]uh1jbhj0 ubah}(h]h ](jvjweh"]h$]h&]j4j5uh1j\hj hhhj hMRubj|)}(h-(struct zpdesc *zpdesc, unsigned int obj_idx)h](j)}(hstruct zpdesc *zpdesch](j)}(hjh]hstruct}(hjP hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjL ubjL)}(h h]h }(hj] hhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhjL ubh)}(hhh]jc)}(hzpdesch]hzpdesc}(hjn hhhNhNubah}(h]h ]joah"]h$]h&]uh1jbhjk ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjp modnameN classnameNjj)}j]j)}jj6 sbc.location_to_objasbuh1hhjL ubjL)}(h h]h }(hj hhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhjL ubj2)}(hjh]h*}(hj hhhNhNubah}(h]h ]j=ah"]h$]h&]uh1j1hjL ubjc)}(hzpdesch]hzpdesc}(hj hhhNhNubah}(h]h ]joah"]h$]h&]uh1jbhjL ubeh}(h]h ]h"]h$]h&]noemphj4j5uh1jhjH ubj)}(hunsigned int obj_idxh](j:)}(hunsignedh]hunsigned}(hj hhhNhNubah}(h]h ]jFah"]h$]h&]uh1j9hj ubjL)}(h h]h }(hj hhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhj ubj:)}(hinth]hint}(hj hhhNhNubah}(h]h ]jFah"]h$]h&]uh1j9hj ubjL)}(h h]h }(hj hhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhj ubjc)}(hobj_idxh]hobj_idx}(hj hhhNhNubah}(h]h ]joah"]h$]h&]uh1jbhj ubeh}(h]h ]h"]h$]h&]noemphj4j5uh1jhjH ubeh}(h]h ]h"]h$]h&]j4j5uh1j{hj hhhj hMRubeh}(h]h ]h"]h$]h&]j4j5juh1j3jjhj hhhj hMRubah}(h]j ah ](jjeh"]h$]h&]jj)jhuh1j-hj hMRhj hhubj)}(hhh]h)}(h0get obj value encoded from (, )h]h0get obj value encoded from (, )}(hj$ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chMNhj! hhubah}(h]h ]h"]h$]h&]uh1jhj hhhj hMRubeh}(h]h ](jfunctioneh"]h$]h&]jjjj< jj< jj j uh1j(hhhjhNhNubj )}(ht**Parameters** ``struct zpdesc *zpdesc`` zpdesc object resides in zspage ``unsigned int obj_idx`` object indexh](h)}(h**Parameters**h]j )}(hjF h]h Parameters}(hjH hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjD ubah}(h]h ]h"]h$]h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chMRhj@ ubj7)}(hhh](j<)}(h:``struct zpdesc *zpdesc`` zpdesc object resides in zspage h](jB)}(h``struct zpdesc *zpdesc``h]j )}(hje h]hstruct zpdesc *zpdesc}(hjg hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjc ubah}(h]h ]h"]h$]h&]uh1jAhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chMOhj_ ubjR)}(hhh]h)}(hzpdesc object resides in zspageh]hzpdesc object resides in zspage}(hj~ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjz hMOhj{ ubah}(h]h ]h"]h$]h&]uh1jQhj_ ubeh}(h]h ]h"]h$]h&]uh1j;hjz hMOhj\ ubj<)}(h%``unsigned int obj_idx`` object indexh](jB)}(h``unsigned int obj_idx``h]j )}(hj h]hunsigned int obj_idx}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubah}(h]h ]h"]h$]h&]uh1jAhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chMQhj ubjR)}(hhh]h)}(h object indexh]h object index}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chMPhj ubah}(h]h ]h"]h$]h&]uh1jQhj ubeh}(h]h ]h"]h$]h&]uh1j;hj hMQhj\ ubeh}(h]h ]h"]h$]h&]uh1j6hj@ ubeh}(h]h ] kernelindentah"]h$]h&]uh1j hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j$"zs_lookup_class_index (C function)c.zs_lookup_class_indexhNtauh1jhjhhhNhNubj))}(hhh](j.)}(hLunsigned int zs_lookup_class_index (struct zs_pool *pool, unsigned int size)h]j4)}(hKunsigned int zs_lookup_class_index(struct zs_pool *pool, unsigned int size)h](j:)}(hunsignedh]hunsigned}(hj hhhNhNubah}(h]h ]jFah"]h$]h&]uh1j9hj hhhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chMlubjL)}(h h]h }(hj hhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhj hhhj hMlubj:)}(hinth]hint}(hj hhhNhNubah}(h]h ]jFah"]h$]h&]uh1j9hj hhhj hMlubjL)}(h h]h }(hj# hhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhj hhhj hMlubj])}(hzs_lookup_class_indexh]jc)}(hzs_lookup_class_indexh]hzs_lookup_class_index}(hj5 hhhNhNubah}(h]h ]joah"]h$]h&]uh1jbhj1 ubah}(h]h ](jvjweh"]h$]h&]j4j5uh1j\hj hhhj hMlubj|)}(h)(struct zs_pool *pool, unsigned int size)h](j)}(hstruct zs_pool *poolh](j)}(hjh]hstruct}(hjQ hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjM ubjL)}(h h]h }(hj^ hhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhjM ubh)}(hhh]jc)}(hzs_poolh]hzs_pool}(hjo hhhNhNubah}(h]h ]joah"]h$]h&]uh1jbhjl ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjq modnameN classnameNjj)}j]j)}jj7 sbc.zs_lookup_class_indexasbuh1hhjM ubjL)}(h h]h }(hj hhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhjM ubj2)}(hjh]h*}(hj hhhNhNubah}(h]h ]j=ah"]h$]h&]uh1j1hjM ubjc)}(hpoolh]hpool}(hj hhhNhNubah}(h]h ]joah"]h$]h&]uh1jbhjM ubeh}(h]h ]h"]h$]h&]noemphj4j5uh1jhjI ubj)}(hunsigned int sizeh](j:)}(hunsignedh]hunsigned}(hj hhhNhNubah}(h]h ]jFah"]h$]h&]uh1j9hj ubjL)}(h h]h }(hj hhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhj ubj:)}(hinth]hint}(hj hhhNhNubah}(h]h ]jFah"]h$]h&]uh1j9hj ubjL)}(h h]h }(hj hhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhj ubjc)}(hsizeh]hsize}(hj hhhNhNubah}(h]h ]joah"]h$]h&]uh1jbhj ubeh}(h]h ]h"]h$]h&]noemphj4j5uh1jhjI ubeh}(h]h ]h"]h$]h&]j4j5uh1j{hj hhhj hMlubeh}(h]h ]h"]h$]h&]j4j5juh1j3jjhj hhhj hMlubah}(h]j ah ](jjeh"]h$]h&]jj)jhuh1j-hj hMlhj hhubj)}(hhh]h)}(hZReturns index of the zsmalloc :c:type:`size_class` that hold objects of the provided size.h](hReturns index of the zsmalloc }(hj% hhhNhNubh)}(h:c:type:`size_class`h]j )}(hj/ h]h size_class}(hj1 hhhNhNubah}(h]h ](xrefjc-typeeh"]h$]h&]uh1j hj- ubah}(h]h ]h"]h$]h&]refdoc mm/zsmalloc refdomainjreftypetype refexplicitrefwarnjj)}j]j c.zs_lookup_class_indexasb reftarget size_classuh1hhjJhMAhj% ubh( that hold objects of the provided size.}(hj% hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chMbhj" hhubah}(h]h ]h"]h$]h&]uh1jhj hhhj hMlubeh}(h]h ](jfunctioneh"]h$]h&]jjjjh jjh jj j uh1j(hhhjhNhNubj )}(h**Parameters** ``struct zs_pool *pool`` zsmalloc pool to use ``unsigned int size`` object size **Context** Any context. **Return** the index of the zsmalloc :c:type:`size_class` that hold objects of the provided size.h](h)}(h**Parameters**h]j )}(hjr h]h Parameters}(hjt hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjp ubah}(h]h ]h"]h$]h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chMfhjl ubj7)}(hhh](j<)}(h.``struct zs_pool *pool`` zsmalloc pool to use h](jB)}(h``struct zs_pool *pool``h]j )}(hj h]hstruct zs_pool *pool}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubah}(h]h ]h"]h$]h&]uh1jAhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chMdhj ubjR)}(hhh]h)}(hzsmalloc pool to useh]hzsmalloc pool to use}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hMdhj ubah}(h]h ]h"]h$]h&]uh1jQhj ubeh}(h]h ]h"]h$]h&]uh1j;hj hMdhj ubj<)}(h"``unsigned int size`` object size h](jB)}(h``unsigned int size``h]j )}(hj h]hunsigned int size}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubah}(h]h ]h"]h$]h&]uh1jAhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chMehj ubjR)}(hhh]h)}(h object sizeh]h object size}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hMehj ubah}(h]h ]h"]h$]h&]uh1jQhj ubeh}(h]h ]h"]h$]h&]uh1j;hj hMehj ubeh}(h]h ]h"]h$]h&]uh1j6hjl ubh)}(h **Context**h]j )}(hjh]hContext}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chMghjl ubh)}(h Any context.h]h Any context.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chMghjl ubh)}(h **Return**h]j )}(hj,h]hReturn}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj*ubah}(h]h ]h"]h$]h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chMihjl ubh)}(hVthe index of the zsmalloc :c:type:`size_class` that hold objects of the provided size.h](hthe index of the zsmalloc }(hjBhhhNhNubh)}(h:c:type:`size_class`h]j )}(hjLh]h size_class}(hjNhhhNhNubah}(h]h ](j; jc-typeeh"]h$]h&]uh1j hjJubah}(h]h ]h"]h$]h&]refdocjG refdomainjreftypetype refexplicitrefwarnjj)}j]sbjR size_classuh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chMihjBubh( that hold objects of the provided size.}(hjBhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjlhMihjl ubeh}(h]h ] kernelindentah"]h$]h&]uh1j hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j$zs_huge_class_size (C function)c.zs_huge_class_sizehNtauh1jhjhhhNhNubj))}(hhh](j.)}(h0size_t zs_huge_class_size (struct zs_pool *pool)h]j4)}(h/size_t zs_huge_class_size(struct zs_pool *pool)h](h)}(hhh]jc)}(hsize_th]hsize_t}(hjhhhNhNubah}(h]h ]joah"]h$]h&]uh1jbhjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjmodnameN classnameNjj)}j]j)}jzs_huge_class_sizesbc.zs_huge_class_sizeasbuh1hhjhhhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chMubjL)}(h h]h }(hjhhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhjhhhjhMubj])}(hzs_huge_class_sizeh]jc)}(hjh]hzs_huge_class_size}(hjhhhNhNubah}(h]h ]joah"]h$]h&]uh1jbhjubah}(h]h ](jvjweh"]h$]h&]j4j5uh1j\hjhhhjhMubj|)}(h(struct zs_pool *pool)h]j)}(hstruct zs_pool *poolh](j)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjL)}(h h]h }(hjhhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhjubh)}(hhh]jc)}(hzs_poolh]hzs_pool}(hjhhhNhNubah}(h]h ]joah"]h$]h&]uh1jbhjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj modnameN classnameNjj)}j]jc.zs_huge_class_sizeasbuh1hhjubjL)}(h h]h }(hj%hhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhjubj2)}(hjh]h*}(hj3hhhNhNubah}(h]h ]j=ah"]h$]h&]uh1j1hjubjc)}(hpoolh]hpool}(hj@hhhNhNubah}(h]h ]joah"]h$]h&]uh1jbhjubeh}(h]h ]h"]h$]h&]noemphj4j5uh1jhjubah}(h]h ]h"]h$]h&]j4j5uh1j{hjhhhjhMubeh}(h]h ]h"]h$]h&]j4j5juh1j3jjhjhhhjhMubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1j-hjhMhjhhubj)}(hhh]h)}(hLReturns the size (in bytes) of the first huge zsmalloc :c:type:`size_class`.h](h7Returns the size (in bytes) of the first huge zsmalloc }(hjjhhhNhNubh)}(h:c:type:`size_class`h]j )}(hjth]h size_class}(hjvhhhNhNubah}(h]h ](j; jc-typeeh"]h$]h&]uh1j hjrubah}(h]h ]h"]h$]h&]refdocjG refdomainjreftypetype refexplicitrefwarnjj)}j]jc.zs_huge_class_sizeasbjR size_classuh1hhjJhMAhjjubh.}(hjjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chMhjghhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhMubeh}(h]h ](jfunctioneh"]h$]h&]jjjjjjjj j uh1j(hhhjhNhNubj )}(hXX**Parameters** ``struct zs_pool *pool`` zsmalloc pool to use **Description** The function returns the size of the first huge class - any object of equal or bigger size will be stored in zspage consisting of a single physical page. **Context** Any context. **Return** the size (in bytes) of the first huge zsmalloc :c:type:`size_class`.h](h)}(h**Parameters**h]j )}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chMhjubj7)}(hhh]j<)}(h.``struct zs_pool *pool`` zsmalloc pool to use h](jB)}(h``struct zs_pool *pool``h]j )}(hjh]hstruct zs_pool *pool}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]uh1jAhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chMhjubjR)}(hhh]h)}(hzsmalloc pool to useh]hzsmalloc pool to use}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jQhjubeh}(h]h ]h"]h$]h&]uh1j;hjhMhjubah}(h]h ]h"]h$]h&]uh1j6hjubh)}(h**Description**h]j )}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubah}(h]h ]h"]h$]h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chMhjubh)}(hThe function returns the size of the first huge class - any object of equal or bigger size will be stored in zspage consisting of a single physical page.h]hThe function returns the size of the first huge class - any object of equal or bigger size will be stored in zspage consisting of a single physical page.}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chMhjubh)}(h **Context**h]j )}(hj5h]hContext}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj3ubah}(h]h ]h"]h$]>h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chMhjubh)}(h Any context.h]h Any context.}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chMhjubh)}(h **Return**h]j )}(hj\h]hReturn}(hj^hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjZubah}(h]h ]h"]h$]h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chMhjubh)}(hDthe size (in bytes) of the first huge zsmalloc :c:type:`size_class`.h](h/the size (in bytes) of the first huge zsmalloc }(hjrhhhNhNubh)}(h:c:type:`size_class`h]j )}(hj|h]h size_class}(hj~hhhNhNubah}(h]h ](j; jc-typeeh"]h$]h&]uh1j hjzubah}(h]h ]h"]h$]h&]refdocjG refdomainjreftypetype refexplicitrefwarnjjhjR size_classuh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chMhjrubh.}(hjrhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjhMhjubeh}(h]h ] kernelindentah"]h$]h&]uh1j hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j$zs_malloc (C function) c.zs_mallochNtauh1jhjhhhNhNubj))}(hhh](j.)}(hFunsigned long zs_malloc (struct zs_pool *pool, size_t size, gfp_t gfp)h]j4)}(hEunsigned long zs_malloc(struct zs_pool *pool, size_t size, gfp_t gfp)h](j:)}(hunsignedh]hunsigned}(hjhhhNhNubah}(h]h ]jFah"]h$]h&]uh1j9hjhhhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chM@ubjL)}(h h]h }(hjhhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhjhhhjhM@ubj:)}(hlongh]hlong}(hjhhhNhNubah}(h]h ]jFah"]h$]h&]uh1j9hjhhhjhM@ubjL)}(h h]h }(hjhhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhjhhhjhM@ubj])}(h zs_malloch]jc)}(h zs_malloch]h zs_malloc}(hjhhhNhNubah}(h]h ]joah"]h$]h&]uh1jbhjubah}(h]h ](jvjweh"]h$]h&]j4j5uh1j\hjhhhjhM@ubj|)}(h.(struct zs_pool *pool, size_t size, gfp_t gfp)h](j)}(hstruct zs_pool *poolh](j)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjL)}(h h]h }(hj*hhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhjubh)}(hhh]jc)}(hzs_poolh]hzs_pool}(hj;hhhNhNubah}(h]h ]joah"]h$]h&]uh1jbhj8ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj=modnameN classnameNjj)}j]j)}jjsb c.zs_mallocasbuh1hhjubjL)}(h h]h }(hj[hhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhjubj2)}(hjh]h*}(hjihhhNhNubah}(h]h ]j=ah"]h$]h&]uh1j1hjubjc)}(hpoolh]hpool}(hjvhhhNhNubah}(h]h ]joah"]h$]h&]uh1jbhjubeh}(h]h ]h"]h$]h&]noemphj4j5uh1jhjubj)}(h size_t sizeh](h)}(hhh]jc)}(hsize_th]hsize_t}(hjhhhNhNubah}(h]h ]joah"]h$]h&]uh1jbhjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjmodnameN classnameNjj)}j]jW c.zs_mallocasbuh1hhjubjL)}(h h]h }(hjhhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhjubjc)}(hsizeh]hsize}(hjhhhNhNubah}(h]h ]joah"]h$]h&]uh1jbhjubeh}(h]h ]h"]h$]h&]noemphj4j5uh1jhjubj)}(h gfp_t gfph](h)}(hhh]jc)}(hgfp_th]hgfp_t}(hjhhhNhNubah}(h]h ]joah"]h$]h&]uh1jbhjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjmodnameN classnameNjj)}j]jW c.zs_mallocasbuh1hhjubjL)}(h h]h }(hjhhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhjubjc)}(hgfph]hgfp}(hjhhhNhNubah}(h]h ]joah"]h$]h&]uh1jbhjubeh}(h]h ]h"]h$]h&]noemphj4j5uh1jhjubeh}(h]h ]h"]h$]h&]j4j5uh1j{hjhhhjhM@ubeh}(h]h ]h"]h$]h&]j4j5juh1j3jjhjhhhjhM@ubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1j-hjhM@hjhhubj)}(hhh]h)}(h'Allocate block of given size from pool.h]h'Allocate block of given size from pool.}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chM7hj-hhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhM@ubeh}(h]h ](jfunctioneh"]h$]h&]jjjjHjjHjj j uh1j(hhhjhNhNubj )}(hX>**Parameters** ``struct zs_pool *pool`` pool to allocate from ``size_t size`` size of block to allocate ``gfp_t gfp`` gfp flags when allocating object **Description** On success, handle to the allocated object is returned, otherwise an ERR_PTR(). Allocation requests with size > ZS_MAX_ALLOC_SIZE will fail.h](h)}(h**Parameters**h]j )}(hjRh]h Parameters}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1j hjPubah}(h]h ]h"]h$]h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chM;hjLubj7)}(hhh](j<)}(h/``struct zs_pool *pool`` pool to allocate from h](jB)}(h``struct zs_pool *pool``h]j )}(hjqh]hstruct zs_pool *pool}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1j hjoubah}(h]h ]h"]h$]h&]uh1jAhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chM8hjkubjR)}(hhh]h)}(hpool to allocate fromh]hpool to allocate from}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM8hjubah}(h]h ]h"]h$]h&]uh1jQhjkubeh}(h]h ]h"]h$]h&]uh1j;hjhM8hjhubj<)}(h*``size_t size`` size of block to allocate h](jB)}(h``size_t size``h]j )}(hjh]h size_t size}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]uh1jAhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chM9hjubjR)}(hhh]h)}(hsize of block to allocateh]hsize of block to allocate}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM9hjubah}(h]h ]h"]h$]h&]uh1jQhjubeh}(h]h ]h"]h$]h&]uh1j;hjhM9hjhubj<)}(h/``gfp_t gfp`` gfp flags when allocating object h](jB)}(h ``gfp_t gfp``h]j )}(hjh]h gfp_t gfp}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]uh1jAhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chM:hjubjR)}(hhh]h)}(h gfp flags when allocating objecth]h gfp flags when allocating object}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM:hjubah}(h]h ]h"]h$]h&]uh1jQhjubeh}(h]h ]h"]h$]h&]uh1j;hjhM:hjhubeh}(h]h ]h"]h$]h&]uh1j6hjLubh)}(h**Description**h]j )}(hjh]h Description}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chM<hjLubh)}(hOn success, handle to the allocated object is returned, otherwise an ERR_PTR(). Allocation requests with size > ZS_MAX_ALLOC_SIZE will fail.h]hOn success, handle to the allocated object is returned, otherwise an ERR_PTR(). Allocation requests with size > ZS_MAX_ALLOC_SIZE will fail.}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chM<hjLubeh}(h]h ] kernelindentah"]h$]h&]uh1j hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j$zs_create_pool (C function)c.zs_create_poolhNtauh1jhjhhhNhNubj))}(hhh](j.)}(h2struct zs_pool * zs_create_pool (const char *name)h]j4)}(h0struct zs_pool *zs_create_pool(const char *name)h](j)}(hjh]hstruct}(hjchhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj_hhhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chM5ubjL)}(h h]h }(hjqhhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhj_hhhjphM5ubh)}(hhh]jc)}(hzs_poolh]hzs_pool}(hjhhhNhNubah}(h]h ]joah"]h$]h&]uh1jbhjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjmodnameN classnameNjj)}j]j)}jzs_create_poolsbc.zs_create_poolasbuh1hhj_hhhjphM5ubjL)}(h h]h }(hjhhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhj_hhhjphM5ubj2)}(hjh]h*}(hjhhhNhNubah}(h]h ]j=ah"]h$]h&]uh1j1hj_hhhjphM5ubj])}(hzs_create_poolh]jc)}(hjh]hzs_create_pool}(hjhhhNhNubah}(h]h ]joah"]h$]h&]uh1jbhjubah}(h]h ](jvjweh"]h$]h&]j4j5uh1j\hj_hhhjphM5ubj|)}(h(const char *name)h]j)}(hconst char *nameh](j)}(hconsth]hconst}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjL)}(h h]h }(hjhhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhjubj:)}(hcharh]hchar}(hjhhhNhNubah}(h]h ]jFah"]h$]h&]uh1j9hjubjL)}(h h]h }(hjhhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhjubj2)}(hjh]h*}(hjhhhNhNubah}(h]h ]j=ah"]h$]h&]uh1j1hjubjc)}(hnameh]hname}(hj"hhhNhNubah}(h]h ]joah"]h$]h&]uh1jbhjubeh}(h]h ]h"]h$]h&]noemphj4j5uh1jhjubah}(h]h ]h"]h$]h&]j4j5uh1j{hj_hhhjphM5ubeh}(h]h ]h"]h$]h&]j4j5juh1j3jjhj[hhhjphM5ubah}(h]jVah ](jjeh"]h$]h&]jj)jhuh1j-hjphM5hjXhhubj)}(hhh]h)}(h(Creates an allocation pool to work from.h]h(Creates an allocation pool to work from.}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chM,hjIhhubah}(h]h ]h"]h$]h&]uh1jhjXhhhjphM5ubeh}(h]h ](jfunctioneh"]h$]h&]jjjjdjjdjj j uh1j(hhhjhNhNubj )}(h**Parameters** ``const char *name`` pool name to be created **Description** This function must be called before anything when using the zsmalloc allocator. On success, a pointer to the newly created pool is returned, otherwise NULL.h](h)}(h**Parameters**h]j )}(hjnh]h Parameters}(hjphhhNhNubah}(h]h ]h"]h$]h&]uh1j hjlubah}(h]h ]h"]h$]h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chM0hjhubj7)}(hhh]j<)}(h-``const char *name`` pool name to be created h](jB)}(h``const char *name``h]j )}(hjh]hconst char *name}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]uh1jAhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chM-hjubjR)}(hhh]h)}(hpool name to be createdh]hpool name to be created}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM-hjubah}(h]h ]h"]h$]h&]uh1jQhjubeh}(h]h ]h"]h$]h&]uh1j;hjhM-hjubah}(h]h ]h"]h$]h&]uh1j6hjhubh)}(h**Description**h]j )}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chM/hjhubh)}(hOThis function must be called before anything when using the zsmalloc allocator.h]hOThis function must be called before anything when using the zsmalloc allocator.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chM/hjhubh)}(hLOn success, a pointer to the newly created pool is returned, otherwise NULL.h]hLOn success, a pointer to the newly created pool is returned, otherwise NULL.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhJ/var/lib/git/docbuild/linux/Documentation/mm/zsmalloc:269: ./mm/zsmalloc.chM2hjhubeh}(h]h ] kernelindentah"]h$]h&]uh1j hjhhhNhNubeh}(h] functionsah ]h"] functionsah$]h&]uh1hhhhhhhhM ubeh}(h]zsmallocah ]h"]zsmallocah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj6error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(jj jjjjjjjju nametypes}(jjjjjuh}(j hjhjjjjjjj&j/j j j j jjjjjVj[u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.