summaryrefslogtreecommitdiffstats
path: root/include/linux/sched
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-03-06 11:14:05 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2019-03-06 11:14:05 -0500
commit45802da05e666a81b421422d3e302930c0e24e77 (patch)
treefeca43796693395bb2912c59768dc809022e7583 /include/linux/sched
parent203b6609e0ede49eb0b97008b1150c69e9d2ffd3 (diff)
parentad01423aedaa7c6dd62d560b73a3cb39e6da3901 (diff)
Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler updates from Ingo Molnar: "The main changes in this cycle were: - refcount conversions - Solve the rq->leaf_cfs_rq_list can of worms for real. - improve power-aware scheduling - add sysctl knob for Energy Aware Scheduling - documentation updates - misc other changes" * 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (34 commits) kthread: Do not use TIMER_IRQSAFE kthread: Convert worker lock to raw spinlock sched/fair: Use non-atomic cpumask_{set,clear}_cpu() sched/fair: Remove unused 'sd' parameter from select_idle_smt() sched/wait: Use freezable_schedule() when possible sched/fair: Prune, fix and simplify the nohz_balancer_kick() comment block sched/fair: Explain LLC nohz kick condition sched/fair: Simplify nohz_balancer_kick() sched/topology: Fix percpu data types in struct sd_data & struct s_data sched/fair: Simplify post_init_entity_util_avg() by calling it with a task_struct pointer argument sched/fair: Fix O(nr_cgroups) in the load balancing path sched/fair: Optimize update_blocked_averages() sched/fair: Fix insertion in rq->leaf_cfs_rq_list sched/fair: Add tmp_alone_branch assertion sched/core: Use READ_ONCE()/WRITE_ONCE() in move_queued_task()/task_rq_lock() sched/debug: Initialize sd_sysctl_cpus if !CONFIG_CPUMASK_OFFSTACK sched/pelt: Skip updating util_est when utilization is higher than CPU's capacity sched/fair: Update scale invariance of PELT sched/fair: Move the rq_of() helper function sched/core: Convert task_struct.stack_refcount to refcount_t ...
Diffstat (limited to 'include/linux/sched')
-rw-r--r--include/linux/sched/signal.h5
-rw-r--r--include/linux/sched/sysctl.h7
-rw-r--r--include/linux/sched/task.h4
-rw-r--r--include/linux/sched/task_stack.h2
-rw-r--r--include/linux/sched/topology.h8
5 files changed, 17 insertions, 9 deletions
diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h
index 13789d10a50e..ae5655197698 100644
--- a/include/linux/sched/signal.h
+++ b/include/linux/sched/signal.h
@@ -8,13 +8,14 @@
8#include <linux/sched/jobctl.h> 8#include <linux/sched/jobctl.h>
9#include <linux/sched/task.h> 9#include <linux/sched/task.h>
10#include <linux/cred.h> 10#include <linux/cred.h>
11#include <linux/refcount.h>
11 12
12/* 13/*
13 * Types defining task->signal and task->sighand and APIs using them: 14 * Types defining task->signal and task->sighand and APIs using them:
14 */ 15 */
15 16
16struct sighand_struct { 17struct sighand_struct {
17 atomic_t count; 18 refcount_t count;
18 struct k_sigaction action[_NSIG]; 19 struct k_sigaction action[_NSIG];
19 spinlock_t siglock; 20 spinlock_t siglock;
20 wait_queue_head_t signalfd_wqh; 21 wait_queue_head_t signalfd_wqh;
@@ -82,7 +83,7 @@ struct multiprocess_signals {
82 * the locking of signal_struct. 83 * the locking of signal_struct.
83 */ 84 */
84struct signal_struct { 85struct signal_struct {
85 atomic_t sigcnt; 86 refcount_t sigcnt;
86 atomic_t live; 87 atomic_t live;
87 int nr_threads; 88 int nr_threads;
88 struct list_head thread_head; 89 struct list_head thread_head;
diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h
index a9c32daeb9d8..99ce6d728df7 100644
--- a/include/linux/sched/sysctl.h
+++ b/include/linux/sched/sysctl.h
@@ -83,4 +83,11 @@ extern int sysctl_schedstats(struct ctl_table *table, int write,
83 void __user *buffer, size_t *lenp, 83 void __user *buffer, size_t *lenp,
84 loff_t *ppos); 84 loff_t *ppos);
85 85
86#if defined(CONFIG_ENERGY_MODEL) && defined(CONFIG_CPU_FREQ_GOV_SCHEDUTIL)
87extern unsigned int sysctl_sched_energy_aware;
88extern int sched_energy_aware_handler(struct ctl_table *table, int write,
89 void __user *buffer, size_t *lenp,
90 loff_t *ppos);
91#endif
92
86#endif /* _LINUX_SCHED_SYSCTL_H */ 93#endif /* _LINUX_SCHED_SYSCTL_H */
diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h
index 44c6f15800ff..2e97a2227045 100644
--- a/include/linux/sched/task.h
+++ b/include/linux/sched/task.h
@@ -88,13 +88,13 @@ extern void sched_exec(void);
88#define sched_exec() {} 88#define sched_exec() {}
89#endif 89#endif
90 90
91#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) 91#define get_task_struct(tsk) do { refcount_inc(&(tsk)->usage); } while(0)
92 92
93extern void __put_task_struct(struct task_struct *t); 93extern void __put_task_struct(struct task_struct *t);
94 94
95static inline void put_task_struct(struct task_struct *t) 95static inline void put_task_struct(struct task_struct *t)
96{ 96{
97 if (atomic_dec_and_test(&t->usage)) 97 if (refcount_dec_and_test(&t->usage))
98 __put_task_struct(t); 98 __put_task_struct(t);
99} 99}
100 100
diff --git a/include/linux/sched/task_stack.h b/include/linux/sched/task_stack.h
index 6a841929073f..2413427e439c 100644
--- a/include/linux/sched/task_stack.h
+++ b/include/linux/sched/task_stack.h
@@ -61,7 +61,7 @@ static inline unsigned long *end_of_stack(struct task_struct *p)
61#ifdef CONFIG_THREAD_INFO_IN_TASK 61#ifdef CONFIG_THREAD_INFO_IN_TASK
62static inline void *try_get_task_stack(struct task_struct *tsk) 62static inline void *try_get_task_stack(struct task_struct *tsk)
63{ 63{
64 return atomic_inc_not_zero(&tsk->stack_refcount) ? 64 return refcount_inc_not_zero(&tsk->stack_refcount) ?
65 task_stack_page(tsk) : NULL; 65 task_stack_page(tsk) : NULL;
66} 66}
67 67
diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h
index c31d3a47a47c..57c7ed3fe465 100644
--- a/include/linux/sched/topology.h
+++ b/include/linux/sched/topology.h
@@ -176,10 +176,10 @@ typedef int (*sched_domain_flags_f)(void);
176#define SDTL_OVERLAP 0x01 176#define SDTL_OVERLAP 0x01
177 177
178struct sd_data { 178struct sd_data {
179 struct sched_domain **__percpu sd; 179 struct sched_domain *__percpu *sd;
180 struct sched_domain_shared **__percpu sds; 180 struct sched_domain_shared *__percpu *sds;
181 struct sched_group **__percpu sg; 181 struct sched_group *__percpu *sg;
182 struct sched_group_capacity **__percpu sgc; 182 struct sched_group_capacity *__percpu *sgc;
183}; 183};
184 184
185struct sched_domain_topology_level { 185struct sched_domain_topology_level {