Page MenuHomeFreeBSD

intrng: allocate event during isrc setup
Needs ReviewPublic

Authored by on May 19 2023, 8:12 PM.
Referenced Files
Unknown Object (File)
Sun, Sep 17, 9:55 AM
Unknown Object (File)
Tue, Sep 5, 11:22 PM
Unknown Object (File)
Tue, Sep 5, 1:46 PM
Unknown Object (File)
Thu, Aug 31, 7:15 PM
Unknown Object (File)
Aug 14 2023, 10:42 AM
Unknown Object (File)
Aug 2 2023, 6:42 PM
Unknown Object (File)
Jul 15 2023, 10:43 PM
Unknown Object (File)
Jul 7 2023, 2:13 PM


Group Reviewers

There is minimal benefit in delaying event allocation. Worse, this
reduces opportunities for merging architectural interrupt structures

Diff Detail

rG FreeBSD src repository
Lint Passed
No Test Coverage
Build Status
Buildable 53262
Build 50153: arc lint + arc unit

Event Timeline

Seems pretty reasonable to do lazy allocation of struct intr_event, but there are circumstances where it could be a disadvantage. The other likely allocation time is during the setup step, so using a flag seems appropriate. The question which comes to mind is, which flag value should be used? Should this use a high flag number since this could be discarded after the setup step? Be strictly sequential?

Appears intr_isrc_register()/intr_isrc_deregister() would need to be after isrc_event_create(). I'm unsure whether to move the former down versus the latter up. Right now I'm mostly interested in whether this seems reasonable.

I've been concerned over whether the initial version of D40166 would pass. The use case was too specialized. As such an update, remove the lazy interrupt allocation.

I don't know what benefit lazy interrupt event allocation is supposed to confer. In nearly every case the event will simply happen later. More importantly this allows one to assume all initialized interrupts have an event. No more special case for architecture-agnostic things. retitled this revision from intrng: add flag requesting early event allocation to intrng: allocate event during isrc setup.Aug 22 2023, 1:16 AM edited the summary of this revision. (Show Details) added a reviewer: arm64.

One extra may be needed for this. The file sys/arm/mv/gpio.c has a call to intr_event_create(). Unfortunately this isn't setup for INTRNG allocating events early. Interestingly it seems ad2be10ff043 is exactly the same issue I'm running into.

Move the setting line to isrc_alloc_irq(). This would allow keeping the interrupt number strictly on the event and removing it from intr_irqsrc.

I haven't yet figured out whether sys/arm/mv/gpio.c needs adjustment. Interestingly that file includes workarounds rather similar to my alternative plans.

Squash review, adding removal of ->isrc_irq. This is one reason why allocating the event earlier has value, ->ie_irq can then substitute everywhere. If reviewers want this split back off, that can be done.