[sgen] Fix accidental triggering of degraded mode
authorVlad Brezae <brezaevlad@gmail.com>
Wed, 3 May 2017 14:11:00 +0000 (17:11 +0300)
committerVlad Brezae <brezaevlad@gmail.com>
Wed, 3 May 2017 14:11:00 +0000 (17:11 +0300)
commit94fe3dfb62f08b5f938d862e7fce4e674f27fbc9
tree645ca7b1c9b9bbc7506df54aade18dc17d264250
parent5e7137b6fee0d51acc9569f9f85bacda52592db6
[sgen] Fix accidental triggering of degraded mode

We trigger degraded mode when we are unable to properly build the nursery fragments due to excessive nursery pinning. This is done by initializing degraded_mode at the end of a minor. alloc_degraded is used to do allocation to major heap either as part of mature allocation or as part of degraded mode (when we bump the degraded_mode so we can detect when the next minor should be triggered).

When failing to allocate from the nursery after doing a minor (because the other threads might have already consumed the nursery) we need to do a mature allocation (as a fallback) instead of a degraded mode allocation so we don't uselessly enable the mode.
mono/sgen/sgen-alloc.c