From e513490beb69c3d4d7e5dee89ff7a63f0ecd8714 Mon Sep 17 00:00:00 2001 From: yamt Date: Thu, 17 May 2007 15:06:25 +0000 Subject: [PATCH] update after yamt-idlelwp merge. --- share/man/man9/cpu_need_resched.9 | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/share/man/man9/cpu_need_resched.9 b/share/man/man9/cpu_need_resched.9 index 2fd48d97898c..b0e61be306b3 100644 --- a/share/man/man9/cpu_need_resched.9 +++ b/share/man/man9/cpu_need_resched.9 @@ -1,4 +1,4 @@ -.\" $NetBSD: cpu_need_resched.9,v 1.4 2007/02/17 17:35:52 yamt Exp $ +.\" $NetBSD: cpu_need_resched.9,v 1.5 2007/05/17 15:06:25 yamt Exp $ .\" .\" Copyright (c) 2002 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -34,24 +34,39 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 18, 2007 +.Dd May 18, 2007 .Dt CPU_NEED_RESCHED 9 .Os .Sh NAME .Nm cpu_need_resched .Nd context switch notification .Sh SYNOPSIS -.In sys/proc.h +.In sys/cpu.h .Ft void -.Fn cpu_need_resched "struct cpu_info *ci" +.Fn cpu_need_resched "struct cpu_info *ci" "int flags" .Sh DESCRIPTION The .Fn 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 is required. +LWP, on the cpu +.Fa 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. +.Pp +If +.Dv +RESCHED_IMMED +flag is specified in +.Fa flags , +machine-dependent code should make a context switch happen as soon as possible. +In that case, for example, if +.Fa ci +is not the current processor, +.Fn 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. .Sh EXAMPLES Specifically, the .Fn cpu_need_resched