zfsonlinux/zfs — pull request #660 by gentoofan (2012-04-12 21:29:57+00:00)
Title: 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 to set arc_c_max to 1/3 of system memory, which
effectively limits arc_c_max to [1/3,2/3) when internal fragmentation is
taken into account. The average of this is 1/2 of system memory, which
is much more reasonable than what was possible in the past.