2018-11-07 11:11:47

by Juri Lelli

[permalink] [raw]
Subject: [PATCH] kernel/time/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 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 <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Luca Abeni <[email protected]>
Cc: Claudio Scordino <[email protected]>
Cc: Mathieu Poirier <[email protected]>
---
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



Subject: Re: [PATCH] kernel/time/posix-cpu-timers: Remove useless call to check_dl_overrun



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 <[email protected]>
> Cc: Peter Zijlstra <[email protected]>
> Cc: Thomas Gleixner <[email protected]>
> Cc: Luca Abeni <[email protected]>
> Cc: Claudio Scordino <[email protected]>
> Cc: Mathieu Poirier <[email protected]>

Reviewed-by: Daniel Bristot de Oliveira <[email protected]>

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).
>

2018-11-07 14:59:04

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH] kernel/time/posix-cpu-timers: Remove useless call to check_dl_overrun

On Wed, 7 Nov 2018 12:10:32 +0100
Juri Lelli <[email protected]> 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 <[email protected]>
> Cc: Peter Zijlstra <[email protected]>
> Cc: Thomas Gleixner <[email protected]>
> Cc: Luca Abeni <[email protected]>
> Cc: Claudio Scordino <[email protected]>
> Cc: Mathieu Poirier <[email protected]>
> ---
> 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).


2018-11-07 15:04:59

by Peter Zijlstra

[permalink] [raw]
Subject: Re: [PATCH] kernel/time/posix-cpu-timers: Remove useless call to check_dl_overrun

On Wed, Nov 07, 2018 at 09:56:27AM -0500, Steven Rostedt wrote:
> On Wed, 7 Nov 2018 12:10:32 +0100
> Juri Lelli <[email protected]> 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 <[email protected]>
> > Cc: Peter Zijlstra <[email protected]>
> > Cc: Thomas Gleixner <[email protected]>
> > Cc: Luca Abeni <[email protected]>
> > Cc: Claudio Scordino <[email protected]>
> > Cc: Mathieu Poirier <[email protected]>
> > ---
> > 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).

2018-11-07 16:32:09

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH] kernel/time/posix-cpu-timers: Remove useless call to check_dl_overrun

On Wed, 7 Nov 2018 16:02:21 +0100
Peter Zijlstra <[email protected]> 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 <[email protected]> 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 <[email protected]>
> > > Cc: Peter Zijlstra <[email protected]>
> > > Cc: Thomas Gleixner <[email protected]>
> > > Cc: Luca Abeni <[email protected]>
> > > Cc: Claudio Scordino <[email protected]>
> > > Cc: Mathieu Poirier <[email protected]>
> > > ---
> > > 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) <[email protected]>

-- Steve

Subject: [tip:timers/urgent] posix-cpu-timers: Remove useless call to check_dl_overrun()

Commit-ID: e6a2d72c10405b30ddba5af2e44a9d3d925a56d3
Gitweb: https://git.kernel.org/tip/e6a2d72c10405b30ddba5af2e44a9d3d925a56d3
Author: Juri Lelli <[email protected]>
AuthorDate: Wed, 7 Nov 2018 12:10:32 +0100
Committer: Thomas Gleixner <[email protected]>
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 <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Daniel Bristot de Oliveira <[email protected]>
Reviewed-by: Steven Rostedt (VMware) <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: Mathieu Poirier <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Luca Abeni <[email protected]>
Cc: Claudio Scordino <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]

---
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).

2018-11-08 10:58:49

by Claudio Scordino

[permalink] [raw]
Subject: Re: [PATCH] kernel/time/posix-cpu-timers: Remove useless call to check_dl_overrun

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 <[email protected]>
> Cc: Peter Zijlstra <[email protected]>
> Cc: Thomas Gleixner <[email protected]>
> Cc: Luca Abeni <[email protected]>
> Cc: Claudio Scordino <[email protected]>
> Cc: Mathieu Poirier <[email protected]>
> ---
> 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 <[email protected]>

Thank you for taking care of this pending issue.

Claudio