Page MenuHomeFreeBSD

vm_lowmem: fix signature mismatch for lowmem event dispatcher
ClosedPublic

Authored by aokblast on Feb 23 2025, 5:14 PM.
Tags
None
Referenced Files
F170655313: D49111.id.diff
Sat, Sep 5, 8:27 PM
F170625868: D49111.id151386.diff
Sat, Sep 5, 5:06 PM
F170625773: D49111.id151386.diff
Sat, Sep 5, 5:06 PM
F170605771: D49111.id151386.diff
Sat, Sep 5, 2:57 PM
F170516178: D49111.id151479.diff
Sat, Sep 5, 4:53 AM
Unknown Object (File)
Fri, Sep 4, 6:17 PM
Unknown Object (File)
Fri, Sep 4, 6:59 AM
Unknown Object (File)
Thu, Sep 3, 11:58 AM

Diff Detail

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

Event Timeline

Use wrapper instead of overwrite

The _1 and _2 parameter names are not typical in FreeBSD. I would suggest sticking with void *arg for the first argument and int flags for the second argument.

sys/ufs/ufs/ufs_dirhash.c
101 ↗(On Diff #151386)

IMHO, better to use meaningful names for arguments even though they aren't used:

foo_lowmem(void *ctx __unused, int flags __unused)

Fix naming convension for argument

This revision is now accepted and ready to land.Feb 25 2025, 1:28 PM

Well, worse than argument arg is only variable var :) But since John suggested that, let it be so.

Heh, ctx would be ok as well. void *arg is a pretty common idiom in FreeBSD for callback arguments where the entity registering a callback gets to pass through an opaque argument to the callback (which is what the first arguments to event handlers are).

I use arg because linuxkpi_vm_lowmem and ttm_pool_mm_shrink use arg.

Here is the commit correspond to this differential revision. Please help me on merging. Thanks:)

https://github.com/aokblast/freebsd-src/commit/5137053014715094a6a8e871ddeb1e4a1fda3546

FYI, I split out the geli fix into a separate commit from the vm_lowmem fixes and tweaked the commit message slightly.