Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,10 @@ struct sched_entity {
unsigned char sched_delayed;
unsigned char rel_deadline;
unsigned char custom_slice;
/* hole */
/* MEM_SPREAD: classified memory-bound, see mem_spread_tick() */
unsigned char mem_bound;
/* MEM_SPREAD: L1D load misses per 1000 active cycles, moving average */
unsigned short mem_rate;

u64 exec_start;
u64 sum_exec_runtime;
Expand Down
5 changes: 3 additions & 2 deletions kernel/sched/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,12 @@ __setup("sched_proxy_exec", setup_proxy_exec);
* at compile time and compiler optimization based on features default.
*/
#define SCHED_FEAT(name, enabled) \
(1UL << __SCHED_FEAT_##name) * enabled |
__read_mostly unsigned int sysctl_sched_features =
(1ULL << __SCHED_FEAT_##name) * enabled |
__read_mostly u64 sysctl_sched_features =
#include "features.h"
0;
#undef SCHED_FEAT
static_assert(__SCHED_FEAT_NR <= 64);

/*
* Print a warning if need_resched is set for the given duration (if
Expand Down
13 changes: 10 additions & 3 deletions kernel/sched/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static int sched_feat_show(struct seq_file *m, void *v)
int i;

for (i = 0; i < __SCHED_FEAT_NR; i++) {
if (!(sysctl_sched_features & (1UL << i)))
if (!(sysctl_sched_features & (1ULL << i)))
seq_puts(m, "NO_");
seq_printf(m, "%s ", sched_feat_names[i]);
}
Expand Down Expand Up @@ -114,10 +114,10 @@ static int sched_feat_set(char *cmp)
return i;

if (neg) {
sysctl_sched_features &= ~(1UL << i);
sysctl_sched_features &= ~(1ULL << i);
sched_feat_disable(i);
} else {
sysctl_sched_features |= (1UL << i);
sysctl_sched_features |= (1ULL << i);
sched_feat_enable(i);
}

Expand Down Expand Up @@ -152,6 +152,9 @@ sched_feat_write(struct file *filp, const char __user *ubuf,
if (ret < 0)
return ret;

/* MEM_SPREAD needs its PMU counters set up or released. */
sched_mem_spread_update();

*ppos += cnt;

return cnt;
Expand Down Expand Up @@ -723,6 +726,8 @@ static __init int sched_init_debug(void)

debugfs_create_u32("base_slice_ns", 0644, debugfs_sched, &sysctl_sched_base_slice);

sched_mem_spread_debugfs(debugfs_sched);

debugfs_create_u32("latency_warn_ms", 0644, debugfs_sched, &sysctl_resched_latency_warn_ms);
debugfs_create_u32("latency_warn_once", 0644, debugfs_sched, &sysctl_resched_latency_warn_once);

Expand Down Expand Up @@ -1424,6 +1429,8 @@ void proc_sched_show_task(struct task_struct *p, struct pid_namespace *ns,
nr_switches = p->nvcsw + p->nivcsw;

P(se.nr_migrations);
P(se.mem_rate);
P(se.mem_bound);

if (schedstat_enabled()) {
u64 avg_atom, avg_per_cpu;
Expand Down
Loading
Loading