Page MenuHomeFreeBSD

sound: Use M_WAITOK where possible
ClosedPublic

Authored by christos on Sep 29 2024, 1:23 PM.
Tags
None
Referenced Files
F109281548: D46845.diff
Mon, Feb 3, 12:18 AM
Unknown Object (File)
Fri, Jan 24, 5:49 PM
Unknown Object (File)
Sat, Jan 18, 5:58 PM
Unknown Object (File)
Sat, Jan 18, 7:23 AM
Unknown Object (File)
Jan 2 2025, 5:09 PM
Unknown Object (File)
Dec 25 2024, 9:43 PM
Unknown Object (File)
Dec 13 2024, 12:33 PM
Unknown Object (File)
Dec 5 2024, 1:19 AM
Subscribers

Details

Summary

These sections do not call malloc(9) with a lock held.

Sponsored by: The FreeBSD Foundation
MFC after: 2 days

Diff Detail

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

Event Timeline

I accidentally posted a draft patch, which contained some errors. Will re-submit the correct one soon.

christos edited the summary of this revision. (Show Details)
zlei added a subscriber: zlei.

Looks good to me.

This revision is now accepted and ready to land.Sep 29 2024, 2:29 PM

LGTM, I suppose this is save when called through SYSINIT?

LGTM, I suppose this is save when called through SYSINIT?

Yes.

LGTM, I suppose this is save when called through SYSINIT?

Yes.

The justification in your commit log is a bit incomplete: not holding a lock is not sufficient to sleep (e.g., interrupt threads cannot sleep in general, even when they're not holding locks). The thread context matters too. It's ok to sleep in SYSINITs or in driver attach routines.

The justification in your commit log is a bit incomplete: not holding a lock is not sufficient to sleep (e.g., interrupt threads cannot sleep in general, even when they're not holding locks). The thread context matters too. It's ok to sleep in SYSINITs or in driver attach routines.

Good point - the change allows the code to be simplified, and you can just state that the calls are in contexts where sleeping is permitted.

This revision was automatically updated to reflect the committed changes.