FULL_PREEMPTION

John Baldwin jhb at freebsd.org
Tue Mar 12 21:11:58 UTC 2013


On Friday, March 08, 2013 12:58:17 pm Xin Li wrote:
> Hi,
> 
> I have seen a few posts from Andriy as as well as the PC-BSD default
> that for desktop systems, kern.sched.preempt_thresh=224 would improve
> responsiveness.  Looking at the code, it seems that this is equivalent
> to compiling the kernel with FULL_PREEMPTION.
> 
> The sys/conf/NOTES says, however:
> 
> # FULL_PREEMPTION instructs the kernel to preempt non-realtime kernel
> #         threads.  Its sole use is to expose race conditions and other
> #         bugs during development.  Enabling this option will reduce
> #         performance and increase the frequency of kernel panics by
> #         design.  If you aren't sure that you need it then you don't.
> #         Relies on the PREEMPTION option.  DON'T TURN THIS ON.
> 
> Despite the possibility of exposing race conditions as well as
> potentially hurting throughput because of (possibly more) context
> switching, is it considered as a goal that we should support it?  If
> so, should we enable it on -CURRENT?

No, it's only ever intended as a debugging aid.  I suppose we could
consider enabling it in HEAD only just as we do with INVARIANTS, etc.
However, when it was added it was never intended to be used for
production.

-- 
John Baldwin


More information about the freebsd-current mailing list