CPU_IDLE(9) BSD Kernel Developer's Manual CPU_IDLE(9)NAME
cpu_idle -- machine-dependent processor idling interface
SYNOPSIS
#include <sys/cpu.h>
void
cpu_idle(void);
DESCRIPTION
cpu_idle() is called by machine-independent code when the processor has nothing to do. It can be used to conserve the processor power, for
example.
cpu_idle() returns immediately if cpu_need_resched() has been called for the processor after the last call of cpu_idle() or cpu_did_resched()
on the processor. cpu_idle() returns as soon as possible when cpu_need_resched() is called for the processor. Otherwise, it returns when-
ever it likes.
cpu_idle() is called at IPL_NONE, without any locks held.
EXAMPLES
The simplest (and, in some cases, the best) implementation of cpu_idle() is the following.
void
cpu_idle(void)
{
/* nothing */
}
SEE ALSO cpu_need_resched(9), cpu_switchto(9), intro(9), spl(9)BSD April 20, 2007 BSD
Check Out this Related Man Page
USERRET(9) BSD Kernel Developer's Manual USERRET(9)NAME
userret -- return path to user-mode execution
SYNOPSIS
#include <sys/lwp.h>
#include <sys/sched.h>
void
userret(struct lwp *l);
DESCRIPTION
The userret() function is executed after processing a trap (e.g., a system call or interrupt) before returning to user-mode execution. The
implementation is machine dependent and is never invoked from machine-independent code. The function prototype for each architecture may be
different to the prototype above, however the functionally provided by the userret() function on each architecture is essentially the same.
Specifically, the userret() function performs the following procedure:
o Detect a change in the signal disposition of the current process and invoke postsig(9) to post the signal to the process. This may
occur when the outcome of the trap or syscall posted a signal to the process (e.g., invalid instruction trap).
o Check the want_resched flag to see if the scheduler requires the current process to be preempted by invoking preempt(9) (see
cpu_need_resched(9)). This may occur if the clock interrupt causes the scheduler to determine that the current process has com-
pleted its time slice.
o Update the scheduler state.
SEE ALSO cpu_need_resched(9), postsig(9), preempt(9), scheduler(9)BSD December 20, 2005 BSD
Since yesterday the vmstat command is displaying the cpu idle time at 100%At each time interval. It never changes. Not sure what it means other than it Quit calculating that stat. And I'm curious why. Using sar I can display a correctCpu idle percent, but vmstat does not. Any ideas why or... (2 Replies)
I am using Ubuntu 9.04. I want to write a shell script to get the information about cpu idle from top command at the real time when i call it, compare cpu idle with 20 (20%), if cpu idle > 20 exit 1, vice versa exit 0. Anybody can help me to resolve it ?
Thanks alot. (7 Replies)
I need a shell script that will monitor a few conditions and not execute until the these conditions are met. The problem I'm having is that I can not perform a database snapshot (backup) of a sybaseIQ database unless the CPU Status Idle % is above 60% or the snapshot (backup) fails.
If... (2 Replies)