[rt] Refresh 0011-sched-fair-Robustify-CFS-bandwidth-timer-locking.patch (context changes in 4.19.84)
This commit is contained in:
parent
ea17f6edde
commit
b62aac68b4
|
@ -1532,6 +1532,8 @@ linux (4.19.84-1) UNRELEASED; urgency=medium
|
||||||
* ipv4: Return -ENETUNREACH if we can't create route but saddr is valid
|
* ipv4: Return -ENETUNREACH if we can't create route but saddr is valid
|
||||||
(Closes: #945023)
|
(Closes: #945023)
|
||||||
* [x86] KVM: x86: introduce is_pae_paging (Regression in 4.19.77)
|
* [x86] KVM: x86: introduce is_pae_paging (Regression in 4.19.77)
|
||||||
|
* [rt] Refresh 0011-sched-fair-Robustify-CFS-bandwidth-timer-locking.patch
|
||||||
|
(context changes in 4.19.84)
|
||||||
|
|
||||||
[ Bastian Blank ]
|
[ Bastian Blank ]
|
||||||
* [amd64/cloud-amd64] Re-enable RTC drivers. (closes: #931341)
|
* [amd64/cloud-amd64] Re-enable RTC drivers. (closes: #931341)
|
||||||
|
|
|
@ -24,15 +24,16 @@ Tested-by: Mike Galbraith <efault@gmx.de>
|
||||||
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
|
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
|
||||||
Link: https://lkml.kernel.org/r/20190107125231.GE14122@hirez.programming.kicks-ass.net
|
Link: https://lkml.kernel.org/r/20190107125231.GE14122@hirez.programming.kicks-ass.net
|
||||||
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||||
|
[Salvatore Bonaccorso: Backport to 4.19.84 due to context changes caused by
|
||||||
|
502bd151448c ("sched/fair: Fix low cpu usage with high throttling by removing
|
||||||
|
expiration of cpu-local slices")]
|
||||||
---
|
---
|
||||||
kernel/sched/fair.c | 30 ++++++++++++++++--------------
|
kernel/sched/fair.c | 30 ++++++++++++++++--------------
|
||||||
1 file changed, 16 insertions(+), 14 deletions(-)
|
1 file changed, 16 insertions(+), 14 deletions(-)
|
||||||
|
|
||||||
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
|
|
||||||
index 32d2dac680a7..b40d8c71e335 100644
|
|
||||||
--- a/kernel/sched/fair.c
|
--- a/kernel/sched/fair.c
|
||||||
+++ b/kernel/sched/fair.c
|
+++ b/kernel/sched/fair.c
|
||||||
@@ -4613,7 +4613,7 @@ static u64 distribute_cfs_runtime(struct cfs_bandwidth *cfs_b,
|
@@ -4560,7 +4560,7 @@
|
||||||
struct rq *rq = rq_of(cfs_rq);
|
struct rq *rq = rq_of(cfs_rq);
|
||||||
struct rq_flags rf;
|
struct rq_flags rf;
|
||||||
|
|
||||||
|
@ -41,7 +42,7 @@ index 32d2dac680a7..b40d8c71e335 100644
|
||||||
if (!cfs_rq_throttled(cfs_rq))
|
if (!cfs_rq_throttled(cfs_rq))
|
||||||
goto next;
|
goto next;
|
||||||
|
|
||||||
@@ -4633,7 +4633,7 @@ static u64 distribute_cfs_runtime(struct cfs_bandwidth *cfs_b,
|
@@ -4579,7 +4579,7 @@
|
||||||
unthrottle_cfs_rq(cfs_rq);
|
unthrottle_cfs_rq(cfs_rq);
|
||||||
|
|
||||||
next:
|
next:
|
||||||
|
@ -50,35 +51,33 @@ index 32d2dac680a7..b40d8c71e335 100644
|
||||||
|
|
||||||
if (!remaining)
|
if (!remaining)
|
||||||
break;
|
break;
|
||||||
@@ -4649,7 +4649,7 @@ static u64 distribute_cfs_runtime(struct cfs_bandwidth *cfs_b,
|
@@ -4595,7 +4595,7 @@
|
||||||
* period the timer is deactivated until scheduling resumes; cfs_b->idle is
|
* period the timer is deactivated until scheduling resumes; cfs_b->idle is
|
||||||
* used to track this state.
|
* used to track this state.
|
||||||
*/
|
*/
|
||||||
-static int do_sched_cfs_period_timer(struct cfs_bandwidth *cfs_b, int overrun)
|
-static int do_sched_cfs_period_timer(struct cfs_bandwidth *cfs_b, int overrun)
|
||||||
+static int do_sched_cfs_period_timer(struct cfs_bandwidth *cfs_b, int overrun, unsigned long flags)
|
+static int do_sched_cfs_period_timer(struct cfs_bandwidth *cfs_b, int overrun, unsigned long flags)
|
||||||
{
|
{
|
||||||
u64 runtime, runtime_expires;
|
u64 runtime;
|
||||||
int throttled;
|
int throttled;
|
||||||
@@ -4691,11 +4691,11 @@ static int do_sched_cfs_period_timer(struct cfs_bandwidth *cfs_b, int overrun)
|
@@ -4635,10 +4635,10 @@
|
||||||
while (throttled && cfs_b->runtime > 0 && !cfs_b->distribute_running) {
|
while (throttled && cfs_b->runtime > 0 && !cfs_b->distribute_running) {
|
||||||
runtime = cfs_b->runtime;
|
runtime = cfs_b->runtime;
|
||||||
cfs_b->distribute_running = 1;
|
cfs_b->distribute_running = 1;
|
||||||
- raw_spin_unlock(&cfs_b->lock);
|
- raw_spin_unlock(&cfs_b->lock);
|
||||||
+ raw_spin_unlock_irqrestore(&cfs_b->lock, flags);
|
+ raw_spin_unlock_irqrestore(&cfs_b->lock, flags);
|
||||||
/* we can't nest cfs_b->lock while distributing bandwidth */
|
/* we can't nest cfs_b->lock while distributing bandwidth */
|
||||||
runtime = distribute_cfs_runtime(cfs_b, runtime,
|
runtime = distribute_cfs_runtime(cfs_b, runtime);
|
||||||
runtime_expires);
|
|
||||||
- raw_spin_lock(&cfs_b->lock);
|
- raw_spin_lock(&cfs_b->lock);
|
||||||
+ raw_spin_lock_irqsave(&cfs_b->lock, flags);
|
+ raw_spin_lock_irqsave(&cfs_b->lock, flags);
|
||||||
|
|
||||||
cfs_b->distribute_running = 0;
|
cfs_b->distribute_running = 0;
|
||||||
throttled = !list_empty(&cfs_b->throttled_cfs_rq);
|
throttled = !list_empty(&cfs_b->throttled_cfs_rq);
|
||||||
@@ -4804,17 +4804,18 @@ static __always_inline void return_cfs_rq_runtime(struct cfs_rq *cfs_rq)
|
@@ -4746,16 +4746,17 @@
|
||||||
static void do_sched_cfs_slack_timer(struct cfs_bandwidth *cfs_b)
|
static void do_sched_cfs_slack_timer(struct cfs_bandwidth *cfs_b)
|
||||||
{
|
{
|
||||||
u64 runtime = 0, slice = sched_cfs_bandwidth_slice();
|
u64 runtime = 0, slice = sched_cfs_bandwidth_slice();
|
||||||
+ unsigned long flags;
|
+ unsigned long flags;
|
||||||
u64 expires;
|
|
||||||
|
|
||||||
/* confirm we're still not at a refresh boundary */
|
/* confirm we're still not at a refresh boundary */
|
||||||
- raw_spin_lock(&cfs_b->lock);
|
- raw_spin_lock(&cfs_b->lock);
|
||||||
|
@ -95,7 +94,7 @@ index 32d2dac680a7..b40d8c71e335 100644
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4825,18 +4826,18 @@ static void do_sched_cfs_slack_timer(struct cfs_bandwidth *cfs_b)
|
@@ -4765,17 +4766,17 @@
|
||||||
if (runtime)
|
if (runtime)
|
||||||
cfs_b->distribute_running = 1;
|
cfs_b->distribute_running = 1;
|
||||||
|
|
||||||
|
@ -105,19 +104,18 @@ index 32d2dac680a7..b40d8c71e335 100644
|
||||||
if (!runtime)
|
if (!runtime)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
runtime = distribute_cfs_runtime(cfs_b, runtime, expires);
|
runtime = distribute_cfs_runtime(cfs_b, runtime);
|
||||||
|
|
||||||
- raw_spin_lock(&cfs_b->lock);
|
- raw_spin_lock(&cfs_b->lock);
|
||||||
+ raw_spin_lock_irqsave(&cfs_b->lock, flags);
|
+ raw_spin_lock_irqsave(&cfs_b->lock, flags);
|
||||||
if (expires == cfs_b->runtime_expires)
|
cfs_b->runtime -= min(runtime, cfs_b->runtime);
|
||||||
cfs_b->runtime -= min(runtime, cfs_b->runtime);
|
|
||||||
cfs_b->distribute_running = 0;
|
cfs_b->distribute_running = 0;
|
||||||
- raw_spin_unlock(&cfs_b->lock);
|
- raw_spin_unlock(&cfs_b->lock);
|
||||||
+ raw_spin_unlock_irqrestore(&cfs_b->lock, flags);
|
+ raw_spin_unlock_irqrestore(&cfs_b->lock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -4916,11 +4917,12 @@ static enum hrtimer_restart sched_cfs_period_timer(struct hrtimer *timer)
|
@@ -4855,11 +4856,12 @@
|
||||||
{
|
{
|
||||||
struct cfs_bandwidth *cfs_b =
|
struct cfs_bandwidth *cfs_b =
|
||||||
container_of(timer, struct cfs_bandwidth, period_timer);
|
container_of(timer, struct cfs_bandwidth, period_timer);
|
||||||
|
@ -131,7 +129,7 @@ index 32d2dac680a7..b40d8c71e335 100644
|
||||||
for (;;) {
|
for (;;) {
|
||||||
overrun = hrtimer_forward_now(timer, cfs_b->period);
|
overrun = hrtimer_forward_now(timer, cfs_b->period);
|
||||||
if (!overrun)
|
if (!overrun)
|
||||||
@@ -4948,11 +4950,11 @@ static enum hrtimer_restart sched_cfs_period_timer(struct hrtimer *timer)
|
@@ -4887,11 +4889,11 @@
|
||||||
count = 0;
|
count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue