summaryrefslogtreecommitdiff
path: root/kernel/events/internal.h
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2024-07-04 19:03:38 +0200
committerPeter Zijlstra <peterz@infradead.org>2024-07-09 13:26:35 +0200
commit5af42f928f3ac555c228740fb4a92d05b19fdd49 (patch)
treeebce35c0bd10a125e88d6cc74b8bfe10fa86e1cd /kernel/events/internal.h
parentc5d93d23a26012a98b77f9e354ab9b3afd420059 (diff)
downloadlinux-next-5af42f928f3ac555c228740fb4a92d05b19fdd49.tar.gz
linux-next-5af42f928f3ac555c228740fb4a92d05b19fdd49.zip
perf: Shrink the size of the recursion counter.
There are four recursion counter, one for each context. The type of the counter is `int' but the counter is used as `bool' since it is only incremented if zero. The main goal here is to shrink the whole struct into 32bit int which can later be added task_struct into an existing hole. Reduce the type of the recursion counter to an unsigned char, keep the increment/ decrement operation. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Tested-by: Marco Elver <elver@google.com> Link: https://lore.kernel.org/r/20240704170424.1466941-5-bigeasy@linutronix.de
Diffstat (limited to 'kernel/events/internal.h')
-rw-r--r--kernel/events/internal.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/events/internal.h b/kernel/events/internal.h
index 386d21c7edfa..7f06b79b3b9f 100644
--- a/kernel/events/internal.h
+++ b/kernel/events/internal.h
@@ -208,7 +208,7 @@ arch_perf_out_copy_user(void *dst, const void *src, unsigned long n)
DEFINE_OUTPUT_COPY(__output_copy_user, arch_perf_out_copy_user)
-static inline int get_recursion_context(int *recursion)
+static inline int get_recursion_context(u8 *recursion)
{
unsigned char rctx = interrupt_context_level();
@@ -221,7 +221,7 @@ static inline int get_recursion_context(int *recursion)
return rctx;
}
-static inline void put_recursion_context(int *recursion, int rctx)
+static inline void put_recursion_context(u8 *recursion, int rctx)
{
barrier();
recursion[rctx]--;