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)
Wed, Nov 13, 9:24 PM
Unknown Object (File)
Wed, Nov 13, 12:11 PM
Unknown Object (File)
Tue, Nov 12, 4:05 AM
Unknown Object (File)
Oct 1 2024, 4:06 AM
Unknown Object (File)
Sep 26 2024, 4:13 AM
Unknown Object (File)
Sep 24 2024, 4:30 AM
Unknown Object (File)
Sep 24 2024, 2:25 AM
Unknown Object (File)
Sep 23 2024, 3:53 AM
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

Lint
Lint Skipped
Unit
Tests Skipped

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.