Martin Pieuchot wrote: > Kernel threads are cooperative and yield. I'd argue that preempt() > should be kept for user processes hogging CPUs. So let's be coherent > with the rest of the kernel and use sched_pause() here. ok?
Except that uvm_pause is called by user processes. > > Index: uvm/uvm_glue.c > =================================================================== > RCS file: /cvs/src/sys/uvm/uvm_glue.c,v > retrieving revision 1.70 > diff -u -p -r1.70 uvm_glue.c > --- uvm/uvm_glue.c 13 Sep 2015 17:08:03 -0000 1.70 > +++ uvm/uvm_glue.c 6 Jul 2016 16:18:49 -0000 > @@ -473,8 +473,7 @@ uvm_pause(void) > KERNEL_UNLOCK(); > KERNEL_LOCK(); > } > - if (curcpu()->ci_schedstate.spc_schedflags & SPCF_SHOULDYIELD) > - preempt(NULL); > + sched_pause(); > } > > #ifndef SMALL_KERNEL >
