review(XS): 7145345: Code cache sweeper must cooperate with safepoints

Tom Rodriguez tom.rodriguez at oracle.com
Tue Feb 14 14:31:17 PST 2012


On Feb 14, 2012, at 2:10 PM, Igor Veresov wrote:

> On Tuesday, February 14, 2012 at 1:20 PM, Tom Rodriguez wrote:
>> 
>> On Feb 14, 2012, at 1:08 PM, Igor Veresov wrote:
>> 
>>> I tried that. It made no measurable difference. I figured it's better to start running a compile while we're doing GC, which is what will happen after the bailout.
>> 
>> So it's not about yielding to a safepoint? It's about starting the compile sooner?
> No-no, starting compiler is just an alternative of entering a safepoint. The choices basically are:
> 1. Safepoint right in the sweeper and continue sweeping after the safepoint.
> 2. Bailout from the sweeper but safepoint immediately, don't select the task from the compile queue and don't compile.
> 3. Bailout and processed with selecting the task and transition to native to compile (at which point a safepoint will happen).
> 
> So, I chose (3) because the process of selecting a task from the queue and transitioning to native to start a compile appear to be fast enough. 

But it can arbitrarily starve the sweeper if we're safepointing often enough, like for scavenges.

>> Then I think you should gate the amount of work the sweeper does instead. That would actually tend to distribute the sweeper work between different compiler threads better. Right now a single compile can be delayed a long time because it's trying to process a quarter of the cache.
> You're right. The a big fraction can starve compilation. I guess I could change the code to use a concrete amount of methods to sweep instead of the fraction. Fractions are not very convenient. But the bailout will be necessary in any case.

I agree that we need to allow safepoints in the sweeper loop but I'd rather not simply abort the sweeper loop if a safepoint happens in the middle.  That just seems arbitrary.

Maybe the sweeper should have a time limit instead?

tom

> 
>  igor
>> 
>> tom
>> 
>>> 
>>> igor
>>> 
>>> On Tuesday, February 14, 2012 at 1:04 PM, Tom Rodriguez wrote:
>>> 
>>>> 
>>>> On Feb 14, 2012, at 12:36 PM, Igor Veresov wrote:
>>>> 
>>>>> Code cache sweeper must yield to safepoint. With high numbers of methods sweeping can block the safepoint from happening.
>>>> 
>>>> Why don't you just safepoint instead of aborting the current sweep?
>>>> 
>>>> We may also want to increase the sweep fraction for tiered.
>>>> 
>>>> tom
>>>> 
>>>>> 
>>>>> Webrev: http://cr.openjdk.java.net/~iveresov/7145345/webrev.00/
>>>>> 
>>>>> 
>>>>> igor
> 



More information about the hotspot-compiler-dev mailing list