Page MenuHomeFreeBSD

Allow distinct setting and querying of interrupt and ithread affinities
Needs ReviewPublic

Authored by gallatin on Jul 7 2017, 9:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 6, 7:11 PM
Unknown Object (File)
Jan 15 2024, 4:48 AM
Unknown Object (File)
Dec 20 2023, 3:55 AM
Unknown Object (File)
Nov 24 2023, 8:55 PM
Unknown Object (File)
Sep 10 2023, 11:58 AM
Unknown Object (File)
Jul 20 2023, 12:28 PM
Unknown Object (File)
Jan 29 2023, 2:45 PM
Unknown Object (File)
Dec 11 2022, 7:06 AM
Subscribers

Details

Summary
  • Give cpuset 2 new arguments, one for hard interrupts (X) and one for ithreads (I)
  • Allow CPU_WHICH_(INTRHANDLER|ITHREAD) in cpuset_which()
  • Fix a bug in intr_getaffinity() where we'll panic on a null pointer passed to cpuset_which.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 10782
Build 11177: arc lint + arc unit

Event Timeline

jhb added a subscriber: wblock.

Code wise it is fine with me, might be good to get some doc review for the mapage / usage.

sys/kern/kern_intr.c
477

Oof at both of these bugs.

usr.bin/cpuset/cpuset.1
51

Might want to ask a doc person like @wblock if this is the right way to format this (same for usage())

143–147

Maybe tweak the descriptions like so:

-x: Specifies all resources associated with an interrupt as the target of an operation.
-X: Specifies the hardware interrupt vector as the target of an operation.
-I: Specifies dedicated threads associated with an interrupt as the target of the operation.

(I would maybe say "uses" instead of "specifies" here, but the rest of the manpage uses "specifies")

This revision is now accepted and ready to land.Jul 31 2017, 7:45 PM
gallatin edited edge metadata.
  • Feedback from jbh regarding wording
This revision now requires review to proceed.Aug 1 2017, 2:35 PM

Thanks for the feedback. I'll reach out to wblock about the doc changes. I'm quite weak in man page fu, and this is a slightly odd one at that..

sys/kern/kern_intr.c
477

Meh.. it is code that was never run. We all have bugs.

This is a bit confusing. The new -I and -X options take the same irq argument as the old -x?

This is a bit confusing. The new -I and -X options take the same irq argument as the old -x?

Yes. The gist is that currently cpuset -x $IRQ will bind $IRQs interrupt thread and low-level hardware interrupt. I've added a mechanism to bind just the ithread or just the interrupt vector using the new -I or -X flags.

I suck at man pages, so any sanity you can add to this would be very much appreciated. Thanks!

Drew

Added my probably-weak mdoc suggestions, and added brueffer as a reviewer.

usr.bin/cpuset/cpuset.1
51

The best I've done with this is like so:

.Op
.Fl j Ar jailid |
.Fl p Ar pid |
.Fl t Ar tid |
.Fl s Ar setid |
.Fl x Ar irq |
.Fl I Ar irq |
.Fl X Ar irq 
.Oc

This puts the additional options on the same line as [-l cpu-list]. Maybe not a big deal.

55
.Oo
.Fl d Ar domain |
.Fl j Ar jailid |
.Fl p Ar pid |
.Fl t Ar tid |
.Fl s Ar setid |
.Fl x Ar irq |
.Fl I Ar irq |
.Fl X Ar irq 
.Oc

Added my probably-weak mdoc suggestions, and added brueffer as a reviewer.

Thanks for both of those things, I will try your mdoc suggestion!

Drew