From: Nix <nix@esperi.org.uk>
To: Kris Van Hees <kris.van.hees@oracle.com>
Cc: dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com
Subject: Re: [PATCH 10/20] libdtrace: retain descriptors for cached module BTF IDs
Date: Fri, 06 Nov 2026 12:59:41 +0000 [thread overview]
Message-ID: <87a4nmt8si.fsf@esperi.org.uk> (raw)
In-Reply-To: <56247e0c69f34acca1cc8c20ffafc4bd@oracle.com>
On 30 Oct 2026, Kris Van Hees outgrape:
> ---
> libdtrace/dt_btf.c | 79 ++++++++++++++++++++++++++++++--
> libdtrace/dt_impl.h | 1 +
> libdtrace/dt_open.c | 1 +
> test/triggers/module-discovery.c | 11 +++++
> 4 files changed, 88 insertions(+), 4 deletions(-)
>
> diff --git a/libdtrace/dt_btf.c b/libdtrace/dt_btf.c
> index 617b0128..727e5f54 100644
> --- a/libdtrace/dt_btf.c
> +++ b/libdtrace/dt_btf.c
> @@ -1479,17 +1479,67 @@ dt_btf_lookup_name_kind(dtrace_hdl_t *dtp, dt_module_t *dmp, const char *name,
> return id;
> }
>
> +/*
> + * Retain a descriptor as well as the ID: otherwise an unloaded object's ID
> + * could be reused and a later enumeration could mistake it for a cached one.
> + * Only IDs assigned to modules are retained, bounding descriptor use by the
> + * number of modules discovered by this handle.
> + */
I suppose just not reusing IDs in general, and having them only
increment, would end up using too many? (I can't remember under what
circumstances they're reused, but I didn't think it was *common*.)
How it interacts with the earlier change to never remove dt_modules when
their corresponding kernel module is unloaded is unclear to me -- is
this the bit that ensures that an unloaded module never gets reused (and
instead we load a new one if the module is reloaded into the kernel), or
what?
--
NULL && (void)
next prev parent reply other threads:[~2026-11-06 12:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-30 19:36 [PATCH 10/20] libdtrace: retain descriptors for cached module BTF IDs Kris Van Hees
2026-11-06 12:59 ` Nix [this message]
2026-11-07 15:59 ` Kris Van Hees
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a4nmt8si.fsf@esperi.org.uk \
--to=nix@esperi.org.uk \
--cc=dtrace-devel@oss.oracle.com \
--cc=dtrace@lists.linux.dev \
--cc=kris.van.hees@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox