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)
Tue, Jul 29, 4:19 AM
Unknown Object (File)
Fri, Jul 25, 11:29 AM
Unknown Object (File)
Jun 29 2025, 6:02 PM
Unknown Object (File)
Jun 29 2025, 12:52 PM
Unknown Object (File)
Jun 26 2025, 9:40 PM
Unknown Object (File)
Jun 18 2025, 9:48 PM
Unknown Object (File)
Jun 15 2025, 1:07 AM
Unknown Object (File)
Jun 9 2025, 1:11 PM

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

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.