mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-04-06 17:49:11 +03:00
Set arc_c_min properly in userland builds
Since it's set to arc_c_max / 2, it must be set after arc_c_max is set. Also added protection against it falling below 2 * maxblocksize in userland builds. Signed-off-by: Tim Chase <tim@chase2k.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #4268
This commit is contained in:
parent
1b8951b319
commit
0a1f8cd999
@ -5403,6 +5403,9 @@ arc_init(void)
|
|||||||
arc_need_free = 0;
|
arc_need_free = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Set max to 1/2 of all memory */
|
||||||
|
arc_c_max = allmem / 2;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* In userland, there's only the memory pressure that we artificially
|
* In userland, there's only the memory pressure that we artificially
|
||||||
* create (see arc_available_memory()). Don't let arc_c get too
|
* create (see arc_available_memory()). Don't let arc_c get too
|
||||||
@ -5410,14 +5413,11 @@ arc_init(void)
|
|||||||
* arc_c, causing arc_tempreserve_space() to fail.
|
* arc_c, causing arc_tempreserve_space() to fail.
|
||||||
*/
|
*/
|
||||||
#ifndef _KERNEL
|
#ifndef _KERNEL
|
||||||
arc_c_min = arc_c_max / 2;
|
arc_c_min = MAX(arc_c_max / 2, 2ULL << SPA_MAXBLOCKSHIFT);
|
||||||
#else
|
#else
|
||||||
arc_c_min = 2ULL << SPA_MAXBLOCKSHIFT;
|
arc_c_min = 2ULL << SPA_MAXBLOCKSHIFT;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Set max to 1/2 of all memory */
|
|
||||||
arc_c_max = allmem / 2;
|
|
||||||
|
|
||||||
arc_c = arc_c_max;
|
arc_c = arc_c_max;
|
||||||
arc_p = (arc_c >> 1);
|
arc_p = (arc_c >> 1);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user