* [PATCH] sched/deadline: Add missing update_rq_clock() in dl_task_timer()
@ 2017-03-07 5:51 Wanpeng Li
2017-03-07 13:35 ` Matt Fleming
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Wanpeng Li @ 2017-03-07 5:51 UTC (permalink / raw)
To: linux-kernel, kvm
Cc: Ingo Molnar, Peter Zijlstra, Wanpeng Li, Juri Lelli,
Thomas Gleixner, Matt Fleming
From: Wanpeng Li <wanpeng.li@hotmail.com>
The following warning can be triggered by hot-unplugging the CPU
on which an active SCHED_DEADLINE task is running on:
------------[ cut here ]------------
WARNING: CPU: 7 PID: 0 at kernel/sched/sched.h:833 replenish_dl_entity+0x71e/0xc40
rq->clock_update_flags < RQCF_ACT_SKIP
CPU: 7 PID: 0 Comm: swapper/7 Tainted: G B 4.11.0-rc1+ #24
Hardware name: LENOVO ThinkCentre M8500t-N000/SHARKBAY, BIOS FBKTC1AUS 02/16/2016
Call Trace:
<IRQ>
dump_stack+0x85/0xc4
__warn+0x172/0x1b0
warn_slowpath_fmt+0xb4/0xf0
? __warn+0x1b0/0x1b0
? debug_check_no_locks_freed+0x2c0/0x2c0
? cpudl_set+0x3d/0x2b0
replenish_dl_entity+0x71e/0xc40
enqueue_task_dl+0x2ea/0x12e0
? dl_task_timer+0x777/0x990
? __hrtimer_run_queues+0x270/0xa50
dl_task_timer+0x316/0x990
? enqueue_task_dl+0x12e0/0x12e0
? enqueue_task_dl+0x12e0/0x12e0
__hrtimer_run_queues+0x270/0xa50
? hrtimer_cancel+0x20/0x20
? hrtimer_interrupt+0x119/0x600
hrtimer_interrupt+0x19c/0x600
? trace_hardirqs_off+0xd/0x10
local_apic_timer_interrupt+0x74/0xe0
smp_apic_timer_interrupt+0x76/0xa0
apic_timer_interrupt+0x93/0xa0
The DL task will be migrated to a suitable later deadline rq once the DL
timer fires and currnet rq is offline. The rq clock of the new rq should
be updated. This patch fixes it by updating the rq clock after holding
the new rq's rq lock.
Cc: Juri Lelli <juri.lelli@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
---
kernel/sched/deadline.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 99b2c33..c6db3fd 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -638,6 +638,7 @@ static enum hrtimer_restart dl_task_timer(struct hrtimer *timer)
lockdep_unpin_lock(&rq->lock, rf.cookie);
rq = dl_task_offline_migration(rq, p);
rf.cookie = lockdep_pin_lock(&rq->lock);
+ update_rq_clock(rq);
/*
* Now that the task has been migrated to the new RQ and we
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] sched/deadline: Add missing update_rq_clock() in dl_task_timer()
2017-03-07 5:51 [PATCH] sched/deadline: Add missing update_rq_clock() in dl_task_timer() Wanpeng Li
@ 2017-03-07 13:35 ` Matt Fleming
2017-03-15 7:53 ` Wanpeng Li
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Matt Fleming @ 2017-03-07 13:35 UTC (permalink / raw)
To: Wanpeng Li
Cc: linux-kernel, kvm, Ingo Molnar, Peter Zijlstra, Wanpeng Li,
Juri Lelli, Thomas Gleixner
On Mon, 06 Mar, at 09:51:28PM, Wanpeng Li wrote:
> From: Wanpeng Li <wanpeng.li@hotmail.com>
>
> The following warning can be triggered by hot-unplugging the CPU
> on which an active SCHED_DEADLINE task is running on:
>
> ------------[ cut here ]------------
> WARNING: CPU: 7 PID: 0 at kernel/sched/sched.h:833 replenish_dl_entity+0x71e/0xc40
> rq->clock_update_flags < RQCF_ACT_SKIP
> CPU: 7 PID: 0 Comm: swapper/7 Tainted: G B 4.11.0-rc1+ #24
[...]
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index 99b2c33..c6db3fd 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -638,6 +638,7 @@ static enum hrtimer_restart dl_task_timer(struct hrtimer *timer)
> lockdep_unpin_lock(&rq->lock, rf.cookie);
> rq = dl_task_offline_migration(rq, p);
> rf.cookie = lockdep_pin_lock(&rq->lock);
> + update_rq_clock(rq);
>
> /*
> * Now that the task has been migrated to the new RQ and we
Yeah, I guess the reason we can't use the rq_repin_lock() function is
because of all the DL double rq locking going on inside of
dl_task_offline_migration().
I'd definitely like someone else to verify, but this looks OK to me.
Reviewed-by: Matt Fleming <matt@codeblueprint.co.uk>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sched/deadline: Add missing update_rq_clock() in dl_task_timer()
2017-03-07 5:51 [PATCH] sched/deadline: Add missing update_rq_clock() in dl_task_timer() Wanpeng Li
2017-03-07 13:35 ` Matt Fleming
@ 2017-03-15 7:53 ` Wanpeng Li
2017-03-15 10:44 ` Daniel Bristot de Oliveira
2017-03-15 11:03 ` Juri Lelli
2017-03-16 11:12 ` [tip:sched/core] " tip-bot for Wanpeng Li
3 siblings, 1 reply; 6+ messages in thread
From: Wanpeng Li @ 2017-03-15 7:53 UTC (permalink / raw)
To: linux-kernel, kvm
Cc: Ingo Molnar, Peter Zijlstra, Wanpeng Li, Juri Lelli,
Thomas Gleixner, Matt Fleming
Ping, :)
2017-03-07 13:51 GMT+08:00 Wanpeng Li <kernellwp@gmail.com>:
> From: Wanpeng Li <wanpeng.li@hotmail.com>
>
> The following warning can be triggered by hot-unplugging the CPU
> on which an active SCHED_DEADLINE task is running on:
>
> ------------[ cut here ]------------
> WARNING: CPU: 7 PID: 0 at kernel/sched/sched.h:833 replenish_dl_entity+0x71e/0xc40
> rq->clock_update_flags < RQCF_ACT_SKIP
> CPU: 7 PID: 0 Comm: swapper/7 Tainted: G B 4.11.0-rc1+ #24
> Hardware name: LENOVO ThinkCentre M8500t-N000/SHARKBAY, BIOS FBKTC1AUS 02/16/2016
> Call Trace:
> <IRQ>
> dump_stack+0x85/0xc4
> __warn+0x172/0x1b0
> warn_slowpath_fmt+0xb4/0xf0
> ? __warn+0x1b0/0x1b0
> ? debug_check_no_locks_freed+0x2c0/0x2c0
> ? cpudl_set+0x3d/0x2b0
> replenish_dl_entity+0x71e/0xc40
> enqueue_task_dl+0x2ea/0x12e0
> ? dl_task_timer+0x777/0x990
> ? __hrtimer_run_queues+0x270/0xa50
> dl_task_timer+0x316/0x990
> ? enqueue_task_dl+0x12e0/0x12e0
> ? enqueue_task_dl+0x12e0/0x12e0
> __hrtimer_run_queues+0x270/0xa50
> ? hrtimer_cancel+0x20/0x20
> ? hrtimer_interrupt+0x119/0x600
> hrtimer_interrupt+0x19c/0x600
> ? trace_hardirqs_off+0xd/0x10
> local_apic_timer_interrupt+0x74/0xe0
> smp_apic_timer_interrupt+0x76/0xa0
> apic_timer_interrupt+0x93/0xa0
>
> The DL task will be migrated to a suitable later deadline rq once the DL
> timer fires and currnet rq is offline. The rq clock of the new rq should
> be updated. This patch fixes it by updating the rq clock after holding
> the new rq's rq lock.
>
> Cc: Juri Lelli <juri.lelli@arm.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Matt Fleming <matt@codeblueprint.co.uk>
> Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
> ---
> kernel/sched/deadline.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index 99b2c33..c6db3fd 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -638,6 +638,7 @@ static enum hrtimer_restart dl_task_timer(struct hrtimer *timer)
> lockdep_unpin_lock(&rq->lock, rf.cookie);
> rq = dl_task_offline_migration(rq, p);
> rf.cookie = lockdep_pin_lock(&rq->lock);
> + update_rq_clock(rq);
>
> /*
> * Now that the task has been migrated to the new RQ and we
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sched/deadline: Add missing update_rq_clock() in dl_task_timer()
2017-03-15 7:53 ` Wanpeng Li
@ 2017-03-15 10:44 ` Daniel Bristot de Oliveira
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Bristot de Oliveira @ 2017-03-15 10:44 UTC (permalink / raw)
To: Wanpeng Li, linux-kernel, kvm
Cc: Ingo Molnar, Peter Zijlstra, Wanpeng Li, Juri Lelli,
Thomas Gleixner, Matt Fleming
On 03/15/2017 08:53 AM, Wanpeng Li wrote:
> Ping, :)
> 2017-03-07 13:51 GMT+08:00 Wanpeng Li <kernellwp@gmail.com>:
>> From: Wanpeng Li <wanpeng.li@hotmail.com>
>>
>> The following warning can be triggered by hot-unplugging the CPU
>> on which an active SCHED_DEADLINE task is running on:
>>
>> ------------[ cut here ]------------
>> WARNING: CPU: 7 PID: 0 at kernel/sched/sched.h:833 replenish_dl_entity+0x71e/0xc40
>> rq->clock_update_flags < RQCF_ACT_SKIP
>> CPU: 7 PID: 0 Comm: swapper/7 Tainted: G B 4.11.0-rc1+ #24
>> Hardware name: LENOVO ThinkCentre M8500t-N000/SHARKBAY, BIOS FBKTC1AUS 02/16/2016
>> Call Trace:
>> <IRQ>
>> dump_stack+0x85/0xc4
>> __warn+0x172/0x1b0
>> warn_slowpath_fmt+0xb4/0xf0
>> ? __warn+0x1b0/0x1b0
>> ? debug_check_no_locks_freed+0x2c0/0x2c0
>> ? cpudl_set+0x3d/0x2b0
>> replenish_dl_entity+0x71e/0xc40
>> enqueue_task_dl+0x2ea/0x12e0
>> ? dl_task_timer+0x777/0x990
>> ? __hrtimer_run_queues+0x270/0xa50
>> dl_task_timer+0x316/0x990
>> ? enqueue_task_dl+0x12e0/0x12e0
>> ? enqueue_task_dl+0x12e0/0x12e0
>> __hrtimer_run_queues+0x270/0xa50
>> ? hrtimer_cancel+0x20/0x20
>> ? hrtimer_interrupt+0x119/0x600
>> hrtimer_interrupt+0x19c/0x600
>> ? trace_hardirqs_off+0xd/0x10
>> local_apic_timer_interrupt+0x74/0xe0
>> smp_apic_timer_interrupt+0x76/0xa0
>> apic_timer_interrupt+0x93/0xa0
>>
>> The DL task will be migrated to a suitable later deadline rq once the DL
>> timer fires and currnet rq is offline. The rq clock of the new rq should
>> be updated. This patch fixes it by updating the rq clock after holding
>> the new rq's rq lock.
>>
>> Cc: Juri Lelli <juri.lelli@arm.com>
>> Cc: Peter Zijlstra <peterz@infradead.org>
>> Cc: Ingo Molnar <mingo@kernel.org>
>> Cc: Thomas Gleixner <tglx@linutronix.de>
>> Cc: Matt Fleming <matt@codeblueprint.co.uk>
>> Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
Reviewed-by: Daniel Bristot de Oliveira <bristot@redhat.com>
-- Daniel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sched/deadline: Add missing update_rq_clock() in dl_task_timer()
2017-03-07 5:51 [PATCH] sched/deadline: Add missing update_rq_clock() in dl_task_timer() Wanpeng Li
2017-03-07 13:35 ` Matt Fleming
2017-03-15 7:53 ` Wanpeng Li
@ 2017-03-15 11:03 ` Juri Lelli
2017-03-16 11:12 ` [tip:sched/core] " tip-bot for Wanpeng Li
3 siblings, 0 replies; 6+ messages in thread
From: Juri Lelli @ 2017-03-15 11:03 UTC (permalink / raw)
To: Wanpeng Li
Cc: linux-kernel, kvm, Ingo Molnar, Peter Zijlstra, Wanpeng Li,
Thomas Gleixner, Matt Fleming
Hi,
On 06/03/17 21:51, Wanpeng Li wrote:
> From: Wanpeng Li <wanpeng.li@hotmail.com>
>
> The following warning can be triggered by hot-unplugging the CPU
> on which an active SCHED_DEADLINE task is running on:
>
> ------------[ cut here ]------------
> WARNING: CPU: 7 PID: 0 at kernel/sched/sched.h:833 replenish_dl_entity+0x71e/0xc40
> rq->clock_update_flags < RQCF_ACT_SKIP
> CPU: 7 PID: 0 Comm: swapper/7 Tainted: G B 4.11.0-rc1+ #24
> Hardware name: LENOVO ThinkCentre M8500t-N000/SHARKBAY, BIOS FBKTC1AUS 02/16/2016
> Call Trace:
> <IRQ>
> dump_stack+0x85/0xc4
> __warn+0x172/0x1b0
> warn_slowpath_fmt+0xb4/0xf0
> ? __warn+0x1b0/0x1b0
> ? debug_check_no_locks_freed+0x2c0/0x2c0
> ? cpudl_set+0x3d/0x2b0
> replenish_dl_entity+0x71e/0xc40
> enqueue_task_dl+0x2ea/0x12e0
> ? dl_task_timer+0x777/0x990
> ? __hrtimer_run_queues+0x270/0xa50
> dl_task_timer+0x316/0x990
> ? enqueue_task_dl+0x12e0/0x12e0
> ? enqueue_task_dl+0x12e0/0x12e0
> __hrtimer_run_queues+0x270/0xa50
> ? hrtimer_cancel+0x20/0x20
> ? hrtimer_interrupt+0x119/0x600
> hrtimer_interrupt+0x19c/0x600
> ? trace_hardirqs_off+0xd/0x10
> local_apic_timer_interrupt+0x74/0xe0
> smp_apic_timer_interrupt+0x76/0xa0
> apic_timer_interrupt+0x93/0xa0
>
> The DL task will be migrated to a suitable later deadline rq once the DL
> timer fires and currnet rq is offline. The rq clock of the new rq should
> be updated. This patch fixes it by updating the rq clock after holding
> the new rq's rq lock.
>
> Cc: Juri Lelli <juri.lelli@arm.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Matt Fleming <matt@codeblueprint.co.uk>
> Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
> ---
> kernel/sched/deadline.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index 99b2c33..c6db3fd 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -638,6 +638,7 @@ static enum hrtimer_restart dl_task_timer(struct hrtimer *timer)
> lockdep_unpin_lock(&rq->lock, rf.cookie);
> rq = dl_task_offline_migration(rq, p);
> rf.cookie = lockdep_pin_lock(&rq->lock);
> + update_rq_clock(rq);
Looks good to me.
Acked-by: Juri Lelli <juri.lelli@arm.com>
Thanks,
- Juri
^ permalink raw reply [flat|nested] 6+ messages in thread
* [tip:sched/core] sched/deadline: Add missing update_rq_clock() in dl_task_timer()
2017-03-07 5:51 [PATCH] sched/deadline: Add missing update_rq_clock() in dl_task_timer() Wanpeng Li
` (2 preceding siblings ...)
2017-03-15 11:03 ` Juri Lelli
@ 2017-03-16 11:12 ` tip-bot for Wanpeng Li
3 siblings, 0 replies; 6+ messages in thread
From: tip-bot for Wanpeng Li @ 2017-03-16 11:12 UTC (permalink / raw)
To: linux-tip-commits
Cc: efault, peterz, juri.lelli, matt, linux-kernel, wanpeng.li,
mingo, torvalds, hpa, tglx
Commit-ID: dcc3b5ffe1b32771c9a22e2c916fb94c4fcf5b79
Gitweb: http://git.kernel.org/tip/dcc3b5ffe1b32771c9a22e2c916fb94c4fcf5b79
Author: Wanpeng Li <wanpeng.li@hotmail.com>
AuthorDate: Mon, 6 Mar 2017 21:51:28 -0800
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 16 Mar 2017 09:20:59 +0100
sched/deadline: Add missing update_rq_clock() in dl_task_timer()
The following warning can be triggered by hot-unplugging the CPU
on which an active SCHED_DEADLINE task is running on:
------------[ cut here ]------------
WARNING: CPU: 7 PID: 0 at kernel/sched/sched.h:833 replenish_dl_entity+0x71e/0xc40
rq->clock_update_flags < RQCF_ACT_SKIP
CPU: 7 PID: 0 Comm: swapper/7 Tainted: G B 4.11.0-rc1+ #24
Hardware name: LENOVO ThinkCentre M8500t-N000/SHARKBAY, BIOS FBKTC1AUS 02/16/2016
Call Trace:
<IRQ>
dump_stack+0x85/0xc4
__warn+0x172/0x1b0
warn_slowpath_fmt+0xb4/0xf0
? __warn+0x1b0/0x1b0
? debug_check_no_locks_freed+0x2c0/0x2c0
? cpudl_set+0x3d/0x2b0
replenish_dl_entity+0x71e/0xc40
enqueue_task_dl+0x2ea/0x12e0
? dl_task_timer+0x777/0x990
? __hrtimer_run_queues+0x270/0xa50
dl_task_timer+0x316/0x990
? enqueue_task_dl+0x12e0/0x12e0
? enqueue_task_dl+0x12e0/0x12e0
__hrtimer_run_queues+0x270/0xa50
? hrtimer_cancel+0x20/0x20
? hrtimer_interrupt+0x119/0x600
hrtimer_interrupt+0x19c/0x600
? trace_hardirqs_off+0xd/0x10
local_apic_timer_interrupt+0x74/0xe0
smp_apic_timer_interrupt+0x76/0xa0
apic_timer_interrupt+0x93/0xa0
The DL task will be migrated to a suitable later deadline rq once the DL
timer fires and currnet rq is offline. The rq clock of the new rq should
be updated. This patch fixes it by updating the rq clock after holding
the new rq's rq lock.
Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Juri Lelli <juri.lelli@arm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1488865888-15894-1-git-send-email-wanpeng.li@hotmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/sched/deadline.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 99b2c33..c6db3fd 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -638,6 +638,7 @@ static enum hrtimer_restart dl_task_timer(struct hrtimer *timer)
lockdep_unpin_lock(&rq->lock, rf.cookie);
rq = dl_task_offline_migration(rq, p);
rf.cookie = lockdep_pin_lock(&rq->lock);
+ update_rq_clock(rq);
/*
* Now that the task has been migrated to the new RQ and we
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-03-16 11:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-07 5:51 [PATCH] sched/deadline: Add missing update_rq_clock() in dl_task_timer() Wanpeng Li
2017-03-07 13:35 ` Matt Fleming
2017-03-15 7:53 ` Wanpeng Li
2017-03-15 10:44 ` Daniel Bristot de Oliveira
2017-03-15 11:03 ` Juri Lelli
2017-03-16 11:12 ` [tip:sched/core] " tip-bot for Wanpeng Li
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.