Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rseq: Add statistics for time slice extensions

Extend the quick statistics with time slice specific fields.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20251215155708.795202254@linutronix.de

authored by

Thomas Gleixner and committed by
Peter Zijlstra
b5b82824 f8380f97

+19
+5
include/linux/rseq_entry.h
··· 15 15 unsigned long cs; 16 16 unsigned long clear; 17 17 unsigned long fixup; 18 + unsigned long s_granted; 19 + unsigned long s_expired; 20 + unsigned long s_revoked; 21 + unsigned long s_yielded; 22 + unsigned long s_aborted; 18 23 }; 19 24 20 25 DECLARE_PER_CPU(struct rseq_stats, rseq_stats);
+14
kernel/rseq.c
··· 138 138 stats.cs += data_race(per_cpu(rseq_stats.cs, cpu)); 139 139 stats.clear += data_race(per_cpu(rseq_stats.clear, cpu)); 140 140 stats.fixup += data_race(per_cpu(rseq_stats.fixup, cpu)); 141 + if (IS_ENABLED(CONFIG_RSEQ_SLICE_EXTENSION)) { 142 + stats.s_granted += data_race(per_cpu(rseq_stats.s_granted, cpu)); 143 + stats.s_expired += data_race(per_cpu(rseq_stats.s_expired, cpu)); 144 + stats.s_revoked += data_race(per_cpu(rseq_stats.s_revoked, cpu)); 145 + stats.s_yielded += data_race(per_cpu(rseq_stats.s_yielded, cpu)); 146 + stats.s_aborted += data_race(per_cpu(rseq_stats.s_aborted, cpu)); 147 + } 141 148 } 142 149 143 150 seq_printf(m, "exit: %16lu\n", stats.exit); ··· 155 148 seq_printf(m, "cs: %16lu\n", stats.cs); 156 149 seq_printf(m, "clear: %16lu\n", stats.clear); 157 150 seq_printf(m, "fixup: %16lu\n", stats.fixup); 151 + if (IS_ENABLED(CONFIG_RSEQ_SLICE_EXTENSION)) { 152 + seq_printf(m, "sgrant: %16lu\n", stats.s_granted); 153 + seq_printf(m, "sexpir: %16lu\n", stats.s_expired); 154 + seq_printf(m, "srevok: %16lu\n", stats.s_revoked); 155 + seq_printf(m, "syield: %16lu\n", stats.s_yielded); 156 + seq_printf(m, "sabort: %16lu\n", stats.s_aborted); 157 + } 158 158 return 0; 159 159 } 160 160