alloc_tag: Introduce selective tracing for MAP
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest5 patches 3 repliesIn review
- v44 patches 1 replySuperseded
- v34 patches 6 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 4 patches | 10 replies | Superseded | |
| v1 | 4 patches | 15 replies | Superseded |
Changes in v5 from the cover letter
- Patch 3/5: Introduced a new patch to introduce a flags field wrapped in an anonymous union with the old inaccurate field. This allows us to extend the UAPI with more filters without breaking backwards compatibility.
- Patch 4/5: Minor update to filter out trace_on tags using flags.
- Patch 5/5: Updated the test to use the new flags UAPI.
Patches in v5 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | alloc_tag: Add trace events for tracing allocationsDocumentation/ MAINTAINERS include/ +5 more | +270 | 0 replies | |
| 2/5 | alloc_tag: Introduce IOCTLs to toggle allocation tracepointsDocumentation/ include/ include/ +2 more | +186 | 3 replies | |
| 3/5 | alloc_tag: Add a flags field to allocinfo_filterinclude/ mm/ | +15 | 0 replies | |
| 4/5 | alloc_tag: Extend allocinfo_filter to support tracing queriesinclude/ mm/ | +14 | 0 replies | |
| 5/5 | alloc_tag: Add a test for trace state toggle and filteringtools/ | +111 | 0 replies |
Reviews trailers per patch
4 of 5 patches have a Reviewed-by or Acked-by.
| Patch | Hao Ge | Suren Baghdasaryan |
|---|---|---|
| 1/5 | A-b | A-b |
| 2/5 | A-b | A-b |
| 3/5 | ||
| 4/5 | A-b | A-b |
| 5/5 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v5 0/5] alloc_tag: Introduce selective tracing for MAP
The existing memory allocation profiling (MAP) tool accurately maintains aggregate counters for overall memory accounting. However, relying purely on aggregated counters restrics the visibility needed for targeted debugging.
This patch series integrates three new tracepoints (alloc_tag_hit, alloc_tag_mem_alloced and alloc_tag_mem_freed) directly into the alloc_hooks_tag fast path.
Enabling trace events globally for all allocations introduces a severe baseline overhead. To limit the performance overhead, we let the admin select specific allocations to be traced.
A new IOCTL is introduced to allow privileged users to determine which allocation tags need tracing enabled. The IOCTL utilizes the pre-existing filtering mechanism to specify the allocation tags to enable tracing on.
v5 changes:
- Patch 3/5: Introduced a new patch to introduce a flags field wrapped in an anonymous union with the old inaccurate field. This allows us to extend the UAPI with more filters without breaking backwards compatibility.
- Patch 4/5: Minor update to filter out trace_on tags using flags.
- Patch 5/5: Updated the test to use the new flags UAPI.
v4 changes:
- Patch 1/4: Minor refactor, changed macro definition of alloc_tag_trace_hit() for the NOOP case.
v3 changes:
- Patch 2/4: Minor refactor, documented the CAP_SYS_ADMIN requirement. Moved the mutex lock / unlock outside the for loop.
v2 changes:
- Patch 1/4: Changed the trace events for the page allocator to track pointer to the head page instead of codetag_ref. alloc_tag_trace_enabled() no longer takes a tag arg, that arg gets added in patch 2 instead where the function makes use of it. Introduced new sections in the Documentation expanding on the newly introduced trace events. Minor typo fixes.
- Patch 2/4: Toggle traces IOCTL now uses the same filter as other related ioctls. IOCTL returns -ENOENT if no tags match and an empty filter matches all tags. Added a subsection in the Documentation expanding on the new IOCTL.
- Patch 4/4: Updated the test to work with the new UAPI from patch 2. Updated commit message to accurately mention that the test flips the state of trace_on, verifies it and restores to the original state.
Abhishek Bapat (5):
alloc_tag: Add trace events for tracing allocations
alloc_tag: Introduce IOCTLs to toggle allocation tracepoints
alloc_tag: Add a flags field to allocinfo_filter
alloc_tag: Extend allocinfo_filter to support tracing queries
alloc_tag: Add a test for trace state toggle and filtering
Documentation/mm/allocation-profiling.rst | 73 ++++++++ MAINTAINERS | 1 + include/linux/alloc_tag.h | 106 +++++++++--- include/linux/codetag.h | 5 +- include/trace/events/alloc_tag.h | 122 +++++++++++++ include/uapi/linux/alloc_tag.h | 37 +++- mm/alloc_tag.c | 161 +++++++++++++++++- mm/page_alloc.c | 4 +- mm/percpu.c | 13 +- mm/slub.c | 6 +- .../alloc_tag/allocinfo_ioctl_test.c | 114 ++++++++++++- 11 files changed, 589 insertions(+), 53 deletions(-) create mode 100644 include/trace/events/alloc_tag.h
base-commit: bcc036cfa1670a64500f6d857eaa71908b79e3fb
Signature · 1 line
2.56.0.506.g506a7eabc5-goog