Page MenuHomeFreeBSD

x86: Restore the critical section around whole ipi_bitmap_handler() if hardclock IPI is delivered.
ClosedPublic

Authored by kib on Dec 6 2019, 11:45 PM.
Tags
None
Referenced Files
F146802323: D22716.id65342.diff
Thu, Mar 5, 5:47 PM
F146802321: D22716.id65342.diff
Thu, Mar 5, 5:47 PM
F146786695: D22716.id65343.diff
Thu, Mar 5, 2:32 PM
F146775834: D22716.id.diff
Thu, Mar 5, 12:18 PM
F146733981: D22716.id.diff
Thu, Mar 5, 3:26 AM
Unknown Object (File)
Mon, Mar 2, 10:26 PM
Unknown Object (File)
Tue, Feb 24, 9:27 PM
Unknown Object (File)
Sun, Feb 22, 7:25 PM
Subscribers

Details

Summary

In the current code after r355311, critical section is taken only around hardclockintr() call, and sched_preempt() is called after the section is exited. If we reschedule after exit, as we typically would due to conditions that caused IPI, in ULE the runq tdq_ipipending is not cleared, which blocks generation of further preempt IPIs.

Since all relatively modern (10 years) hardware has per-cpu event timers, restoring the critical section conditionally does not affect it.

Diagnosed and reviewed by: jeff
Reported and tested by: cy

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 28022

Event Timeline

kib edited the summary of this revision. (Show Details)

thank you.

sys/x86/x86/mp_x86.c
1267 ↗(On Diff #65343)

Comment something like:

sched_preempt() must be called to clear the pending IPI. However, the critical section will cause extra scheduler lock thrashing when used unconditionally. Only critical_enter() if hardclock must also run.

This revision is now accepted and ready to land.Dec 6 2019, 11:57 PM