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)
Jan 15 2024, 12:22 AM
Unknown Object (File)
Dec 1 2023, 5:00 AM
Unknown Object (File)
Nov 12 2023, 4:41 AM
Unknown Object (File)
Nov 2 2023, 11:42 PM
Unknown Object (File)
Nov 2 2023, 11:42 PM
Unknown Object (File)
Nov 2 2023, 11:42 PM
Unknown Object (File)
Nov 2 2023, 11:42 PM
Unknown Object (File)
Nov 2 2023, 11:22 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.