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)
Nov 1 2024, 1:38 AM
Unknown Object (File)
Oct 11 2024, 7:28 AM
Unknown Object (File)
Oct 11 2024, 7:27 AM
Unknown Object (File)
Oct 5 2024, 8:26 PM
Unknown Object (File)
Oct 3 2024, 1:11 AM
Unknown Object (File)
Oct 2 2024, 10:11 PM
Unknown Object (File)
Oct 2 2024, 4:16 PM
Unknown Object (File)
Oct 1 2024, 5:16 AM

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.