mirror of
https://github.com/opnsense/src.git
synced 2026-03-07 15:51:20 -05:00
than as one-off hacks in various other parts of the kernel: - Add a function maybe_preempt() that is called from sched_add() to determine if a thread about to be added to a run queue should be preempted to directly. If it is not safe to preempt or if the new thread does not have a high enough priority, then the function returns false and sched_add() adds the thread to the run queue. If the thread should be preempted to but the current thread is in a nested critical section, then the flag TDF_OWEPREEMPT is set and the thread is added to the run queue. Otherwise, mi_switch() is called immediately and the thread is never added to the run queue since it is switch to directly. When exiting an outermost critical section, if TDF_OWEPREEMPT is set, then clear it and call mi_switch() to perform the deferred preemption. - Remove explicit preemption from ithread_schedule() as calling setrunqueue() now does all the correct work. This also removes the do_switch argument from ithread_schedule(). - Do not use the manual preemption code in mtx_unlock if the architecture supports native preemption. - Don't call mi_switch() in a loop during shutdown to give ithreads a chance to run if the architecture supports native preemption since the ithreads will just preempt DELAY(). - Don't call mi_switch() from the page zeroing idle thread for architectures that support native preemption as it is unnecessary. - Native preemption is enabled on the same archs that supported ithread preemption, namely alpha, i386, and amd64. This change should largely be a NOP for the default case as committed except that we will do fewer context switches in a few cases and will avoid the run queues completely when preempting. Approved by: scottl (with his re@ hat) |
||
|---|---|---|
| .. | ||
| default_pager.c | ||
| device_pager.c | ||
| phys_pager.c | ||
| pmap.h | ||
| swap_pager.c | ||
| swap_pager.h | ||
| uma.h | ||
| uma_core.c | ||
| uma_dbg.c | ||
| uma_dbg.h | ||
| uma_int.h | ||
| vm.h | ||
| vm_contig.c | ||
| vm_extern.h | ||
| vm_fault.c | ||
| vm_glue.c | ||
| vm_init.c | ||
| vm_kern.c | ||
| vm_kern.h | ||
| vm_map.c | ||
| vm_map.h | ||
| vm_meter.c | ||
| vm_mmap.c | ||
| vm_object.c | ||
| vm_object.h | ||
| vm_page.c | ||
| vm_page.h | ||
| vm_pageout.c | ||
| vm_pageout.h | ||
| vm_pageq.c | ||
| vm_pager.c | ||
| vm_pager.h | ||
| vm_param.h | ||
| vm_unix.c | ||
| vm_zeroidle.c | ||
| vnode_pager.c | ||
| vnode_pager.h | ||