From: Hao Ge <hao.ge@linux.dev>
To: Suren Baghdasaryan <surenb@google.com>,
Kent Overstreet <kent.overstreet@linux.dev>,
Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: [PATCH v2 0/2] alloc_tag: fix a leak and a deadlock around shutdown_mem_profiling()
Date: Mon, 17 Aug 2026 14:27:24 +0800 [thread overview]
Message-ID: <20260817062726.106511-1-hao.ge@linux.dev> (raw)
Two fixes for issues reported by sashiko:
1. percpu counter leak on modules loaded after profiling is disabled.
2. AB-BA deadlock between module load and /proc/allocinfo readers.
Changes since the RFC [2]:
- The "move codetag section placement decision to layout_sections()"
patch is dropped from this series. Its retry path depends on [1],
so it will be sent as part of that patchset instead.
- Patch 1 now returns -EOPNOTSUPP instead of introducing
CODETAG_MODULE_LOAD/CODETAG_MODULE_EXCLUDED defines (suggested by
Suren).
- Reported-by tags added.
Patch 1 skips percpu counter allocation when profiling is disabled,
so the module loads without its tags instead of leaking counters.
Patch 2 defers remove_proc_entry() to a workqueue.
[1]: https://lore.kernel.org/all/20260812054105.102637-3-hao.ge@linux.dev/
[2]: https://lore.kernel.org/all/20260813093421.135230-1-hao.ge@linux.dev/
Hao Ge (2):
alloc_tag: skip percpu counter allocation when profiling is disabled
alloc_tag: remove /proc/allocinfo outside of mod_lock
lib/codetag.c | 10 ++++++++--
mm/alloc_tag.c | 14 ++++++++++++-
2 files changed, 21 insertions(+), 3 deletions(-)
--
2.25.1
next reply other threads:[~2026-08-17 6:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 6:27 Hao Ge [this message]
2026-08-17 6:27 ` [PATCH 1/2] alloc_tag: skip percpu counter allocation when profiling is disabled Hao Ge
2026-08-17 6:27 ` [PATCH 2/2] alloc_tag: remove /proc/allocinfo outside of mod_lock Hao Ge
-- strict thread matches above, loose matches on Subject: below --
2026-08-17 6:27 [PATCH v2 0/2] alloc_tag: fix a leak and a deadlock around shutdown_mem_profiling() Hao Ge
2026-08-17 6:26 Hao Ge
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=20260817062726.106511-1-hao.ge@linux.dev \
--to=hao.ge@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=kent.overstreet@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=surenb@google.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