Page MenuHomeFreeBSD

x86: New (un)idle IPIs for setting idle flag in scheduler
AbandonedPublic

Authored by obiwac on Dec 29 2025, 8:59 PM.
Tags
None
Referenced Files
F151859881: D54409.id168742.diff
Sat, Apr 11, 4:12 AM
Unknown Object (File)
Fri, Apr 10, 11:25 AM
Unknown Object (File)
Sun, Apr 5, 1:01 PM
Unknown Object (File)
Sun, Apr 5, 6:48 AM
Unknown Object (File)
Sun, Mar 29, 12:46 PM
Unknown Object (File)
Sun, Mar 15, 5:17 AM
Unknown Object (File)
Sat, Mar 14, 7:09 PM
Unknown Object (File)
Mar 9 2026, 6:08 PM
Subscribers

Details

Reviewers
olce
markj
Summary

For s2idle, we need a reliable way to force the scheduler into an idle loop. This adds IPIs we can send to specific CPU sets to idle or unidle them.

If I were 100% sure the CPUs wouldn't get any other kinds of IPIs during the s2idle loop, we could probably do away with the extra unidle IPI and just "kick" the CPUs with a preempt or something to clear their scheduler idle flags. But for now this guarantees things will work.

This is a bit heavy-handed and not necessarily the right approach - revision opened mostly so @olce can have a look :)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 69513
Build 66396: arc lint + arc unit

Event Timeline

Can totally use smp_rendezvous_cpus() for this instead of adding 2 new IPIs. I thought I had run into a problem using rendezvous when I first implemented this, but I just tried it again and see no problem doing it this way.

Can totally use smp_rendezvous_cpus() for this instead of adding 2 new IPIs. I thought I had run into a problem using rendezvous when I first implemented this, but I just tried it again and see no problem doing it this way.

So this is as we discussed. Great.