os.cpp (242:d95b224e9f17) os.cpp (477:24fda36852ce)
1/*
2 * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *

--- 918 unchanged lines hidden (view full) ---

927void os::serialize_thread_states() {
928 // On some platforms such as Solaris & Linux, the time duration of the page
929 // permission restoration is observed to be much longer than expected due to
930 // scheduler starvation problem etc. To avoid the long synchronization
931 // time and expensive page trap spinning, 'SerializePageLock' is used to block
932 // the mutator thread if such case is encountered. See bug 6546278 for details.
933 Thread::muxAcquire(&SerializePageLock, "serialize_thread_states");
934 os::protect_memory((char *)os::get_memory_serialize_page(),
1/*
2 * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *

--- 918 unchanged lines hidden (view full) ---

927void os::serialize_thread_states() {
928 // On some platforms such as Solaris & Linux, the time duration of the page
929 // permission restoration is observed to be much longer than expected due to
930 // scheduler starvation problem etc. To avoid the long synchronization
931 // time and expensive page trap spinning, 'SerializePageLock' is used to block
932 // the mutator thread if such case is encountered. See bug 6546278 for details.
933 Thread::muxAcquire(&SerializePageLock, "serialize_thread_states");
934 os::protect_memory((char *)os::get_memory_serialize_page(),
935 os::vm_page_size(), MEM_PROT_READ, /*is_committed*/true );
936 os::unguard_memory((char *)os::get_memory_serialize_page(), os::vm_page_size());
935 os::vm_page_size(), MEM_PROT_READ);
936 os::protect_memory((char *)os::get_memory_serialize_page(),
937 os::vm_page_size(), MEM_PROT_RW);
937 Thread::muxRelease(&SerializePageLock);
938}
939
940// Returns true if the current stack pointer is above the stack shadow
941// pages, false otherwise.
942
943bool os::stack_shadow_pages_available(Thread *thread, methodHandle method) {
944 assert(StackRedPages > 0 && StackYellowPages > 0,"Sanity check");

--- 101 unchanged lines hidden ---
938 Thread::muxRelease(&SerializePageLock);
939}
940
941// Returns true if the current stack pointer is above the stack shadow
942// pages, false otherwise.
943
944bool os::stack_shadow_pages_available(Thread *thread, methodHandle method) {
945 assert(StackRedPages > 0 && StackYellowPages > 0,"Sanity check");

--- 101 unchanged lines hidden ---