*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: cpu_need_resched | Section: 9 | Source: NetBSD | File: cpu_need_resched.9
CPU_NEED_RESCHED(9) FreeBSD Kernel Developer's Manual CPU_NEED_RESCHED(9) NAME cpu_need_resched - context switch notification SYNOPSIS #include <sys/cpu.h> void cpu_need_resched(struct cpu_info *ci, struct lwp *l, int flags); DESCRIPTION The cpu_need_resched() function is the machine-independent interface for the scheduler to notify machine-dependent code that a context switch from the current LWP l, on the cpu ci, is required. This event may occur if a higher priority LWP appears on the run queue or if the current LWP has exceeded its time slice. l is the last LWP observed running on the CPU. It may no longer be running, as cpu_need_resched() can be called without holding scheduler locks. If the RESCHED_KPREEMPT flag is specified in flags and __HAVE_PREEMPTION C pre-processor macro is defined in <machine/intr.h>, machine-dependent code should make a context switch happen as soon as possible even if the CPU is running in kernel mode. If the RESCHED_KPREEMPT flag is not specified, then RESCHED_UPREEMPT is specified instead. If the RESCHED_IDLE flag is specified in flags, the last thread observed running on the CPU was the idle LWP. If RESCHED_REMOTE flag is specified in flags, the request is not for the current CPU. The opposite also holds true. If ci is not the current processor, cpu_need_resched() typically issues an inter processor call to the processor to make it notice the need of a context switch as soon as possible. cpu_need_resched() is always called with kernel preemption disabled. Typically, the cpu_need_resched() function will perform the following operations: o Set a per-processor flag which is checked by userret(9) when returning to user-mode execution. o Post an asynchronous software trap (AST). o Send an inter processor interrupt to wake up cpu_idle(9) and/or force an user process across the user/kernel boundary, thus making a trip through userret(). SEE ALSO sched_4bsd(9), userret(9) FreeBSD 14.1-RELEASE-p8 November 17, 2019 FreeBSD 14.1-RELEASE-p8

Navigation Options