Update ARC memory limits to account for SLUB internal fragmentation
authorRichard Yao <ryao@cs.stonybrook.edu>
Thu, 12 Apr 2012 21:22:08 +0000 (17:22 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 30 Apr 2012 17:04:34 +0000 (10:04 -0700)
commit518b4876022eee58b14903da09b99c01b8caa754
treea0bdfa0176975843ee8e56459e8f9e54c385661c
parent302f753f1657c05a4287226eeda1f53ae431b8a7
Update ARC memory limits to account for SLUB internal fragmentation

23bdb07d4e4c435205d25d3efdb5fef2d089ce5e updated the ARC memory limits
to be 1/2 of memory or all but 4GB. Unfortunately, these values assume
zero internal fragmentation in the SLUB allocator, when in reality, the
internal fragmentation could be as high as 50%, effectively doubling
memory usage. This poses clear safety issues, because it permits the
size of ARC to exceed system memory.

This patch changes this so that the default value of arc_c_max is always
1/2 of system memory. This effectively limits the ARC to the memory that
the system has physically installed.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #660
module/zfs/arc.c