Page MenuHomeFreeBSD

acpi: Make taskqueue only run on BSP
ClosedPublic

Authored by obiwac on Mon, Dec 29, 8:45 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jan 10, 11:21 PM
Unknown Object (File)
Fri, Jan 9, 6:10 AM
Unknown Object (File)
Fri, Jan 9, 4:16 AM
Unknown Object (File)
Fri, Jan 9, 4:02 AM
Unknown Object (File)
Fri, Jan 9, 3:32 AM
Unknown Object (File)
Thu, Jan 8, 7:07 PM
Unknown Object (File)
Thu, Jan 8, 9:31 AM
Unknown Object (File)
Wed, Jan 7, 7:11 AM
Subscribers

Details

Summary

This is needed because when we add the suspend-to-idle loop, we only want to break the BSP out of idle to process the taskqueue while keeping all the others idled.

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Simplify cpuset initialization.

sys/dev/acpica/Osd/OsdSchedule.c
44

Includes should be ordered alphabetically (except sys/param.h, sys/systm.h)

113

There is no MI guarantee that BSP is CPU with cpuid 0.

I suggest to add MD KPI like GET_BSP_CPUID() and use it there. It is also a good moment to make IS_BSP() available on all arches, not only x86.

If you need help, I might prototype the patch.

obiwac added inline comments.
sys/dev/acpica/Osd/OsdSchedule.c
113

Sure thing. Currently digging a little deeper for getting BSP on non-x86 arches. There probably are some other places we'll need to change this in our ACPI code as at least the shutdown code seems to assume BSP is cpuid 0.

I also see the HPET device is binding its interrupt to the BSP by calling CPU_FIRST() - is this guaranteed to be the BSP? In which case we wouldn't need a GET_BSP_CPUID() I guess and we could make IS_BSP() MI easily.

obiwac retitled this revision from acpi: Make taskqueue only run on CPU0 to acpi: Make taskqueue only run on BSP.
obiwac edited the summary of this revision. (Show Details)

In fact, if you plan to work on proper get_bsp() etc I think it would be useful to commit this change as is now since it eliminates the real issue. Then you would fix it in due course of the the bsp changes.

Might be, mark the cpuset calculation with XXX comment.

sys/dev/acpica/Osd/OsdSchedule.c
113

No, CPU_FIRST() is not guaranteed to be BSP, there is no guarantee for it at all. Look at the implementation.

It happens so far that on x86 BSP == CPUID0 == First cpu since all CPUIDs are dense. But this is only so happen.

This revision is now accepted and ready to land.Thu, Jan 8, 1:46 AM
This revision was automatically updated to reflect the committed changes.