From f469bce8e2d2062568f753ca7e9099715f504df8 Mon Sep 17 00:00:00 2001 From: Steve Muckle Date: Tue, 6 May 2014 18:05:50 -0700 Subject: sched: add migration load change notifier for frequency guidance When a task moves between CPUs in two different frequency domains the cpufreq governor may wish to immediately modify the frequency of both the source and destination CPUs of the migrating task. A tunable is provided to establish what size task is considered "significant" enough to warrant notifying cpufreq. Also fix a bug that would cause load to not be accounted properly during wakeup migrations. Change-Id: Ie8f6b1cc4d43a602840dac18590b42a81327c95a Signed-off-by: Steve Muckle [rameezmustafa@codeaurora.org: Add double rq locking for set_task_cpu()] Signed-off-by: Syed Rameez Mustafa --- include/linux/sched.h | 2 ++ include/linux/sched/sysctl.h | 5 +++++ 2 files changed, 7 insertions(+) (limited to 'include/linux') diff --git a/include/linux/sched.h b/include/linux/sched.h index 763eb0312130..2d2a94575eaa 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -3171,6 +3171,8 @@ struct migration_notify_data { int load; }; +extern struct atomic_notifier_head load_alert_notifier_head; + extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask); extern long sched_getaffinity(pid_t pid, struct cpumask *mask); diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h index 66a978ca7a65..b65ee06f80c9 100644 --- a/include/linux/sched/sysctl.h +++ b/include/linux/sched/sysctl.h @@ -47,6 +47,8 @@ extern unsigned int sysctl_sched_window_stats_policy; extern unsigned int sysctl_sched_init_task_load_pct; #endif +extern unsigned int sysctl_sched_task_migrate_notify_pct; + #ifdef CONFIG_SCHED_HMP extern unsigned int sysctl_sched_enable_hmp_task_placement; extern unsigned int sysctl_sched_mostly_idle_nr_run; @@ -87,6 +89,9 @@ int sched_proc_update_handler(struct ctl_table *table, int write, loff_t *ppos); #endif +extern int sched_migrate_notify_proc_handler(struct ctl_table *table, + int write, void __user *buffer, size_t *lenp, loff_t *ppos); + extern int sched_hmp_proc_update_handler(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos); -- cgit v1.2.3