HomeFreeBSD

Rename tdq_ipipending and clear it in sched_switch().

Description

Rename tdq_ipipending and clear it in sched_switch().

This fixes a regression after r355311. Specifically, sched_preempt()
may trigger a context switch by calling thread_lock(), since
thread_lock() calls critical_exit() in its slow path and the interrupted
thread may have already been marked for preemption. This would happen
before tdq_ipipending is cleared, blocking further preemption IPIs. The
CPU can be left in this state indefinitely if the interrupted thread
migrates.

Rename tdq_ipipending to tdq_owepreempt. Any switch satisfies a remote
preemption request, so clear tdq_owepreempt in sched_switch() instead of
sched_preempt() to avoid subtle problems of the sort described above.

Reviewed by: jeff, kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D22758

Details

Provenance
markjAuthored on
Reviewer
jeff
Differential Revision
D22758: Rename tdq_ipipending and clear it in sched_switch().
Parents
rS355643: Bump __FreeBSD_version for r355641, new sig set ops
Branches
Unknown
Tags
Unknown