Page MenuHomeFreeBSD

linuxkpi: Add <linux/ref_tracker.h>
ClosedPublic

Authored by dumbbell on Mar 15 2025, 11:13 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 8, 10:25 PM
Unknown Object (File)
Wed, Oct 8, 2:54 AM
Unknown Object (File)
Wed, Oct 8, 1:52 AM
Unknown Object (File)
Mon, Sep 29, 5:08 AM
Unknown Object (File)
Tue, Sep 23, 3:45 AM
Unknown Object (File)
Sun, Sep 21, 7:56 AM
Unknown Object (File)
Sun, Sep 21, 3:37 AM
Unknown Object (File)
Sat, Sep 20, 9:22 PM
Subscribers

Details

Summary

This currently implements the empty stubs when CONFIG_REF_TRACKER is not defined.

This is used by the i915 DRM driver starting with Linux 6.8.

This is part of the update of DRM drivers to Linux 6.8.

Sponsored by: The FreeBSD Foundation

Diff Detail

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

Event Timeline

Let's add a comment describing the functionality here, and make it explicit that the stub implementations are what Linux provides when CONFIG_REF_TRACKER is not defined. (Make it clear that this is distinct from the case in Linuxkpi where we sometimes provide stubs that are actually insufficient / not correct, but function because the driver code calling them does not actually need the results.) Other than that LGTM.

For reference, this arrived originally in Linux commit 4e66934eaadc83b27ada8d42b60894018f3bfabf

lib: add reference counting tracking infrastructure

It can be hard to track where references are taken and released.

In networking, we have annoying issues at device or netns dismantles,
and we had various proposals to ease root causing them.

This patch adds new infrastructure pairing refcount increases
and decreases. This will self document code, because programmers
will have to associate increments/decrements.

This is controled by CONFIG_REF_TRACKER which can be selected
by users of this feature.

This adds both cpu and memory costs, and thus should probably be
used with care.
bz requested changes to this revision.Apr 1 2025, 11:04 PM
bz added a subscriber: bz.

Clicking request changes for @emaste here.

The only other thing I can think of is mark the function arguments __unused but that's kind-of messy.

This revision now requires changes to proceed.Apr 1 2025, 11:04 PM

Fix incorrect sentence in comment.

Let me clear the "request changes" as well.

This revision is now accepted and ready to land.Apr 8 2025, 4:32 PM
This revision was automatically updated to reflect the committed changes.