920 // permission restoration is observed to be much longer than expected due to |
920 // permission restoration is observed to be much longer than expected due to |
921 // scheduler starvation problem etc. To avoid the long synchronization |
921 // scheduler starvation problem etc. To avoid the long synchronization |
922 // time and expensive page trap spinning, 'SerializePageLock' is used to block |
922 // time and expensive page trap spinning, 'SerializePageLock' is used to block |
923 // the mutator thread if such case is encountered. See bug 6546278 for details. |
923 // the mutator thread if such case is encountered. See bug 6546278 for details. |
924 Thread::muxAcquire(&SerializePageLock, "serialize_thread_states"); |
924 Thread::muxAcquire(&SerializePageLock, "serialize_thread_states"); |
925 os::protect_memory( (char *)os::get_memory_serialize_page(), os::vm_page_size() ); |
925 os::protect_memory((char *)os::get_memory_serialize_page(), |
926 os::unguard_memory( (char *)os::get_memory_serialize_page(), os::vm_page_size() ); |
926 os::vm_page_size(), MEM_PROT_READ, /*is_committed*/true ); |
|
927 os::unguard_memory((char *)os::get_memory_serialize_page(), os::vm_page_size()); |
927 Thread::muxRelease(&SerializePageLock); |
928 Thread::muxRelease(&SerializePageLock); |
928 } |
929 } |
929 |
930 |
930 // Returns true if the current stack pointer is above the stack shadow |
931 // Returns true if the current stack pointer is above the stack shadow |
931 // pages, false otherwise. |
932 // pages, false otherwise. |