RFR: Hint unused regions instead of uncommit them

Aleksey Shipilev shade at redhat.com
Tue Jan 16 11:49:53 UTC 2018


On 01/15/2018 06:21 PM, Zhengyu Gu wrote:
> This patch adds new experimental flag ShenandoahIdleRegions (default to false) to hint kernel that
> the regions are not needed (vs. madvise(MADV_DONTNEED), instead of proactively uncommitting.
> 
> It appears that does have advantage over uncommitting regions, although, not by as much as I was
> expected.
> 
> SPECjbb2015:
> 
> Baseline:
> RUN RESULT: hbIR (max attempted) = 59167, hbIR (settled) = 51984, max-jOPS = 47925, critical-jOPS =
> 19108
> 
> -XX:ShenandoahUncommitDelay=0 -XX:-ShenandoahIdleRegions
> RUN RESULT: hbIR (max attempted) = 41119, hbIR (settled) = 36501, max-jOPS = 30839, critical-jOPS =
> 8841
> 
> -XX:ShenandoahUncommitDelay=0 -XX:+ShenandoahIdleRegions
> RUN RESULT: hbIR (max attempted) = 49322, hbIR (settled) = 42968, max-jOPS = 35019, critical-jOPS =
> 9283
> 
> 
> Webrev: http://cr.openjdk.java.net/~zgu/shenandoah/idle_region/webrev.00/

As I read MADV_DONTNEED man page and the explanations of different kernel people, I am getting
uneasy using this. madvise call that basically corrupts memory, say what? And it also does not
support large pages...

It _maybe_ makes sense to optionally support this, but only if we make the code changes minimal. It
looks like the fair bit of complexity comes from the attempt to fallback to commit/uncommit when
idling fails. Could we just test that idle/activate_memory works, and select one of the options
without fallback? E.g. when ShenandoahIdleRegions is true, LargePages is false, and idling works,
make do_commit/do_uncommit only do idle_memory/activate_memory, and fail hard when idle_memory
returns false. You would not need the _idle_region flag too then.

Thanks,
-ALeksey



More information about the shenandoah-dev mailing list