Page MenuHomeFreeBSD

Add missing M_NOWAIT flag
ClosedPublic

Authored by rstone on Oct 23 2019, 4:21 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, May 13, 12:59 AM
Unknown Object (File)
Thu, May 2, 11:45 AM
Unknown Object (File)
Tue, Apr 30, 8:18 PM
Unknown Object (File)
Tue, Apr 30, 8:18 PM
Unknown Object (File)
Tue, Apr 30, 8:15 PM
Unknown Object (File)
Tue, Apr 30, 7:47 PM
Unknown Object (File)
Tue, Apr 30, 7:47 PM
Unknown Object (File)
Tue, Apr 30, 7:46 PM

Details

Summary

The LinuxKPI linux_dma code calls PCTRIE_INSERT with a
mutex held, but does not set M_NOWAIT when allocating
nodes, leading to a potential panic. All of this code
can handle an allocation failure here, so prefer an
allocation failure to sleeping on memory.

Also fix a related case where NOWAIT/WAITOK was not
specified. In this case it's not clear whether sleeping
is allowed so be conservative and assume not. There are
a lot of other paths in this code that can fail due to
a lack of memory anyway.

Sponsored by: Dell EMC Isilon
MFC After: 1 week

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 27171
Build 25442: arc lint + arc unit

Event Timeline

This looks correct.
I agree with the IRC comment about a kassert in uma_zalloc for the flags, but that's not needed here.

This revision is now accepted and ready to land.Oct 23 2019, 4:36 PM
This revision was automatically updated to reflect the committed changes.