From: Casey Chen <cachen@purestorage.com>
To: Suren Baghdasaryan <surenb@google.com>
Cc: linux-mm@kvack.org, kent.overstreet@linux.dev, yzhong@purestorage.com
Subject: Re: [PATCH 1/1] alloc_tag: remove empty module tag section from linker script
Date: Mon, 9 Jun 2025 14:15:30 -0700 [thread overview]
Message-ID: <CALCePG0_ck0zFHpYktzHk+O8SiEX5yBJ-hKtm7nkF1KPmwZ4vA@mail.gmail.com> (raw)
In-Reply-To: <CAJuCfpEehOR2yRjNxZ+hixLwhrRuFeVfBVNyexHy0+ETbgJpWQ@mail.gmail.com>
On Thu, Jun 5, 2025 at 1:07 PM Suren Baghdasaryan <surenb@google.com> wrote:
>
> On Thu, Jun 5, 2025 at 12:01 PM Casey Chen <cachen@purestorage.com> wrote:
> >
> > The empty MOD_CODETAG_SECTIONS() macro added an incomplete .data
> > section in module linker script, which caused symbol lookup tools
> > like gdb to misinterpret symbol addresses e.g., __ib_process_cq
> > incorrectly mapping to unrelated functions like below.
> >
> > (gdb) disas __ib_process_cq
> > Dump of assembler code for function trace_event_fields_cq_schedule:
> >
> > Removing the empty section restores proper symbol resolution and
> > layout, ensuring .data placement behaves as expected.
>
> Hmm. I'm not sure why an empty .data section would cause such an
> issue. Is that expected behavior?
>
I'm not sure that's why I am posting this to ask for ideas. It looks
like gdb failed to disassemble function.
> To clarify, codetags are designed to support different types of tags,
> not only allocation tags which we currently use. It so happens that
> allocation tags can be still used after module unload, therefore they
> are placed into MOD_SEPARATE_CODETAG_SECTIONS(). If some other tags
> are added in the future and their lifecycle is the same as modules
> (IOW after module unload they can be unloaded too), then they would be
> added into MOD_CODETAG_SECTIONS() but until then this section is
> empty.
>
Could we remove the empty data section with MOD_CODETAG_SECTIONS() for
now until we really need it ?
> >
> > Fixes: 22d407b164ff ("lib: add allocation tagging support for memory allocation profiling")
> > Signed-off-by: Casey Chen <cachen@purestorage.com>
> > Reviewed-by: Yuanyuan Zhong <yzhong@purestorage.com>
> > ---
> > scripts/module.lds.S | 5 -----
> > 1 file changed, 5 deletions(-)
> >
> > diff --git a/scripts/module.lds.S b/scripts/module.lds.S
> > index 711c6e029936..c071ca4beedd 100644
> > --- a/scripts/module.lds.S
> > +++ b/scripts/module.lds.S
> > @@ -50,17 +50,12 @@ SECTIONS {
> > .data : {
> > *(.data .data.[0-9a-zA-Z_]*)
> > *(.data..L*)
> > - MOD_CODETAG_SECTIONS()
> > }
> >
> > .rodata : {
> > *(.rodata .rodata.[0-9a-zA-Z_]*)
> > *(.rodata..L*)
> > }
> > -#else
> > - .data : {
> > - MOD_CODETAG_SECTIONS()
> > - }
> > #endif
> > MOD_SEPARATE_CODETAG_SECTIONS()
> > }
> > --
> > 2.34.1
> >
next prev parent reply other threads:[~2025-06-09 21:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-05 19:01 [PATCH 0/1] alloc_tag: remove empty module tag section from Casey Chen
2025-06-05 19:01 ` [PATCH 1/1] alloc_tag: remove empty module tag section from linker script Casey Chen
2025-06-05 20:07 ` Suren Baghdasaryan
2025-06-09 21:15 ` Casey Chen [this message]
2025-06-09 22:55 ` Suren Baghdasaryan
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=CALCePG0_ck0zFHpYktzHk+O8SiEX5yBJ-hKtm7nkF1KPmwZ4vA@mail.gmail.com \
--to=cachen@purestorage.com \
--cc=kent.overstreet@linux.dev \
--cc=linux-mm@kvack.org \
--cc=surenb@google.com \
--cc=yzhong@purestorage.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