Page MenuHomeFreeBSD

reboot: Avoid unlocking Giant if the scheduler is stopped
ClosedPublic

Authored by markj on Nov 3 2023, 8:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 1 2025, 12:57 AM
Unknown Object (File)
Jan 25 2025, 6:28 PM
Unknown Object (File)
Jan 11 2025, 3:44 AM
Unknown Object (File)
Dec 28 2024, 6:45 PM
Unknown Object (File)
Dec 11 2024, 12:33 PM
Unknown Object (File)
Nov 16 2024, 5:55 PM
Unknown Object (File)
Nov 8 2024, 3:03 PM
Unknown Object (File)
Nov 8 2024, 12:39 PM
Subscribers

Details

Summary

When the scheduler is stopped, mtx_unlock() turns into a no-op, so the
loop

    while (mtx_owned(&Giant))
	    mtx_unlock(&Giant);

runs forever if the calling thread has Giant locked.

Diff Detail

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

Event Timeline

markj requested review of this revision.Nov 3 2023, 8:48 PM

No objection, but I wonder why we loop at all.

This revision is now accepted and ready to land.Nov 4 2023, 2:44 PM

No objection, but I wonder why we loop at all.

Giant is recursive, so it could in principle be held multiple times by the same thread.

I thought I'd hit accept yesterday this is fine. Crashes are super weird. I can't think of any other place we do this.. Giant really is special.