Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to fixes to 1363 problems #1431

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Fixes to fixes to 1363 problems #1431

wants to merge 5 commits into from

Conversation

ehem
Copy link
Contributor

@ehem ehem commented Sep 22, 2024

This is kind of urgent as I had been wanting some of this with #1363. Finally spotted the overt assembly to C bridge and that works better for things meant to be shared.

Hopefully got the headers right. Turned out to need LINT-ACPI to find the combination which actually triggered the one condition.

This is kind of urgent-ish.


Now doing cleanup from the fallout resulting from people changing things without understanding.

@ehem ehem mentioned this pull request Sep 22, 2024
@bsdimp
Copy link
Member

bsdimp commented Sep 22, 2024

It's late here and I'm off to bed. I'm on travel tomorrow and may be jet lagged tuesday, and I'll look at it first of the pull requests. We have a lot of time before the branch to refine and I spent time at EuroBSDCon recruiting reviwers. I wanted to let you know quickly my schedule.

@ehem
Copy link
Contributor Author

ehem commented Sep 23, 2024

On review seems the one which had been in the middle really needed to be first. Dunno about others, but there seems a phenomenon the first commit usually needs to be last and the last commit needs to be first.

@ehem
Copy link
Contributor Author

ehem commented Sep 23, 2024

I'm unsure the last one really needs to be part of this. Simply a fragment of where I think things are going, simply illustrating what I was thinking of.

@ehem
Copy link
Contributor Author

ehem commented Nov 4, 2024

While I'm not too hopeful about the latter two right now, I hope the two at the front can go in now.

@ehem ehem requested review from bsdimp and bsdjhb as code owners November 5, 2024 20:52
@ehem ehem force-pushed the fix1363 branch 6 times, most recently from cbb96fc to 6fd02e0 Compare November 7, 2024 20:31
@ehem ehem force-pushed the fix1363 branch 2 times, most recently from a4691ef to 0ec7cee Compare November 22, 2024 00:49
@ehem ehem force-pushed the fix1363 branch 7 times, most recently from 83fdded to ea79f07 Compare December 4, 2024 01:42
@bsdimp
Copy link
Member

bsdimp commented Dec 11, 2024

This code is hard to review. It has taken me far to long to understand it.

First, it undoes the consensus ending to the sys/intr.h machine/intr.h debate. Those changes are recjected outright at this time. We may want to revisit it in the future, but there's not strong justification for doing it now. There's also not support for moving all the defines into machine/intr.h and moving them out of sys/intr.h, but that might be possible. Nothing really needs to have machine/intr.h be completely independent, apart from two arch's exception.S. The current situation is fine for the moment and not worth the churn to fix.

Second, the renaming, at this time, of the interrupt files creates a lot more chrun than the benefit from having a uniform name.

I dislike having interrupt_t. You can't forward declare typedefs. However, given the size of the change, it's hard to know for sure where that's going. I know it enables other things in #1457, so perhaps it would be better there.

So a big part of the problem, as I've pointed out many times before, is that one has to look at a lot of changes to know what's relevant. All the renaming and shuffling and so-forth is a huge mental load to keep track of. Some of it is relevant for later changes, some of it relitigates old battles you lost, some of it is churn that might be marginally better, but gets in the way of understanding the basics of the proposed changes. So when you submit such a hodge podge, and then send me blaimy emails, of course you're going to get slow service. It takes a lot to understand and I'm treating this as a special case to the normal rules of closing stuff with huge amounts of unrelated or at the current time irrelevant churn.

I'm just a volunteer here. You don't get to demand service from me. Especially in the part of the system that can have huge systemic performance regressions if not done properly. So these things take time, and that's the best you can expect.

@ehem
Copy link
Contributor Author

ehem commented Dec 11, 2024

This code is hard to review. It has taken me far to long to understand it.

Originally it was simpler. Problem is someone broke something which meant more had to get in and the complexity went up. Had this been reviewed months ago it wouldn't have the extras.

First, it undoes the consensus ending to the sys/intr.h machine/intr.h debate. Those changes are recjected outright at this time. We may want to revisit it in the future, but there's not strong justification for doing it now. There's also not support for moving all the defines into machine/intr.h and moving them out of sys/intr.h, but that might be possible. Nothing really needs to have machine/intr.h be completely independent, apart from two arch's exception.S. The current situation is fine for the moment and not worth the churn to fix.

Having headers be standalone is standard practice. This means you can include fewer and development is simpler due to needing fewer #include lines.

Second, the renaming, at this time, of the interrupt files creates a lot more chrun than the benefit from having a uniform name.

This is required for interrupt_t to be useful. This allows source files which merely handle pointers to the structure to #include a common name, then use pointers to the structure without looking inside.

I dislike having interrupt_t. You can't forward declare typedefs. However, given the size of the change, it's hard to know for sure where that's going. I know it enables other things in #1457, so perhaps it would be better there.

It is a step in the direction of commonizing the interrupt frameworks. Might seem low-ish value at first glance, but suddenly you can handle things as interrupt_t * instead of void *.

For #1457 this allows creation of alternatives to intr_event_create() which by using interrupt_t * drastically reduces the amount of casting. While I am not adverse to some casting, the amount in the FreeBSD kernel is unnecessarily excessive. A major problem for #1457 was distinguishing the different cases in io_apic.c.

I'm just a volunteer here. You don't get to demand service from me. Especially in the part of the system that can have huge systemic performance regressions if not done properly. So these things take time, and that's the best you can expect.

The initial steps of #1457 definitely have minor reduction. interrupt_t * is part of an interface which regains some.

Alas it is primarily hypervisors which need common interrupt frameworks. Allows porting to a single system instead of having to treat FreeBSD as 3 distinct OSes.

@ehem
Copy link
Contributor Author

ehem commented Dec 11, 2024

Gah, #1286 also relies on interrupt_t, but there it is completely fundamental. A common type allows nibbling hunks off the interrupt infrastructures in the hope of converging them.

EDIT: Erk, correct the pull reference.

@ehem ehem changed the title Fixes to1363 problems Fixes to fixes to1363 problems Dec 16, 2024
@ehem ehem force-pushed the fix1363 branch 4 times, most recently from 0f7a738 to cb70782 Compare December 23, 2024 18:08
@ehem ehem changed the title Fixes to fixes to1363 problems Fixes to fixes to 1363 problems Dec 23, 2024
@ehem ehem force-pushed the fix1363 branch 3 times, most recently from 0d2be1c to 26057d7 Compare January 6, 2025 17:24
ehem added 5 commits January 13, 2025 13:22
… type to enum""

This partially reverts commit 4b01a7f.

Non-reverting hunks were added to 4b01a7f.  These were then moved
from genassym.c to exception.S.  The revert had to be unclean due to the
removal of 536c8d9's prerequisite when bringing into FreeBSD's
repository.
This reverts commit 4f12b52.

Unfortunately having the unusual #include direction serves a high-value
purpose.  The <machine/intr.h> headers almost serve as a standard point
to retrieve architecture interrupt headers.  This is far more valuable.

Leave the move of #include <sys/bus.h> in riscv/trap.c intact.  That is
a reasonable move unrelated to the purpose of this revert.

Move the #include of sys/intr.h earlier in arm/include and
riscv/include.  This is a historical artifact from d6233ba and is
overdue for cleanup.
Various files #including INTRNG interrupt headers were inconsistent
in whether they #include'd sys/intr.h or machine/intr.h.  Since there is
a need to work with other architectures, move to #include of
machine/intr.h.  Modify sys/intr.h to #error if machine headers are
included first and future uses match this.

Remove #include of intr.h where possible.

Sort of fixes c85855a.  The breakage was out too long.
Having two distinct names for the interrupt headers serves to interfere
with most efforts to converge the interrupt frameworks.  Simply rename
all of them to "machine/interrupt.h".

Define __MACHINE_INTERRUPT_H__ in i386/include/interrupt.h in order to
be consistent with other platforms.  This is otherwise silly, but
consistency is important.

Remove the #ifdefs in subr_bus.c as a step towards to making c85855a
useful on other platforms.

Do some sorting of #include order.  Notably a bunch involving
resource.h.

Differential Revision: https://reviews.freebsd.org/D35559
For code which doesn't care about the underlying structure and simply
needs to have a common name.

Differential Revision: https://reviews.freebsd.org/D39178
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants