Lines Matching refs:to

16  * 2 along with this work; if not, write to the Free Software Foundation,
134 The JVM binary needs to be built and run on pre-Solaris 9
136 header files. They are textually replicated here to allow
142 But ISM requires shared memory to achieve this and thus has many caveats.
143 MPSS is a fully transparent and is a cleaner way to get large pages.
145 giving the opportunity to use large pages on older systems it is
165 // Here are some liblgrp types from sys/lgrp_user.h to be able to
169 # define MADV_ACCESS_LWP 7 /* next LWP to access heavily */
172 # define MADV_ACCESS_MANY 8 /* many processes to access heavily */
224 // For diagnostics to print a message once. see run_periodic_checks
253 // This is common to all Solaris platforms so it is defined here,
297 // Store the new value before updating the cache to prevent a race
314 // Invalidate all the caches (happens to be the same as pd_init).
327 // 4812466: Make sure size doesn't allow the stack to wrap the address space.
348 // Workaround 4352906, avoid calls to thr_stksegment by
350 // some data, causing the value for ss_sp to be incorrect).
359 guarantee(os::Solaris::_main_stack_base != NULL, "Attempt to use null cached stack base");
390 // The saved state is used to restore the thread to
496 // be at most to LargePageSizeInBytes. Protect
497 // allocations from alignments up to illegal
528 // Query the number of cpus available to us.
545 // Make up an array to hold their ids.
559 // We also need to take care that the loop (below) terminates as the
562 // there's no reliable way to determine the maximum valid processor id,
565 // not too sparse". MAX_PROCESSOR_ID is used to ensure that we eventually
568 // In the future we'll be able to use sysconf(_SC_CPUID_MAX), but that's
576 // Make up an array to hold their ids.
610 // We assume we can assign processorid_t's to uint's.
612 "can't convert processorid_t to uint");
613 // Quick check to see if we won't succeed.
617 // Assign processor ids to the distribution.
618 // Try to shuffle processors to distribute work across boards,
626 // The next id, to limit loops.
636 // Step by "boards", then by "slot", copying to "assigned".
639 // previous calls, etc., so as to distribute several
641 // It would be nice to have an API that let us ask
642 // how many processes are bound to a processor,
706 "can't convert uint to processorid_t");
760 // If it is defined and we are able to locate $JAVA_HOME/jre/lib/<arch>,
761 // then we append a fake suffix "hotspot/libjvm[_g].so" to this path so
768 // code needs to be changed accordingly.
770 // The next few definitions allow the code to be verbatim:
788 // Found the full path to libjvm.so.
789 // Now cut the path to <java_home>/jre if we can.
821 * Where to look for native libraries
824 // Use dlinfo() to determine the correct java.library.path.
868 // Note: Due to a legacy implementation, most of the library path
869 // is set in the launcher. This was to accomodate linking restrictions
873 // However, to prevent the proliferation of improperly built native
918 // components specific to the Java VM after those components specified
1010 // use debugger to set breakpoint here
1017 // Try to randomize the cache line index of hot stack frames.
1041 // we need to call set_native_priority now that we have an lwp.
1042 // We used to get the priority from thr_getprio (we called
1043 // thr_setprio way back in create_thread) and pass it to
1046 // we pass trash to set_native_priority instead of what's
1247 // Need to be at least 5Mb of unreserved address space. We do check by
1248 // trying to reserve some.
1277 // 4376845 -- libthread/kernel don't provide enough LWPs to utilize all CPUs.
1282 // to our process. This can result in under utilization of PEs.
1283 // I suspect the problem is related to libthread's LWP
1284 // pool management and to the kernel's SIGBLOCKING "last LWP parked"
1287 // The following code is palliative -- it attempts to ensure that our
1288 // process has sufficient LWPs to take advantage of multiple PEs.
1289 // Proper long-term cures include using user-level threads bound to LWPs
1291 // slight timing window with respect to sampling _os_thread_count, but
1294 // the number of PEs in our partition. You might be tempted to use
1303 // enough LWPs available to service them. This can occur when the
1307 // Finally, we should call thr_setconcurrency() periodically to refresh
1309 // The "+3" term provides a little slop -- we want to slightly overprovision.
1330 // In case we attempt to set the priority before the thread starts.
1340 // Need to clean up stuff we've allocated so far
1368 * of Solaris to take advantage of the newly reserved Solaris JVM signals
1407 // other threads. The "ReduceSignalUsage" boolean tells us not to alter
1409 // Programs embedding the VM that want to use the above signals for their
1410 // own purposes must, at this time, use the "-Xrs" option to prevent
1474 // These are signals that are blocked during cond_wait to allow debugger in
1497 // Use 2MB to allow for Solaris 7 64 bit mode.
1503 // Attempt to allow for a normally sized java_stack.
1511 // to reliably setup guard pages. A reasonable max size is 8MB.
1531 "(Stack sizes are rounded up to a multiple of the system page size.)\n"
1532 "See limit(1) to increase the stack size limit.",
1537 "Attempt to map more stack than was allocated");
1548 // we prefer to explicitly stack bang.
1553 // is shared across threads, all threads must be bound to allow
1554 // using alternate signal stacks. The alternative is to interpose
1555 // on _lwp_create to associate an alt sig stack with each LWP,
1557 // We would prefer to use alternate signal stacks with T2
1558 // Since there is currently no accurate way to detect T2
1564 // The alternate signal stack mechanism is no longer needed to
1569 // signal stacks MUST have all threads bound to lwps. Applications
1572 // If we were ever to reenable this mechanism we would need to
1581 // Free Solaris resources related to the OSThread
1586 // We are told to free resources of the argument thread,
1617 // %%% in Win32 this allocates a memory segment pointed to by a
1627 // assuming that the current thread already has a value bound to k.
1630 // interface. I think, however, that it will be faster to
1674 // getTimeNanos is guaranteed to not move backward on Solaris
1700 // getTimeNanos is guaranteed to not move backward on Solaris
1704 // Use atomic long load since 32-bit x86 uses 2 registers to keep long.
1713 // we could either (a) retry the entire operation, (b) retry trying to install now
1715 // we might discard a higher "now" value in deference to a slightly lower but freshly
1717 // to (a) or (b) -- and greatly reduces coherence traffic.
1719 // Avoiding excessive CAS operations to hot RW locations is critical.
1727 // Time since start-up in seconds to a fine granularity.
1756 // converted to seconds.
1798 // getTimeMillis guaranteed to not move backwards on Solaris
1818 info_ptr->may_skip_backward = false; // not subject to resetting or drifting
1819 info_ptr->may_skip_forward = false; // not subject to resetting or drifting
1835 // called from signal handler. Before adding something to os::shutdown(), make
1839 // allow PerfMemory to attempt cleanup of any persistent resources
1842 // needs to remove object in file system
1856 // called from signal handler. Before adding something to os::abort(), make
2304 // Nothing to do for now.
2316 // Taken from /usr/include/sys/machsig.h Supposed to be architecture specific
2482 // Find the full path to the current module, libjvm.so or libjvm_g.so
2490 // Lazy resolve the path to current module.
2552 // Go back to path of .so
2595 // handler fails to abort. Let VM die immediately.
2601 // We do not need to reinstate the signal handler each time...
2707 assert(Maxsignum >0, "Unable to obtain max signal number");
2712 // The additional signal is for SIGEXIT - exit signal to signal_thread
2770 // another thread suspended us. We don't want to continue running
2823 // to be lost. That can cause confusion where different data
2876 // the caller wants all commit errors to exit with the specified mesg:
2890 // a case where the VM wants to use a larger alignment size
2891 // for its own reasons but still want to use large pages
2892 // (which is what matters to setting the mpss range.
2895 assert(UseLargePages, "Expected to be here for large page use only");
2900 // for internal reasons. Try to set the mpss range using
2922 // the caller wants all commit errors to exit with the specified mesg:
2953 // Tell the OS to make the range local to the first-touching LWP
2977 // board. An LWP is assigned to one of these groups upon creation.
3018 assert(c != 0, "Failure to initialize LGRP API");
3069 // Scan the pages from start to end until a page different than
3136 // have enough swap space to back the physical page.
3167 // have enough swap space to back the physical page.
3175 "OS failed to return requested mmap address.");
3197 // we can either pass an alignment to this method or verify alignment
3201 // Since snv_84, Solaris attempts to honor the address hint - see 5003415.
3223 // Address hint method didn't work. Fall back to the old method.
3249 warning("attempt_reserve_memory_at: adjusted gap to 0x%lx", gap);
3267 // or variable size chunks to find the requested region -
3271 // will provide a mmap flag to allow us to avoid this business.
3317 // Protect memory (Used to pass readonly pages through
3337 // Since ISM pertains only to the heap, guard and unguard memory should not
3349 // UseLargePages is the master flag to enable/disable large page memory.
3359 // mechanism to use large page memory, this
3360 // combination is equivalent to -UseLargePages,
3366 // Otherwise, JVM will fall back to MPSS.
3369 // is equivalent to +UseISM -UseMPSS.
3378 // Don't bother to probe page size because getpagesizes() comes with MPSS.
3437 // select up to usable_count elements. First sort the array, find the first
3438 // acceptable value, then copy the usable sizes to the top of the array and
3439 // trim the rest. Make sure to include the default page size :-).
3481 // ISM disables MPSS to be compatible with old JDK behavior
3494 // Signal to OS that we want large pages for addresses
3502 debug_only(warning("Attempt to use MPSS failed."));
3510 // the code cache doesn't have an SHM_X executable permission to check.
3526 // Create a large shared memory region to attach to based on size.
3531 jio_snprintf(msg, sizeof(msg), "Failed to reserve shared memory (errno = %d).", errno);
3537 // Attach to the region
3549 jio_snprintf(msg, sizeof(msg), "Failed to attach shared memory (errno = %d).", err);
3581 // MPSS allows application to commit large page memory on demand; with ISM
3633 and trying to round up to avoid lost milliseconds can result in a
3646 // Read calls from inside the vm need to perform state transitions
3660 // situation with a JavaThread being starved out of a lwp. The kernel doesn't seem to generate
3661 // a SIGWAITING signal which would enable the threads library to create a new lwp for the starving
3668 // We now try to acquire the threads lock. Since this lock is held by the VM thread during
3678 // to honor the suspend-equivalent protocol.
3723 // Sleep forever; naked call to OS-specific sleep; use with CAUTION
3730 // Used to convert frequent JVM_Yield() to nops
3752 // Yields to all threads with same or greater priority
3756 // Note that yield semantics are defined by the scheduling class to which
3757 // the thread currently belongs. Typically, yield will _not yield to
3764 // On Solaris we found that yield_all doesn't always yield to all other threads.
3765 // There have been cases where there is a thread ready to execute but it doesn't
3766 // get an lwp as the VM thread continues to spin with sleeps of 1 millisecond.
3767 // The 1 millisecond wait doesn't seem long enough for the kernel to issue a
3768 // SIGWAITING signal which will cause a new lwp to be created. So we count the
3774 // Yields to all threads, including threads with lower priorities
3793 // Called from the tight loops to possibly influence time-sharing heuristics
3801 // all of our threads will be assigned to real lwp's. Using the thr_setprio
3806 // which range from 1 to 10, libthread "thr_setprio" scale which range
3807 // from 0 to 127, and the current scheduling class of the process we
3808 // are running in. This is typically from -60 to +60.
3809 // The setting of the lwp priorities in done after a call to thr_setprio
3810 // so Java priorities are mapped to libthread priorities and we map from
3811 // the latter to lwp priorities. We don't keep priorities stored in
3812 // Java priorities since some of our worker threads want to set priorities
3821 // = ps -cL <pid> ... to validate priority.
3828 // + We assume that all threads in the process belong to the same
3830 // + Must be root or in IA group to change change "interactive" attribute.
3863 // of Solaris. We need to call through this wrapper so that we can
3873 // Stub to set the value of the real pointer, and then call the real
3887 // Try to determine the priority scale for our process.
3901 // We are using Bound threads, we need to determine our priority ranges
3909 // MaxPriority always maps to the FX scheduling class and criticalPrio.
3911 // Save original MaxPriority mapping in case attempt to
3914 // Set negative to distinguish from other priorities
3918 // Not using Bound Threads, set to ThreadPolicy 1
3929 // classID values, which are known to be "small" integers.
4032 // Convert from the libthread "thr_setprio" scale to our current
4064 // TODO: elide set-to-same-value
4069 tty->print_cr("Trying to set priority but init failed, ignoring");
4078 INTPTR_FORMAT " to %d, lwpid not set",
4167 // Sanity check: read back what we just attempted to set.
4213 // Solaris only gives access to 128 real priorities at a time,
4214 // so we expand Java's ten to fill this range. This would be better
4217 // The ThreadPriorityPolicy option allows us to select 2 different
4226 // This mode causes the priority table to get filled with
4227 // linear values. NormPriority get's mapped to 50% of the
4229 // to get unfair treatment against other Solaris processes
4312 // Hint to the underlying OS that a task switch would not be good.
4329 // Save and restore errno to avoid confusing native code with EINTR
4340 // attempt to switch the state, we assume we had a SUSPEND_REQUEST
4429 // to have a spurious wakeup, which is not harmful, and the
4431 // to add yet another lock. It has also been recommended not to put
4469 // "Randomly" selected value for how long we want to spin
4471 // we send a signal to a thread we want to resume
4481 // failed to switch, state wasn't running?
4490 // managed to send the signal and switch to SUSPEND_REQUEST, now wait for SUSPENDED
4519 // failed to switch to WAKEUP_REQUEST
4578 // For now, is only used to profile the VM Thread
4587 // able to use structured exception handling (thread-local exception filters) on, e.g., Win32.
4592 // This routine may be used by user applications as a "hook" to catch signals.
4593 // The user-defined signal handler must pass unrecognized signals to this
4599 // If this routine returns false, it is OK to call it again. This allows
4600 // the user-defined signal handler to perform checks either before or after
4602 // a serious error if it tried to handle an exception (such as a null check
4612 // to the function referred to in the "sa_sigaction" (not the "sa_handler")
4613 // field of the structure passed to sigaction(). This routine assumes that
4614 // the sa_flags field passed to sigaction() includes SA_SIGINFO and SA_RESTART.
4629 is needed to provoke threads blocked on IO to return an EINTR
4631 does NOT participate in signal chaining due to requirement for
4632 NOT setting SA_RESTART to make EINTR work. */
4642 // This boolean allows users to forward their own non-matching signals
4643 // to JVM_handle_solaris_signal, harmlessly.
4670 // It's more reasonable to let jvm treat it as an unexpected exception
4693 // try to honor the signal mask
4749 // Do not overwrite; user takes responsibility to forward to us.
4799 // This method is a periodic task to check for misbehaving JNI applications
4820 // ReduceSignalUsage allows the user to override these handlers
4893 // No need to check this sig any longer
4899 // No need to check this sig any longer
4948 // Pre-1.4.1 Libjsig limited to signal chaining signals <= 32 so
4957 // Never ok to chain our SIGinterrupt
5059 // Routine to determine if we are currently using the new T2 libthread.
5066 // We need to determine if we are running with the new T2 libthread
5328 // (Solaris only) this switches to calls that actually do locking.
5335 // enough to allow the thread to get to user bytecode execution.
5356 // try to enable extended file IO ASAP, see 6431278
5360 // use this first mmap call to check support for MAP_ALIGN.
5391 // Check minimum allowable stack size for thread creation and to initialize
5394 // Add in 2*BytesPerWord times page size to account for VM stack during
5413 // should be to fix the guard page mechanism.
5470 // initialize synchronization primitives to use either thread or
5475 // set the number of file descriptors to max. print out error
5492 // Calculate theoretical max. size of Threads to guard gainst
5506 // main or as a result of a call to exit(3C). There can be only 32 of
5508 // 8 and later, there is no limit to the number of functions registered
5510 // functions are called upon dlclose(3DL) in addition to return from main
5517 // call DestroyJavaVM() to assure that VM resources are released.
5520 // the future if the appropriate cleanup code can be added to the
5643 * has been raised. This can cause calls to fopen (but not calls to
5644 * open, for example) to fail mysteriously, perhaps in 3rd party
5648 * We attempt to make everything work anyways by:
5659 * 256 to ones beyond 256, which is done below.
5664 * 6431278: Netbeans crash on 32 bit Solaris: need to call
5686 * - cause end-of-file to fail to be detected on some file
5689 * - might cause an fopen in the subprocess to fail on a system
5728 // move file pointer to the specified offset
5759 * need to go through the INTERRUPT_IO() wrapper as for other
5852 // Turn this on if you need to trace synch operations.
5853 // Set RECORD_SYNCH_LIMIT to a large-enough value,
6000 // are used by JVM M&M and JVMTI to get user+sys or user CPU time
6013 // return user level CPU time only to be consistent with
6150 // Following function has been added to support HotSparc's libjvm.so running
6156 // until we no longer want to able to run on top of 1.3.0 Solaris production
6194 // park() is permitted to return spuriously.
6195 // Callers of park() should wrap the call to park() in
6198 // to immediately return 0 your code should still work,
6199 // albeit degenerating to a spin loop.
6201 // An interesting optimization for park() is to use a trylock()
6202 // to attempt to acquire the mutex. If the trylock() fails
6204 // in that case the park() code could simply set _count to 0
6207 // expected to loop. By using trylock() we will have avoided a
6239 // utility to compute the abstime argument to timedwait.
6240 // TODO-FIXME: switch from compute_abstime() to unpackTime().
6257 // it rounded down to 0 which doesn't meet the spec.
6284 // Test-and-clear _Event, always leaves _Event set to 0, returns immediately.
6285 // Conceptually TryPark() should be equivalent to park(0).
6307 // TODO-FIXME: for Solaris SPARC set fprs.FEF=0 prior to parking.
6319 // With usr/lib/lwp going to kernel, always handle ETIME
6328 // Paranoia to ensure our locked and lock-free paths interact
6349 // For Solaris SPARC set fprs.FEF=0 prior to parking.
6372 // Paranoia to ensure our locked and lock-free paths interact
6383 // That is, we can safely transition _Event from -1 to either
6384 // 0 or 1. Forcing 1 is slightly more efficient for back-to-back
6388 // Note: Forcing a transition from "-1" to "1" on an unpark() means
6389 // that it will take two back-to-back park() calls for the owning
6390 // thread to block. This has the benefit of forcing a spurious return
6397 // Wait for the thread assoc with the PlatformEvent to vacate.
6406 // to avoid a common class of futile wakeups.
6420 * sets count to 1 and signals condvar. Only one thread ever waits
6421 * on the condvar. Contention seen when trying to park implies that someone
6423 * is no need to track notifications.
6428 * This code is common to linux and solaris and will be moved to a
6432 * or an absolute time in milliseconds. Either way it has to be unpacked
6436 * a signed-32-bit value (except on 64-bit Linux) we have to watch for
6438 * prior to 10 there is a restriction (see cond_timedwait) that the specified
6492 // since we are doing a lock-free update to _counter.
6495 // Optional fast-exit: Check interrupt before trying to wait
6509 // Warning: this code might be exposed to the old Solaris time
6535 // Paranoia to ensure our locked and lock-free paths interact
6543 // (This allows a debugger to break into the running thread.)
6555 // TODO-FIXME: for Solaris SPARC set fprs.FEF=0 prior to parking.
6578 // Paranoia to ensure our locked and lock-free paths interact
6633 // try to be consistent with system(), which uses "/usr/bin/sh" on Solaris
6645 // Wait for the child process to exit. This returns immediately if
6660 // The best value to return is 0x80 + signal number,
6662 // it allows callers to distinguish between process exit and
6675 // in order to report if we are running in a headless jre
6688 // Get path to libjvm.so
6738 // As both poll and select can be interrupted by signals, we have to be
6739 // prepared to restart the system call after updating the timeout, unless
6811 struct sockaddr* to, socklen_t tolen) {
6812 INTERRUPTIBLE_RETURN_INT((int)::sendto(fd, buf, len, flags, to, tolen),\
6823 // is expected to return 0 on failure and 1 on success to the jdk.
6832 // Get the default path to the core file
6838 assert(p != NULL, "failed to get current directory");