freebsd-skq/sys
Ryan Stone 09ae7c4814 Check for preemption after lowering a thread's priority
When a high-priority thread is waiting for a mutex held by a
low-priority thread, it temporarily lends its priority to the
low-priority thread to prevent priority inversion.  When the mutex
is released, the lent priority is revoked and the low-priority
thread goes back to its original priority.

When the priority of that thread is lowered (through a call to
sched_priority()), the schedule was not checking whether
there is now a high-priority thread in the run queue.  This can
cause threads with real-time priority to be starved in the run
queue while the low-priority thread finishes its quantum.

Fix this by explicitly checking whether preemption is necessary
when a thread's priority is lowered.

Sponsored by: Dell EMC Isilon
Obtained from: Sandvine Inc
Differential Revision:	https://reviews.freebsd.org/D9518
Reviewed by: Jeff Roberson (ule)
MFC after: 1 month
2017-02-16 19:41:13 +00:00
..
amd64 Implement linux version of ptrace(2). It's nowhere near complete, 2017-02-16 13:32:15 +00:00
arm Remove debugging code that was probably unused since before the arm code 2017-02-13 20:51:08 +00:00
arm64 Load the new sp_el0 with interrupts disabled in fork_trampoline. If an 2017-02-15 14:56:47 +00:00
boot prefix UFS symbols with UFS_ to reduce namespace pollution 2017-02-15 19:50:26 +00:00
bsm
cam No need to erase sense_data when sense_len is set to zero. 2017-02-14 21:05:36 +00:00
cddl MFV 313786 2017-02-16 19:00:09 +00:00
compat Allow container_of() to be used with constant data pointers. 2017-02-16 14:13:36 +00:00
conf Remove Micro Channel Architecture support. Of the commonly available 2017-02-15 23:04:25 +00:00
contrib Stop including sys/types.h from arm's machine/atomic.h, fix the places 2017-02-11 01:07:46 +00:00
crypto Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
ddb Revert crap accidentally committed 2017-01-28 16:31:23 +00:00
dev Use symbolic constants for OSC support / control negotiations. 2017-02-15 23:49:28 +00:00
fs Do not access memory past the buffer end. 2017-02-16 06:36:16 +00:00
gdb
geom Defer startup of gjournal switcher kproc. 2017-02-07 22:45:59 +00:00
gnu
i386 Remove Micro Channel Architecture support. Of the commonly available 2017-02-15 23:04:25 +00:00
isa Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
kern Check for preemption after lowering a thread's priority 2017-02-16 19:41:13 +00:00
kgssapi
libkern calculate_crc32c: Add SSE4.2 implementation on x86 2017-01-31 03:26:32 +00:00
mips [mips/broadcom] Move MIPS-specific bhnd(4) nexus drivers to 2017-02-13 19:58:55 +00:00
modules Implement linux version of ptrace(2). It's nowhere near complete, 2017-02-16 13:32:15 +00:00
net MFV r313759: license change for a few headers (4 clause BSD to 3 clause BSD). 2017-02-15 07:22:47 +00:00
net80211 [net80211] add a sysctl that forces a vap restart. 2017-02-11 05:33:49 +00:00
netgraph mppc - Finish pluging NETGRAPH_MPPC_COMPRESSION. 2017-01-20 00:02:11 +00:00
netinet Add missing check to fix the build with IPSEC_SUPPORT and without MAC. 2017-02-14 21:33:10 +00:00
netinet6 Remove IPsec related PCB code from SCTP. 2017-02-13 11:37:52 +00:00
netipsec Fix LINT build for powerpc. 2017-02-16 11:38:50 +00:00
netnatm
netpfil Fix typos in comments (returing -> returning) 2017-02-07 00:09:48 +00:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed
opencrypto
powerpc Define the vm_ooffset_t and vm_pindex_t types as machine-independend. 2017-02-04 12:26:38 +00:00
riscv Implement atomic_fcmpset_*() for RISC-V. 2017-02-05 00:32:12 +00:00
rpc add svcpool_close to handle killed nfsd threads 2017-02-14 17:49:08 +00:00
security
sparc64 Define the vm_ooffset_t and vm_pindex_t types as machine-independend. 2017-02-04 12:26:38 +00:00
sys rwlock: tidy up r313392 2017-02-15 23:33:14 +00:00
teken
tests
tools Replace using of objdump with elfdump 2017-01-10 18:46:40 +00:00
ufs prefix UFS symbols with UFS_ to reduce namespace pollution 2017-02-15 19:50:26 +00:00
vm try to fix RACCT_RSS accounting 2017-02-14 13:54:05 +00:00
x86 Remove Micro Channel Architecture support. Of the commonly available 2017-02-15 23:04:25 +00:00
xdr
xen "Buses" is the preferred plural of "bus" 2017-01-15 17:54:01 +00:00
Makefile Remove pc98 support completely. 2017-01-28 02:22:15 +00:00