Page MenuHomeFreeBSD

sound: Use M_WAITOK where possible
AcceptedPublic

Authored by christos on Sun, Sep 29, 1:23 PM.

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 Skipped
Unit
Tests Skipped
Build Status
Buildable 59652
Build 56539: arc lint + arc unit

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.Sun, Sep 29, 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.