summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-10-14 13:24:16 -0600
committerLinux Build Service Account <lnxbuild@localhost>2016-10-14 13:24:17 -0600
commitb54fb1cc4df7349076c2456b0bc6f1c8bea4e17d (patch)
tree9be499b25c07d603dbf1c85766676bad68afea39 /kernel
parent2bddc21c9c64e791fb2dffe60bb7b9e2857da0b3 (diff)
parente657410985b5d33b0b4e76f08587345e9fb195ce (diff)
Promotion of kernel.lnx.4.4-161014.1.
CRs Change ID Subject -------------------------------------------------------------------------------------------------------------- 1073291 I7aa23eabdf963146ae628eb159eee13a3e2bb935 msm: ipa3: fix benign prints on ipa3_usb_init 1071271 I35d8cbbd5914f82bef80c8f3d874fedb0b7c74c0 fbdev: use unsigned integers to prevent overflow 1075219 Icc9536f17eedc3559c9f70dc2a8b73127c78c98a qpnp-fg-gen3: Add support to hold soc at 100 when charge 1076216 Id9a3487c8469fe7921148ac8c8cc16afa66593d5 ARM: dts: msm: Fix clock for 720p@240fps usecase 1067981 Ib91bae1c6605e8727081c7acb248192ecf1b170a soc: qcom: qsee_ipc_irq_bridge: Fix null pointer derefer 1075319 I618cc3603df6af18409613209e0373d7e36202fd icnss: Remove msm_bus bandwidth vote 1048291 I9ee694d56dac11c315b45c8fc1e8be9426d06719 usb: pd: Fix PR_SWAP handling 1075481 Ia6b28a3b35a4093aea7af1cffea2a5e093d33ccd soc: qcom: glink: Fix ctx initialization with magic numb 1075659 Ib8211a85543b659b7b19a6ebb85382dbbbecfec6 ASoC: codecs: Add teardown() call in shutdown 1074292 I51af3d4f0e5dd1c9df6375cce4bb933f67f1022e sched/cgroup: Fix/cleanup cgroup teardown/init 1074292 Ice7cbd71d9e545da84d61686aa46c7213607bb9d sched/cgroup: Fix cgroup entity load tracking tear-down 1077644 Icebf88641a5ebb82bb4b7577d1ab402580b1460c iommu/io-pgtable-arm: Use outer shareable for all config 1046094 Iee74c206b28fea9b75df2d234609a7939bc3d93c usb: pd: Improve sink hard reset handling 1066768 I71d520a5a800a3e612dc4d57e7baffa93fad61b3 usb: gadget: f_midi: Use 1024 bytes as MIDI buffer size 1077133 I2ae0fe35e9a207b33f88077ca6ec49d593d43b68 ASoC: wcd934x-dsp-cntl: Make sure memories can enter dee 1075447 Iebc3767e9dbcf10a541b8b02f8696da84312447a input: pat9125: add support of sending rotating switch e 1076632 I9916354c04e24708aced5fc63bc12ddfe87b49f2 ASoC: wcd934x-dsp-cntl: add support for codec restart 1075220 I0a76e9e2f74c40b55e01f9dc106d31a148edefdf qpnp-fg-gen3: add support to configure ki coefficients d 1067981 I7cad7a724666f34bce73d40e4975373604fb1e87 soc: qcom: glink: Fix uninitialzed return value 1063047 I3ea14c8c76c4496eeeb11caf63c3ee62f031b157 leds: qpnp-flash-v2: Add support for configuring hardwar 1021026 Id829f07123963584f6c7fe0174e34006d2697aa9 msm: vidc: Update plane count in get-format 1071809 1072166 1073136 I436ead23c93384961b38ca99b9312a40c50ad03a ASoC: msm: lock read/write when add/free audio ion memor 1077384 I24d3809450bf63cbc6b930575c310cee116910f7 soc: qcom: smem: Update CDSP processor ID 1066768 I969ae3a99f2987abeca51823fe346f383cb23b55 defconfig: Enable USB MIDI Function driver for msmcobalt 1075925 I587b39bc302449591cc0c71ff15b740374a8af4d ARM: dts: msm: Add support for Lpass PIL on msmfalcon 1076097 Ifb8ff50d0eab96eca6f9ca45beb6d1dff9cd3292 msm: ipa: update wan pool size on napi enable Change-Id: I72b22a0088850e157ee5b0d3ddf64f10468c1db2 CRs-Fixed: 1066768, 1077644, 1077133, 1073291, 1076632, 1075219, 1075319, 1075447, 1071809, 1067981, 1075659, 1046094, 1021026, 1077384, 1071271, 1063047, 1072166, 1074292, 1076216, 1075481, 1076097, 1075220, 1073136, 1075925, 1048291
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/core.c39
-rw-r--r--kernel/sched/fair.c37
-rw-r--r--kernel/sched/sched.h2
3 files changed, 37 insertions, 41 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index ff7f6f35fc8f..024fb1007c78 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -8239,7 +8239,7 @@ void set_curr_task(int cpu, struct task_struct *p)
/* task_group_lock serializes the addition/removal of task groups */
static DEFINE_SPINLOCK(task_group_lock);
-static void free_sched_group(struct task_group *tg)
+static void sched_free_group(struct task_group *tg)
{
free_fair_sched_group(tg);
free_rt_sched_group(tg);
@@ -8265,7 +8265,7 @@ struct task_group *sched_create_group(struct task_group *parent)
return tg;
err:
- free_sched_group(tg);
+ sched_free_group(tg);
return ERR_PTR(-ENOMEM);
}
@@ -8285,27 +8285,24 @@ void sched_online_group(struct task_group *tg, struct task_group *parent)
}
/* rcu callback to free various structures associated with a task group */
-static void free_sched_group_rcu(struct rcu_head *rhp)
+static void sched_free_group_rcu(struct rcu_head *rhp)
{
/* now it should be safe to free those cfs_rqs */
- free_sched_group(container_of(rhp, struct task_group, rcu));
+ sched_free_group(container_of(rhp, struct task_group, rcu));
}
-/* Destroy runqueue etc associated with a task group */
void sched_destroy_group(struct task_group *tg)
{
/* wait for possible concurrent references to cfs_rqs complete */
- call_rcu(&tg->rcu, free_sched_group_rcu);
+ call_rcu(&tg->rcu, sched_free_group_rcu);
}
void sched_offline_group(struct task_group *tg)
{
unsigned long flags;
- int i;
/* end participation in shares distribution */
- for_each_possible_cpu(i)
- unregister_fair_sched_group(tg, i);
+ unregister_fair_sched_group(tg);
spin_lock_irqsave(&task_group_lock, flags);
list_del_rcu(&tg->list);
@@ -8756,31 +8753,26 @@ cpu_cgroup_css_alloc(struct cgroup_subsys_state *parent_css)
if (IS_ERR(tg))
return ERR_PTR(-ENOMEM);
+ sched_online_group(tg, parent);
+
return &tg->css;
}
-static int cpu_cgroup_css_online(struct cgroup_subsys_state *css)
+static void cpu_cgroup_css_released(struct cgroup_subsys_state *css)
{
struct task_group *tg = css_tg(css);
- struct task_group *parent = css_tg(css->parent);
- if (parent)
- sched_online_group(tg, parent);
- return 0;
+ sched_offline_group(tg);
}
static void cpu_cgroup_css_free(struct cgroup_subsys_state *css)
{
struct task_group *tg = css_tg(css);
- sched_destroy_group(tg);
-}
-
-static void cpu_cgroup_css_offline(struct cgroup_subsys_state *css)
-{
- struct task_group *tg = css_tg(css);
-
- sched_offline_group(tg);
+ /*
+ * Relies on the RCU grace period between css_released() and this.
+ */
+ sched_free_group(tg);
}
static void cpu_cgroup_fork(struct task_struct *task, void *private)
@@ -9147,9 +9139,8 @@ static struct cftype cpu_files[] = {
struct cgroup_subsys cpu_cgrp_subsys = {
.css_alloc = cpu_cgroup_css_alloc,
+ .css_released = cpu_cgroup_css_released,
.css_free = cpu_cgroup_css_free,
- .css_online = cpu_cgroup_css_online,
- .css_offline = cpu_cgroup_css_offline,
.fork = cpu_cgroup_fork,
.can_attach = cpu_cgroup_can_attach,
.attach = cpu_cgroup_attach,
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 7fdf1efa9086..6362b864e2b1 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -9653,11 +9653,8 @@ void free_fair_sched_group(struct task_group *tg)
for_each_possible_cpu(i) {
if (tg->cfs_rq)
kfree(tg->cfs_rq[i]);
- if (tg->se) {
- if (tg->se[i])
- remove_entity_load_avg(tg->se[i]);
+ if (tg->se)
kfree(tg->se[i]);
- }
}
kfree(tg->cfs_rq);
@@ -9705,21 +9702,29 @@ err:
return 0;
}
-void unregister_fair_sched_group(struct task_group *tg, int cpu)
+void unregister_fair_sched_group(struct task_group *tg)
{
- struct rq *rq = cpu_rq(cpu);
unsigned long flags;
+ struct rq *rq;
+ int cpu;
- /*
- * Only empty task groups can be destroyed; so we can speculatively
- * check on_list without danger of it being re-added.
- */
- if (!tg->cfs_rq[cpu]->on_list)
- return;
+ for_each_possible_cpu(cpu) {
+ if (tg->se[cpu])
+ remove_entity_load_avg(tg->se[cpu]);
- raw_spin_lock_irqsave(&rq->lock, flags);
- list_del_leaf_cfs_rq(tg->cfs_rq[cpu]);
- raw_spin_unlock_irqrestore(&rq->lock, flags);
+ /*
+ * Only empty task groups can be destroyed; so we can speculatively
+ * check on_list without danger of it being re-added.
+ */
+ if (!tg->cfs_rq[cpu]->on_list)
+ continue;
+
+ rq = cpu_rq(cpu);
+
+ raw_spin_lock_irqsave(&rq->lock, flags);
+ list_del_leaf_cfs_rq(tg->cfs_rq[cpu]);
+ raw_spin_unlock_irqrestore(&rq->lock, flags);
+ }
}
void init_tg_cfs_entry(struct task_group *tg, struct cfs_rq *cfs_rq,
@@ -9801,7 +9806,7 @@ int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
return 1;
}
-void unregister_fair_sched_group(struct task_group *tg, int cpu) { }
+void unregister_fair_sched_group(struct task_group *tg) { }
#endif /* CONFIG_FAIR_GROUP_SCHED */
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index ada5e580e968..27b28369440d 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -313,7 +313,7 @@ extern int tg_nop(struct task_group *tg, void *data);
extern void free_fair_sched_group(struct task_group *tg);
extern int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent);
-extern void unregister_fair_sched_group(struct task_group *tg, int cpu);
+extern void unregister_fair_sched_group(struct task_group *tg);
extern void init_tg_cfs_entry(struct task_group *tg, struct cfs_rq *cfs_rq,
struct sched_entity *se, int cpu,
struct sched_entity *parent);