Page MenuHomeFreeBSD

x86: Use sx lock for intr_table_lock.
ClosedPublic

Authored by sepherosa_gmail.com on Sep 5 2016, 7:05 AM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 22 2024, 11:17 PM
Unknown Object (File)
Dec 30 2023, 7:57 PM
Unknown Object (File)
Dec 29 2023, 7:28 AM
Unknown Object (File)
Dec 20 2023, 1:04 AM
Unknown Object (File)
Nov 13 2023, 11:39 AM
Unknown Object (File)
Nov 6 2023, 6:43 AM
Unknown Object (File)
Oct 25 2023, 5:54 AM
Unknown Object (File)
Sep 14 2023, 10:04 PM
Subscribers
None

Details

Summary
  • Certain pic_assign_cpu, e.g. msi_assign_cpu can have quite a long call chain. For msi_assign_cpu, mutex makes complex PCI bridge drivers more tricky, e.g. sleep can not be used, etc; it will be too tricky for upcoming Hyper-V PCI bridge driver for PCI pass-through.
  • It is not used on any hot code path nor non-sleepable context, so sx should have the same effect as mutex.
Test Plan

Tested-by: Dexuan Cui <decui microsoft com> w/ WIP PCI bridge driver for Hyper-V PCI pass-through.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sepherosa_gmail.com retitled this revision from to x86: Use sx lock for intr_table_lock..
sepherosa_gmail.com updated this object.
sepherosa_gmail.com edited the test plan for this revision. (Show Details)

If no objection comes, it will be committed early next week.

My worry is that this has a negative impact on suspend/resume. (In general suspend/resume can't sleep).) One option perhaps would be to split the lock into a mutex protecting list of PICs (that is what suspend/resume needs) and the intr_table_lock would only protect interrupt_sources[].

In D7784#162182, @jhb wrote:

My worry is that this has a negative impact on suspend/resume. (In general suspend/resume can't sleep).) One option perhaps would be to split the lock into a mutex protecting list of PICs (that is what suspend/resume needs) and the intr_table_lock would only protect interrupt_sources[].

OK, I will take a look into this.

sepherosa_gmail.com edited edge metadata.

Split intr_table_lock into two. One for intr sources, which is now sx. One for PIC, which stays mutex. Suggested-by: jhb

jhb edited edge metadata.
This revision is now accepted and ready to land.Sep 8 2016, 7:36 PM
This revision was automatically updated to reflect the committed changes.