-
Raphael S. Carvalho authored
This patch registers the ARC shrinker by using the event handler list from BSD side. When ARC is initialized, it inserts the lowmem event handler into an external event handler list. lowmem basically signals the reclaiming thread which will then wake up to decide which approach should be used to shrink the ARC. The memory pressure on OSv is activated when the 20% watermark is reached, so the shrink policy will decide which shrinker should be called on such events. bsd_shrinker_init is the responsible to find the lowmem event handler from the external list, and integrate it into our shrinker infrastructure. arc_lowmem needed few changes to return the amount of released memory from the ARC. Glauber and I tested the functionality by filling up the ARC up to its target, then allocating as much memory as possible to see if the ARC shrinker would take place to release memory back to the operating system. Signed-off-by:
Glauber Costa <glommer@cloudius-systems.com> Signed-off-by:
Raphael S. Carvalho <raphaelsc@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
Raphael S. Carvalho authoredThis patch registers the ARC shrinker by using the event handler list from BSD side. When ARC is initialized, it inserts the lowmem event handler into an external event handler list. lowmem basically signals the reclaiming thread which will then wake up to decide which approach should be used to shrink the ARC. The memory pressure on OSv is activated when the 20% watermark is reached, so the shrink policy will decide which shrinker should be called on such events. bsd_shrinker_init is the responsible to find the lowmem event handler from the external list, and integrate it into our shrinker infrastructure. arc_lowmem needed few changes to return the amount of released memory from the ARC. Glauber and I tested the functionality by filling up the ARC up to its target, then allocating as much memory as possible to see if the ARC shrinker would take place to release memory back to the operating system. Signed-off-by:
Glauber Costa <glommer@cloudius-systems.com> Signed-off-by:
Raphael S. Carvalho <raphaelsc@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>