Change default chunk size from 4 MiB to 256 KiB.
Recent changes have improved huge allocation scalability, which removes upward pressure to set the chunk size so large that huge allocations are rare. Smaller chunks are more likely to completely drain, so set the default to the smallest size that doesn't leave excessive unusable trailing space in chunk headers.
This commit is contained in:
parent
4d871f73af
commit
f044bb219e
@ -571,8 +571,8 @@ for (i = 0; i < nbins; i++) {
|
|||||||
both large or both huge. In such cases shrinkage always succeeds, but
|
both large or both huge. In such cases shrinkage always succeeds, but
|
||||||
growth only succeeds if the trailing memory is currently available.</para>
|
growth only succeeds if the trailing memory is currently available.</para>
|
||||||
|
|
||||||
<para>Assuming 4 MiB chunks, 4 KiB pages, and a 16-byte quantum on a 64-bit
|
<para>Assuming 256 KiB chunks, 4 KiB pages, and a 16-byte quantum on a
|
||||||
system, the size classes in each category are as shown in <xref
|
64-bit system, the size classes in each category are as shown in <xref
|
||||||
linkend="size_classes" xrefstyle="template:Table %n"/>.</para>
|
linkend="size_classes" xrefstyle="template:Table %n"/>.</para>
|
||||||
|
|
||||||
<table xml:id="size_classes" frame="all">
|
<table xml:id="size_classes" frame="all">
|
||||||
@ -627,7 +627,7 @@ for (i = 0; i < nbins; i++) {
|
|||||||
<entry>[10 KiB, 12 KiB, 14 KiB]</entry>
|
<entry>[10 KiB, 12 KiB, 14 KiB]</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry morerows="8">Large</entry>
|
<entry morerows="4">Large</entry>
|
||||||
<entry>2 KiB</entry>
|
<entry>2 KiB</entry>
|
||||||
<entry>[16 KiB]</entry>
|
<entry>[16 KiB]</entry>
|
||||||
</row>
|
</row>
|
||||||
@ -645,7 +645,12 @@ for (i = 0; i < nbins; i++) {
|
|||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>32 KiB</entry>
|
<entry>32 KiB</entry>
|
||||||
<entry>[160 KiB, 192 KiB, 224 KiB, 256 KiB]</entry>
|
<entry>[160 KiB, 192 KiB, 224 KiB]</entry>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<entry morerows="9">Huge</entry>
|
||||||
|
<entry>32 KiB</entry>
|
||||||
|
<entry>[256 KiB]</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>64 KiB</entry>
|
<entry>64 KiB</entry>
|
||||||
@ -653,20 +658,15 @@ for (i = 0; i < nbins; i++) {
|
|||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>128 KiB</entry>
|
<entry>128 KiB</entry>
|
||||||
<entry>[640 KiB, 768 KiB, 896 KiB, 1024 KiB]</entry>
|
<entry>[640 KiB, 768 KiB, 896 KiB, 1 MiB]</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>256 KiB</entry>
|
<entry>256 KiB</entry>
|
||||||
<entry>[1280 KiB, 1536 KiB, 1792 KiB, 2048 KiB]</entry>
|
<entry>[1280 KiB, 1536 KiB, 1792 KiB, 2 MiB]</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>512 KiB</entry>
|
<entry>512 KiB</entry>
|
||||||
<entry>[2560 KiB, 3072 KiB, 3584 KiB]</entry>
|
<entry>[2560 KiB, 3 MiB, 3584 KiB, 4 MiB]</entry>
|
||||||
</row>
|
|
||||||
<row>
|
|
||||||
<entry morerows="5">Huge</entry>
|
|
||||||
<entry>512 KiB</entry>
|
|
||||||
<entry>[4 MiB]</entry>
|
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>1 MiB</entry>
|
<entry>1 MiB</entry>
|
||||||
@ -907,7 +907,7 @@ for (i = 0; i < nbins; i++) {
|
|||||||
<listitem><para>Virtual memory chunk size (log base 2). If a chunk
|
<listitem><para>Virtual memory chunk size (log base 2). If a chunk
|
||||||
size outside the supported size range is specified, the size is
|
size outside the supported size range is specified, the size is
|
||||||
silently clipped to the minimum/maximum supported size. The default
|
silently clipped to the minimum/maximum supported size. The default
|
||||||
chunk size is 4 MiB (2^22).
|
chunk size is 256 KiB (2^18).
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* Size and alignment of memory chunks that are allocated by the OS's virtual
|
* Size and alignment of memory chunks that are allocated by the OS's virtual
|
||||||
* memory system.
|
* memory system.
|
||||||
*/
|
*/
|
||||||
#define LG_CHUNK_DEFAULT 22
|
#define LG_CHUNK_DEFAULT 18
|
||||||
|
|
||||||
/* Return the chunk address for allocation address a. */
|
/* Return the chunk address for allocation address a. */
|
||||||
#define CHUNK_ADDR2BASE(a) \
|
#define CHUNK_ADDR2BASE(a) \
|
||||||
|
Loading…
Reference in New Issue
Block a user