Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 07 Sep 2010 09:04:04 +0300
From:      Andriy Gapon <avg@icyb.net.ua>
To:        Jeremy Chadwick <freebsd@jdc.parodius.com>
Cc:        jhell <jhell@DataIX.net>, freebsd-stable@freebsd.org, David Xu <davidxu@freebsd.org>, Ivan Voras <ivoras@freebsd.org>, jan.grant@bristol.ac.uk
Subject:   Re: Tuning the scheduler? Desktop with a CPU-intensive task becomes rapidly unusable.
Message-ID:  <4C85D5D4.1020201@icyb.net.ua>
In-Reply-To: <20100907055438.GA20878@icarus.home.lan>
References:  <alpine.BSF.2.00.1009011357050.5858@tribble.ilrt.bris.ac.uk> <i5lr29$9ei$1@dough.gmane.org> <alpine.BSF.2.00.1009021000110.50312@tribble.ilrt.bris.ac.uk> <4C7F7C0F.8080004@icyb.net.ua> <alpine.BSF.2.00.1009021133330.5858@tribble.ilrt.bris.ac.uk> <4C818F65.3000603@freebsd.org> <4C853B91.4090601@DataIX.net> <20100907055438.GA20878@icarus.home.lan>

next in thread | previous in thread | raw e-mail | index | archive | help
on 07/09/2010 08:54 Jeremy Chadwick said the following:
> Can someone explain exactly what this sysctl does?  The description is
> only useful if you have familiarity with the scheduler internals:
> 
> $ sysctl -d kern.sched.preempt_thresh
> kern.sched.preempt_thresh: Min priority for preemption, lower priorities have greater precedence
> 
> The source code doesn't really explain it either -- but I will point out
> that there's a change in the default value based on an option called
> FULL_PREEMPTION:
> 
> src/sys/kern/sched_ule.c
>  192 #ifdef PREEMPTION
>  193 #ifdef FULL_PREEMPTION
>  194 static int preempt_thresh = PRI_MAX_IDLE;
>  195 #else
>  196 static int preempt_thresh = PRI_MIN_KERN;
>  197 #endif
>  198 #else
>  199 static int preempt_thresh = 0;
>  200 #endif
> 
> src/sys/sys/priority.h
>   81 #define PRI_MAX                 (255)           /* Lowest priority. */
>   97 #define PRI_MIN_KERN            (64)
>  ...
>  121 #define PRI_MAX_IDLE            (PRI_MAX)
> 

Well, I think you quoted almost all relevant source to get an understanding.
Take a look also at sched_shouldpreempt() in sched_ule.c.

-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C85D5D4.1020201>