RFR (S): 8214816: os::read() should not transition to _thread_blocked with safepoint check on Solaris

David Holmes david.holmes at oracle.com
Thu Jan 10 20:41:39 UTC 2019


On 10/01/2019 3:27 pm, Jiangli Zhou wrote:
> Hi David,
> 
> The history lesson on os::read is fascinating! The cleanup looks nice to 
> me.

Thanks for looking at it Jiangli!

> src/hotspot/os/windows/os_windows.cpp copyright year also needs update.

Fixed.

Thanks,
David

> Thanks,
> 
> Jiangli
> 
> 
> On 1/9/19 5:00 PM, David Holmes wrote:
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8214816
>> webrev: http://cr.openjdk.java.net/~dholmes/8214816/webrev/
>>
>> Please see the bug report for detailed background. In short summary 
>> all platforms now have the same os::read and os::read_at that doesn't 
>> do safepoint checks. Most of the changes are code deletions:
>>
>> - removed unused os::restartable_read() method
>> - removed os::read from all os_*.cpp files and added shared inline 
>> definition in os.inline.hpp (checked all callsites already have 
>> os.inline.hpp included)
>> - removed os::read_at from all non-Windows os_*.cpp files and added 
>> shared definition in os_posix.cpp (simple wrapper to pread())
>> - fixed the return type of os::read and os::read_at to be ssize_t not 
>> size_t.
>>
>> Also fixed os::read error handling in 
>> src/hotspot/share/compiler/directivesParser.cpp, and filed JDK-8216461 
>> to have a JFR usage of os::read_at fixed.
>>
>> Also changed src/hotspot/share/runtime/arguments.cpp to use os::read 
>> as it no longer needs to avoid the thread-state-transition. Arguably 
>> we could go the other way here and remove os::read completely and use 
>> the native ::read on all platforms - there are already uses of ::read 
>> elsewhere in the code.
>>
>> Testing: Mach5 tiers 1 - 3
>>
>> Thanks,
>> David
> 


More information about the hotspot-dev mailing list