linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kernel/time/posix-cpu-timers: Remove useless call to check_dl_overrun
@ 2018-11-07 11:10 Juri Lelli
  2018-11-07 14:17 ` Daniel Bristot de Oliveira
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Juri Lelli @ 2018-11-07 11:10 UTC (permalink / raw)
  To: peterz, mingo
  Cc: rostedt, tglx, linux-kernel, luca.abeni, claudio, bristot,
	linux-rt-users, mtk.manpages, Juri Lelli, Mathieu Poirier

check_dl_overrun is used to send a SIGXCPU to users that asked to be
informed when SCHED_DEADLINE runtime overruns occur.

The function is called by check_thread_timers already, so the call in
check_process_timers is redundant/wrong (even though harmless).

Remove it.

Fixes: 34be39305a77 ("sched/deadline: Implement "runtime overrun signal" support")
Signed-off-by: Juri Lelli <juri.lelli@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Luca Abeni <luca.abeni@santannapisa.it>
Cc: Claudio Scordino <claudio@evidence.eu.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
---
 kernel/time/posix-cpu-timers.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c
index ce32cf741b25..8f0644af40be 100644
--- a/kernel/time/posix-cpu-timers.c
+++ b/kernel/time/posix-cpu-timers.c
@@ -917,9 +917,6 @@ static void check_process_timers(struct task_struct *tsk,
 	struct task_cputime cputime;
 	unsigned long soft;
 
-	if (dl_task(tsk))
-		check_dl_overrun(tsk);
-
 	/*
 	 * If cputimer is not running, then there are no active
 	 * process wide timers (POSIX 1.b, itimers, RLIMIT_CPU).
-- 
2.17.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] kernel/time/posix-cpu-timers: Remove useless call to check_dl_overrun
  2018-11-07 11:10 [PATCH] kernel/time/posix-cpu-timers: Remove useless call to check_dl_overrun Juri Lelli
@ 2018-11-07 14:17 ` Daniel Bristot de Oliveira
  2018-11-07 14:56 ` Steven Rostedt
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Daniel Bristot de Oliveira @ 2018-11-07 14:17 UTC (permalink / raw)
  To: Juri Lelli, peterz, mingo
  Cc: rostedt, tglx, linux-kernel, luca.abeni, claudio, bristot,
	linux-rt-users, mtk.manpages, Mathieu Poirier



On 11/7/18 12:10 PM, Juri Lelli wrote:
> check_dl_overrun is used to send a SIGXCPU to users that asked to be
> informed when SCHED_DEADLINE runtime overruns occur.
> 
> The function is called by check_thread_timers already, so the call in
> check_process_timers is redundant/wrong (even though harmless).
> 
> Remove it.
> 
> Fixes: 34be39305a77 ("sched/deadline: Implement "runtime overrun signal" support")
> Signed-off-by: Juri Lelli <juri.lelli@redhat.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Luca Abeni <luca.abeni@santannapisa.it>
> Cc: Claudio Scordino <claudio@evidence.eu.com>
> Cc: Mathieu Poirier <mathieu.poirier@linaro.org>

Reviewed-by: Daniel Bristot de Oliveira <bristot@redhat.com>

Thanks!

-- Daniel

> ---
>  kernel/time/posix-cpu-timers.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c
> index ce32cf741b25..8f0644af40be 100644
> --- a/kernel/time/posix-cpu-timers.c
> +++ b/kernel/time/posix-cpu-timers.c
> @@ -917,9 +917,6 @@ static void check_process_timers(struct task_struct *tsk,
>  	struct task_cputime cputime;
>  	unsigned long soft;
>  
> -	if (dl_task(tsk))
> -		check_dl_overrun(tsk);
> -
>  	/*
>  	 * If cputimer is not running, then there are no active
>  	 * process wide timers (POSIX 1.b, itimers, RLIMIT_CPU).
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] kernel/time/posix-cpu-timers: Remove useless call to check_dl_overrun
  2018-11-07 11:10 [PATCH] kernel/time/posix-cpu-timers: Remove useless call to check_dl_overrun Juri Lelli
  2018-11-07 14:17 ` Daniel Bristot de Oliveira
@ 2018-11-07 14:56 ` Steven Rostedt
  2018-11-07 15:02   ` Peter Zijlstra
  2018-11-08  6:45 ` [tip:timers/urgent] posix-cpu-timers: Remove useless call to check_dl_overrun() tip-bot for Juri Lelli
  2018-11-08 10:58 ` [PATCH] kernel/time/posix-cpu-timers: Remove useless call to check_dl_overrun Claudio Scordino
  3 siblings, 1 reply; 7+ messages in thread
From: Steven Rostedt @ 2018-11-07 14:56 UTC (permalink / raw)
  To: Juri Lelli
  Cc: peterz, mingo, tglx, linux-kernel, luca.abeni, claudio, bristot,
	linux-rt-users, mtk.manpages, Mathieu Poirier

On Wed,  7 Nov 2018 12:10:32 +0100
Juri Lelli <juri.lelli@redhat.com> wrote:

> check_dl_overrun is used to send a SIGXCPU to users that asked to be
> informed when SCHED_DEADLINE runtime overruns occur.
> 
> The function is called by check_thread_timers already, so the call in
> check_process_timers is redundant/wrong (even though harmless).
> 
> Remove it.
> 
> Fixes: 34be39305a77 ("sched/deadline: Implement "runtime overrun signal" support")
> Signed-off-by: Juri Lelli <juri.lelli@redhat.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Luca Abeni <luca.abeni@santannapisa.it>
> Cc: Claudio Scordino <claudio@evidence.eu.com>
> Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
> ---
>  kernel/time/posix-cpu-timers.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c
> index ce32cf741b25..8f0644af40be 100644
> --- a/kernel/time/posix-cpu-timers.c
> +++ b/kernel/time/posix-cpu-timers.c
> @@ -917,9 +917,6 @@ static void check_process_timers(struct task_struct *tsk,
>  	struct task_cputime cputime;
>  	unsigned long soft;
>  
> -	if (dl_task(tsk))
> -		check_dl_overrun(tsk);
> -

Hmm, I wonder if we should just move this check directly into
run_posix_cpu_timers() directly. Why is it hidden in this call?

-- Steve


>  	/*
>  	 * If cputimer is not running, then there are no active
>  	 * process wide timers (POSIX 1.b, itimers, RLIMIT_CPU).


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] kernel/time/posix-cpu-timers: Remove useless call to check_dl_overrun
  2018-11-07 14:56 ` Steven Rostedt
@ 2018-11-07 15:02   ` Peter Zijlstra
  2018-11-07 16:31     ` Steven Rostedt
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Zijlstra @ 2018-11-07 15:02 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Juri Lelli, mingo, tglx, linux-kernel, luca.abeni, claudio,
	bristot, linux-rt-users, mtk.manpages, Mathieu Poirier

On Wed, Nov 07, 2018 at 09:56:27AM -0500, Steven Rostedt wrote:
> On Wed,  7 Nov 2018 12:10:32 +0100
> Juri Lelli <juri.lelli@redhat.com> wrote:
> 
> > check_dl_overrun is used to send a SIGXCPU to users that asked to be
> > informed when SCHED_DEADLINE runtime overruns occur.
> > 
> > The function is called by check_thread_timers already, so the call in
> > check_process_timers is redundant/wrong (even though harmless).
> > 
> > Remove it.
> > 
> > Fixes: 34be39305a77 ("sched/deadline: Implement "runtime overrun signal" support")
> > Signed-off-by: Juri Lelli <juri.lelli@redhat.com>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Thomas Gleixner <tglx@linutronix.de>
> > Cc: Luca Abeni <luca.abeni@santannapisa.it>
> > Cc: Claudio Scordino <claudio@evidence.eu.com>
> > Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
> > ---
> >  kernel/time/posix-cpu-timers.c | 3 ---
> >  1 file changed, 3 deletions(-)
> > 
> > diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c
> > index ce32cf741b25..8f0644af40be 100644
> > --- a/kernel/time/posix-cpu-timers.c
> > +++ b/kernel/time/posix-cpu-timers.c
> > @@ -917,9 +917,6 @@ static void check_process_timers(struct task_struct *tsk,
> >  	struct task_cputime cputime;
> >  	unsigned long soft;
> >  
> > -	if (dl_task(tsk))
> > -		check_dl_overrun(tsk);
> > -
> 
> Hmm, I wonder if we should just move this check directly into
> run_posix_cpu_timers() directly. Why is it hidden in this call?

It is not; it is duplicated in this call. The one in
check_thread_timeres() makes sense (it is a thread property).

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] kernel/time/posix-cpu-timers: Remove useless call to check_dl_overrun
  2018-11-07 15:02   ` Peter Zijlstra
@ 2018-11-07 16:31     ` Steven Rostedt
  0 siblings, 0 replies; 7+ messages in thread
From: Steven Rostedt @ 2018-11-07 16:31 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Juri Lelli, mingo, tglx, linux-kernel, luca.abeni, claudio,
	bristot, linux-rt-users, mtk.manpages, Mathieu Poirier

On Wed, 7 Nov 2018 16:02:21 +0100
Peter Zijlstra <peterz@infradead.org> wrote:

> On Wed, Nov 07, 2018 at 09:56:27AM -0500, Steven Rostedt wrote:
> > On Wed,  7 Nov 2018 12:10:32 +0100
> > Juri Lelli <juri.lelli@redhat.com> wrote:
> >   
> > > check_dl_overrun is used to send a SIGXCPU to users that asked to be
> > > informed when SCHED_DEADLINE runtime overruns occur.
> > > 
> > > The function is called by check_thread_timers already, so the call in
> > > check_process_timers is redundant/wrong (even though harmless).
> > > 
> > > Remove it.
> > > 
> > > Fixes: 34be39305a77 ("sched/deadline: Implement "runtime overrun signal" support")
> > > Signed-off-by: Juri Lelli <juri.lelli@redhat.com>
> > > Cc: Peter Zijlstra <peterz@infradead.org>
> > > Cc: Thomas Gleixner <tglx@linutronix.de>
> > > Cc: Luca Abeni <luca.abeni@santannapisa.it>
> > > Cc: Claudio Scordino <claudio@evidence.eu.com>
> > > Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
> > > ---
> > >  kernel/time/posix-cpu-timers.c | 3 ---
> > >  1 file changed, 3 deletions(-)
> > > 
> > > diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c
> > > index ce32cf741b25..8f0644af40be 100644
> > > --- a/kernel/time/posix-cpu-timers.c
> > > +++ b/kernel/time/posix-cpu-timers.c
> > > @@ -917,9 +917,6 @@ static void check_process_timers(struct task_struct *tsk,
> > >  	struct task_cputime cputime;
> > >  	unsigned long soft;
> > >  
> > > -	if (dl_task(tsk))
> > > -		check_dl_overrun(tsk);
> > > -  
> > 
> > Hmm, I wonder if we should just move this check directly into
> > run_posix_cpu_timers() directly. Why is it hidden in this call?  
> 
> It is not; it is duplicated in this call. The one in
> check_thread_timeres() makes sense (it is a thread property).

OK, in that case.

Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

-- Steve

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [tip:timers/urgent] posix-cpu-timers: Remove useless call to check_dl_overrun()
  2018-11-07 11:10 [PATCH] kernel/time/posix-cpu-timers: Remove useless call to check_dl_overrun Juri Lelli
  2018-11-07 14:17 ` Daniel Bristot de Oliveira
  2018-11-07 14:56 ` Steven Rostedt
@ 2018-11-08  6:45 ` tip-bot for Juri Lelli
  2018-11-08 10:58 ` [PATCH] kernel/time/posix-cpu-timers: Remove useless call to check_dl_overrun Claudio Scordino
  3 siblings, 0 replies; 7+ messages in thread
From: tip-bot for Juri Lelli @ 2018-11-08  6:45 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: hpa, mathieu.poirier, tglx, rostedt, bristot, claudio,
	juri.lelli, peterz, mingo, linux-kernel, luca.abeni

Commit-ID:  e6a2d72c10405b30ddba5af2e44a9d3d925a56d3
Gitweb:     https://git.kernel.org/tip/e6a2d72c10405b30ddba5af2e44a9d3d925a56d3
Author:     Juri Lelli <juri.lelli@redhat.com>
AuthorDate: Wed, 7 Nov 2018 12:10:32 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 8 Nov 2018 07:43:35 +0100

posix-cpu-timers: Remove useless call to check_dl_overrun()

check_dl_overrun() is used to send a SIGXCPU to users that asked to be
informed when a SCHED_DEADLINE runtime overruns occur.

The function is called by check_thread_timers() already, so the call in
check_process_timers() is redundant/wrong (even though harmless).

Remove it.

Fixes: 34be39305a77 ("sched/deadline: Implement "runtime overrun signal" support")
Signed-off-by: Juri Lelli <juri.lelli@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Daniel Bristot de Oliveira <bristot@redhat.com>
Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: linux-rt-users@vger.kernel.org
Cc: mtk.manpages@gmail.com
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Luca Abeni <luca.abeni@santannapisa.it>
Cc: Claudio Scordino <claudio@evidence.eu.com>
Link: https://lkml.kernel.org/r/20181107111032.32291-1-juri.lelli@redhat.com

---
 kernel/time/posix-cpu-timers.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c
index ce32cf741b25..8f0644af40be 100644
--- a/kernel/time/posix-cpu-timers.c
+++ b/kernel/time/posix-cpu-timers.c
@@ -917,9 +917,6 @@ static void check_process_timers(struct task_struct *tsk,
 	struct task_cputime cputime;
 	unsigned long soft;
 
-	if (dl_task(tsk))
-		check_dl_overrun(tsk);
-
 	/*
 	 * If cputimer is not running, then there are no active
 	 * process wide timers (POSIX 1.b, itimers, RLIMIT_CPU).

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] kernel/time/posix-cpu-timers: Remove useless call to check_dl_overrun
  2018-11-07 11:10 [PATCH] kernel/time/posix-cpu-timers: Remove useless call to check_dl_overrun Juri Lelli
                   ` (2 preceding siblings ...)
  2018-11-08  6:45 ` [tip:timers/urgent] posix-cpu-timers: Remove useless call to check_dl_overrun() tip-bot for Juri Lelli
@ 2018-11-08 10:58 ` Claudio Scordino
  3 siblings, 0 replies; 7+ messages in thread
From: Claudio Scordino @ 2018-11-08 10:58 UTC (permalink / raw)
  To: Juri Lelli
  Cc: peterz, mingo, rostedt, tglx, linux-kernel, luca.abeni, bristot,
	linux-rt-users, mtk.manpages, Mathieu Poirier

On 071118, 12:10, Juri Lelli wrote:
> check_dl_overrun is used to send a SIGXCPU to users that asked to be
> informed when SCHED_DEADLINE runtime overruns occur.
> 
> The function is called by check_thread_timers already, so the call in
> check_process_timers is redundant/wrong (even though harmless).
> 
> Remove it.
> 
> Fixes: 34be39305a77 ("sched/deadline: Implement "runtime overrun signal" support")
> Signed-off-by: Juri Lelli <juri.lelli@redhat.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Luca Abeni <luca.abeni@santannapisa.it>
> Cc: Claudio Scordino <claudio@evidence.eu.com>
> Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
> ---
>  kernel/time/posix-cpu-timers.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c
> index ce32cf741b25..8f0644af40be 100644
> --- a/kernel/time/posix-cpu-timers.c
> +++ b/kernel/time/posix-cpu-timers.c
> @@ -917,9 +917,6 @@ static void check_process_timers(struct task_struct *tsk,
>  	struct task_cputime cputime;
>  	unsigned long soft;
>  
> -	if (dl_task(tsk))
> -		check_dl_overrun(tsk);
> -
>  	/*
>  	 * If cputimer is not running, then there are no active
>  	 * process wide timers (POSIX 1.b, itimers, RLIMIT_CPU).
> -- 

[ Superfluous as (fortunately) already queued...]
Tested-by: Claudio Scordino <claudio@evidence.eu.com>

Thank you for taking care of this pending issue.

          Claudio

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-11-08 10:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-07 11:10 [PATCH] kernel/time/posix-cpu-timers: Remove useless call to check_dl_overrun Juri Lelli
2018-11-07 14:17 ` Daniel Bristot de Oliveira
2018-11-07 14:56 ` Steven Rostedt
2018-11-07 15:02   ` Peter Zijlstra
2018-11-07 16:31     ` Steven Rostedt
2018-11-08  6:45 ` [tip:timers/urgent] posix-cpu-timers: Remove useless call to check_dl_overrun() tip-bot for Juri Lelli
2018-11-08 10:58 ` [PATCH] kernel/time/posix-cpu-timers: Remove useless call to check_dl_overrun Claudio Scordino

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).