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)
Mon, Nov 18, 9:25 PM
Unknown Object (File)
Tue, Nov 12, 8:37 PM
Unknown Object (File)
Tue, Nov 12, 2:02 AM
Unknown Object (File)
Mon, Nov 11, 6:31 AM
Unknown Object (File)
Sun, Nov 10, 5:07 AM
Unknown Object (File)
Sat, Nov 9, 4:55 PM
Unknown Object (File)
Sat, Nov 9, 2:17 PM
Unknown Object (File)
Fri, Nov 8, 3:36 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