Page MenuHomeFreeBSD

linuxkpi: Define `might_alloc()` as a no-op
ClosedPublic

Authored by dumbbell on Jan 22 2023, 2:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Mar 30, 4:28 PM
Unknown Object (File)
Feb 8 2025, 4:32 AM
Unknown Object (File)
Feb 6 2025, 5:18 AM
Unknown Object (File)
Feb 6 2025, 5:18 AM
Unknown Object (File)
Feb 6 2025, 4:55 AM
Unknown Object (File)
Feb 6 2025, 1:58 AM
Unknown Object (File)
Jan 24 2025, 5:22 PM
Unknown Object (File)
Jan 21 2025, 4:12 PM

Diff Detail

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

Event Timeline

bz added inline comments.
sys/compat/linuxkpi/common/include/linux/mm.h
352

If it stays like this please add `__unused`

In D38146#866956, @manu wrote:

What does it do in Linux ?

It is some kind of code annotation to let tools to know which places may allocate memory and perhaps sleep too:

/**
 * might_alloc - Mark possible allocation sites
 * @gfp_mask: gfp_t flags that would be used to allocate
 *
 * Similar to might_sleep() and other annotations, this can be used in functions
 * that might allocate, but often don't. Compiles to nothing without
 * CONFIG_LOCKDEP. Includes a conditional might_sleep() if @gfp allows blocking.
 */

Address @bz comment and add __unused.

This revision is now accepted and ready to land.Jan 28 2023, 8:31 AM
This revision was automatically updated to reflect the committed changes.