CR review request for 6880029

Tom Rodriguez Thomas.Rodriguez at Sun.COM
Wed Sep 23 16:21:52 PDT 2009

That looks much better.  Any reason not to put it above the _state =  
_synchronizing statement?  That's really the first point where a  
thread could begin to see that a safepoint is occurring and it would  
avoid any later changes to statistics collection running into the same  
initialization problem.


On Sep 23, 2009, at 4:13 PM, Xiaobin Lu wrote:

> Webrev:
> Details:
> When "PrintSafepointStatistics" is set, safepoint statistics will be  
> printed out when any safepoint reached. The current implementation  
> has a race when after "os::make_polling_page_unreacheable" is  
> called, but before "begin_statistics" is getting called. The problem  
> is that the compiler thread might call  
> SafepointSynchronize::handle_polling_page_exception during this time  
> window, and call inc_page_count to increment the page trap count.  
> The page trap count is stored in an array which hasn't been  
> malloc'ed at this point however.
> A fix is to move the initialization up before we call  
> os::making_polling_page_unreacheable and that is what I am doing in  
> the webrev. One thing to notice is that we have to check both  
> PrintSafepointStatistics and PrintStafepointStatisticsTimeout before  
> deferred_initilize_stat is called since both flag can be specified  
> separately. After the initialization, we can rely solely on  
> PrintSafepointStatistics.
> Thanks in advance!
> -Xiaobin

More information about the hotspot-dev mailing list