mirror of
https://github.com/torvalds/linux.git
synced 2025-04-12 06:49:52 +00:00
sched_ext: Change the event type from u64 to s64
The event count could be negative in the future, so change the event type from u64 to s64. Signed-off-by: Changwoo Min <changwoo@igalia.com> Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
parent
8a9b1585e2
commit
038730dc12
@ -1489,53 +1489,53 @@ struct scx_event_stats {
|
||||
* If ops.select_cpu() returns a CPU which can't be used by the task,
|
||||
* the core scheduler code silently picks a fallback CPU.
|
||||
*/
|
||||
u64 SCX_EV_SELECT_CPU_FALLBACK;
|
||||
s64 SCX_EV_SELECT_CPU_FALLBACK;
|
||||
|
||||
/*
|
||||
* When dispatching to a local DSQ, the CPU may have gone offline in
|
||||
* the meantime. In this case, the task is bounced to the global DSQ.
|
||||
*/
|
||||
u64 SCX_EV_DISPATCH_LOCAL_DSQ_OFFLINE;
|
||||
s64 SCX_EV_DISPATCH_LOCAL_DSQ_OFFLINE;
|
||||
|
||||
/*
|
||||
* If SCX_OPS_ENQ_LAST is not set, the number of times that a task
|
||||
* continued to run because there were no other tasks on the CPU.
|
||||
*/
|
||||
u64 SCX_EV_DISPATCH_KEEP_LAST;
|
||||
s64 SCX_EV_DISPATCH_KEEP_LAST;
|
||||
|
||||
/*
|
||||
* If SCX_OPS_ENQ_EXITING is not set, the number of times that a task
|
||||
* is dispatched to a local DSQ when exiting.
|
||||
*/
|
||||
u64 SCX_EV_ENQ_SKIP_EXITING;
|
||||
s64 SCX_EV_ENQ_SKIP_EXITING;
|
||||
|
||||
/*
|
||||
* If SCX_OPS_ENQ_MIGRATION_DISABLED is not set, the number of times a
|
||||
* migration disabled task skips ops.enqueue() and is dispatched to its
|
||||
* local DSQ.
|
||||
*/
|
||||
u64 SCX_EV_ENQ_SKIP_MIGRATION_DISABLED;
|
||||
s64 SCX_EV_ENQ_SKIP_MIGRATION_DISABLED;
|
||||
|
||||
/*
|
||||
* The total number of tasks enqueued (or pick_task-ed) with a
|
||||
* default time slice (SCX_SLICE_DFL).
|
||||
*/
|
||||
u64 SCX_EV_ENQ_SLICE_DFL;
|
||||
s64 SCX_EV_ENQ_SLICE_DFL;
|
||||
|
||||
/*
|
||||
* The total duration of bypass modes in nanoseconds.
|
||||
*/
|
||||
u64 SCX_EV_BYPASS_DURATION;
|
||||
s64 SCX_EV_BYPASS_DURATION;
|
||||
|
||||
/*
|
||||
* The number of tasks dispatched in the bypassing mode.
|
||||
*/
|
||||
u64 SCX_EV_BYPASS_DISPATCH;
|
||||
s64 SCX_EV_BYPASS_DISPATCH;
|
||||
|
||||
/*
|
||||
* The number of times the bypassing mode has been activated.
|
||||
*/
|
||||
u64 SCX_EV_BYPASS_ACTIVATE;
|
||||
s64 SCX_EV_BYPASS_ACTIVATE;
|
||||
};
|
||||
|
||||
/*
|
||||
@ -1584,7 +1584,7 @@ static DEFINE_PER_CPU(struct scx_event_stats, event_stats_cpu);
|
||||
* @kind: a kind of event to dump
|
||||
*/
|
||||
#define scx_dump_event(s, events, kind) do { \
|
||||
dump_line(&(s), "%40s: %16llu", #kind, (events)->kind); \
|
||||
dump_line(&(s), "%40s: %16lld", #kind, (events)->kind); \
|
||||
} while (0)
|
||||
|
||||
|
||||
|
@ -776,21 +776,21 @@ static int monitor_timerfn(void *map, int *key, struct bpf_timer *timer)
|
||||
|
||||
__COMPAT_scx_bpf_events(&events, sizeof(events));
|
||||
|
||||
bpf_printk("%35s: %llu", "SCX_EV_SELECT_CPU_FALLBACK",
|
||||
bpf_printk("%35s: %lld", "SCX_EV_SELECT_CPU_FALLBACK",
|
||||
scx_read_event(&events, SCX_EV_SELECT_CPU_FALLBACK));
|
||||
bpf_printk("%35s: %llu", "SCX_EV_DISPATCH_LOCAL_DSQ_OFFLINE",
|
||||
bpf_printk("%35s: %lld", "SCX_EV_DISPATCH_LOCAL_DSQ_OFFLINE",
|
||||
scx_read_event(&events, SCX_EV_DISPATCH_LOCAL_DSQ_OFFLINE));
|
||||
bpf_printk("%35s: %llu", "SCX_EV_DISPATCH_KEEP_LAST",
|
||||
bpf_printk("%35s: %lld", "SCX_EV_DISPATCH_KEEP_LAST",
|
||||
scx_read_event(&events, SCX_EV_DISPATCH_KEEP_LAST));
|
||||
bpf_printk("%35s: %llu", "SCX_EV_ENQ_SKIP_EXITING",
|
||||
bpf_printk("%35s: %lld", "SCX_EV_ENQ_SKIP_EXITING",
|
||||
scx_read_event(&events, SCX_EV_ENQ_SKIP_EXITING));
|
||||
bpf_printk("%35s: %llu", "SCX_EV_ENQ_SLICE_DFL",
|
||||
bpf_printk("%35s: %lld", "SCX_EV_ENQ_SLICE_DFL",
|
||||
scx_read_event(&events, SCX_EV_ENQ_SLICE_DFL));
|
||||
bpf_printk("%35s: %llu", "SCX_EV_BYPASS_DURATION",
|
||||
bpf_printk("%35s: %lld", "SCX_EV_BYPASS_DURATION",
|
||||
scx_read_event(&events, SCX_EV_BYPASS_DURATION));
|
||||
bpf_printk("%35s: %llu", "SCX_EV_BYPASS_DISPATCH",
|
||||
bpf_printk("%35s: %lld", "SCX_EV_BYPASS_DISPATCH",
|
||||
scx_read_event(&events, SCX_EV_BYPASS_DISPATCH));
|
||||
bpf_printk("%35s: %llu", "SCX_EV_BYPASS_ACTIVATE",
|
||||
bpf_printk("%35s: %lld", "SCX_EV_BYPASS_ACTIVATE",
|
||||
scx_read_event(&events, SCX_EV_BYPASS_ACTIVATE));
|
||||
|
||||
bpf_timer_start(timer, ONE_SEC_IN_NS, 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user