summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-02-24 16:59:53 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2024-02-24 16:59:53 -0500
commitcfc98d1cb47744d37d4b0a897dd825ef43298c31 (patch)
tree60b3d22e1266929a2b95d25add172607a57bb7df
parenta47a553baec5f679a9cc6810d3e3b0f8530f98fb (diff)
codetag.idxmemalloc_prof_v4
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r--include/linux/codetag.h11
-rw-r--r--lib/codetag.c4
2 files changed, 10 insertions, 5 deletions
diff --git a/include/linux/codetag.h b/include/linux/codetag.h
index 6aa8cf22d88b..b5a58d82c0a2 100644
--- a/include/linux/codetag.h
+++ b/include/linux/codetag.h
@@ -19,11 +19,12 @@ struct module;
* an array of these.
*/
struct codetag {
- unsigned int flags; /* used in later patches */
- unsigned int lineno;
- const char *modname;
- const char *function;
- const char *filename;
+ u16 idx;
+ u16 flags; /* used in later patches */
+ u32 lineno;
+ const char *modname;
+ const char *function;
+ const char *filename;
} __aligned(8);
union codetag_ref {
diff --git a/lib/codetag.c b/lib/codetag.c
index 5890cecab383..8c47d3d4a367 100644
--- a/lib/codetag.c
+++ b/lib/codetag.c
@@ -244,6 +244,10 @@ insert_done:
rcu_assign_pointer(cttype->mods_rcu, new_mods);
kfree_rcu(old_mods, rcu);
+
+ for (unsigned i = 0; i < cmod.nr; i++)
+ __idx_to_codetag(cttype, &cmod, cmod.idx + i)->idx = cmod.idx + i;
+
return 0;
}