Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1728117 > unrolled thread

[PATCH 3/4] sched/deadline: rename __dl_clear() to __dl_sub()

Started byluca abeni <luca.abeni@santannapisa.it>
First post2017-09-07 12:20 +0200
Last post2017-09-08 10:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3/4] sched/deadline: rename __dl_clear() to __dl_sub() luca abeni <luca.abeni@santannapisa.it> - 2017-09-07 12:20 +0200
    Re: [PATCH 3/4] sched/deadline: rename __dl_clear() to __dl_sub() Daniel Bristot de Oliveira <bristot@redhat.com> - 2017-09-08 10:30 +0200

#1728117 — [PATCH 3/4] sched/deadline: rename __dl_clear() to __dl_sub()

Fromluca abeni <luca.abeni@santannapisa.it>
Date2017-09-07 12:20 +0200
Subject[PATCH 3/4] sched/deadline: rename __dl_clear() to __dl_sub()
Message-ID<un24F-71m-9@gated-at.bofh.it>
From: Peter Zijlstra <peterz@infradead.org>

__dl_sub() is more meaningful as a name, and is more consistent
with the naming of the dual function (__dl_add()).

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: luca abeni <luca.abeni@santannapisa.it>
---
 kernel/sched/deadline.c | 10 +++++-----
 kernel/sched/sched.h    |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index d7f9e86..bab11dd 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -242,7 +242,7 @@ static void task_non_contending(struct task_struct *p)
 			if (p->state == TASK_DEAD)
 				sub_rq_bw(p->dl.dl_bw, &rq->dl);
 			raw_spin_lock(&dl_b->lock);
-			__dl_clear(dl_b, p->dl.dl_bw, dl_bw_cpus(task_cpu(p)));
+			__dl_sub(dl_b, p->dl.dl_bw, dl_bw_cpus(task_cpu(p)));
 			__dl_clear_params(p);
 			raw_spin_unlock(&dl_b->lock);
 		}
@@ -1211,7 +1211,7 @@ static enum hrtimer_restart inactive_task_timer(struct hrtimer *timer)
 		}
 
 		raw_spin_lock(&dl_b->lock);
-		__dl_clear(dl_b, p->dl.dl_bw, dl_bw_cpus(task_cpu(p)));
+		__dl_sub(dl_b, p->dl.dl_bw, dl_bw_cpus(task_cpu(p)));
 		raw_spin_unlock(&dl_b->lock);
 		__dl_clear_params(p);
 
@@ -2182,7 +2182,7 @@ static void set_cpus_allowed_dl(struct task_struct *p,
 		 * until we complete the update.
 		 */
 		raw_spin_lock(&src_dl_b->lock);
-		__dl_clear(src_dl_b, p->dl.dl_bw, dl_bw_cpus(task_cpu(p)));
+		__dl_sub(src_dl_b, p->dl.dl_bw, dl_bw_cpus(task_cpu(p)));
 		raw_spin_unlock(&src_dl_b->lock);
 	}
 
@@ -2460,7 +2460,7 @@ int sched_dl_overflow(struct task_struct *p, int policy,
 	if (dl_policy(policy) && !task_has_dl_policy(p) &&
 	    !__dl_overflow(dl_b, cpus, 0, new_bw)) {
 		if (hrtimer_active(&p->dl.inactive_timer))
-			__dl_clear(dl_b, p->dl.dl_bw, cpus);
+			__dl_sub(dl_b, p->dl.dl_bw, cpus);
 		__dl_add(dl_b, new_bw, cpus);
 		err = 0;
 	} else if (dl_policy(policy) && task_has_dl_policy(p) &&
@@ -2472,7 +2472,7 @@ int sched_dl_overflow(struct task_struct *p, int policy,
 		 * But this would require to set the task's "inactive
 		 * timer" when the task is not inactive.
 		 */
-		__dl_clear(dl_b, p->dl.dl_bw, cpus);
+		__dl_sub(dl_b, p->dl.dl_bw, cpus);
 		__dl_add(dl_b, new_bw, cpus);
 		dl_change_utilization(p, new_bw);
 		err = 0;
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 0b93e4b..061ec3b 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -226,7 +226,7 @@ struct dl_bw {
 static inline void __dl_update(struct dl_bw *dl_b, s64 bw);
 
 static inline
-void __dl_clear(struct dl_bw *dl_b, u64 tsk_bw, int cpus)
+void __dl_sub(struct dl_bw *dl_b, u64 tsk_bw, int cpus)
 {
 	dl_b->total_bw -= tsk_bw;
 	__dl_update(dl_b, (s32)tsk_bw / cpus);
-- 
2.7.4

[toc] | [next] | [standalone]


#1728681

FromDaniel Bristot de Oliveira <bristot@redhat.com>
Date2017-09-08 10:30 +0200
Message-ID<unmPL-4eF-9@gated-at.bofh.it>
In reply to#1728117
On 09/07/2017 12:09 PM, luca abeni wrote:
> From: Peter Zijlstra <peterz@infradead.org>
> 
> __dl_sub() is more meaningful as a name, and is more consistent
> with the naming of the dual function (__dl_add()).
> 
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> Signed-off-by: luca abeni <luca.abeni@santannapisa.it>

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

-- Daniel

> ---
>  kernel/sched/deadline.c | 10 +++++-----
>  kernel/sched/sched.h    |  2 +-
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index d7f9e86..bab11dd 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -242,7 +242,7 @@ static void task_non_contending(struct task_struct *p)
>  			if (p->state == TASK_DEAD)
>  				sub_rq_bw(p->dl.dl_bw, &rq->dl);
>  			raw_spin_lock(&dl_b->lock);
> -			__dl_clear(dl_b, p->dl.dl_bw, dl_bw_cpus(task_cpu(p)));
> +			__dl_sub(dl_b, p->dl.dl_bw, dl_bw_cpus(task_cpu(p)));
>  			__dl_clear_params(p);
>  			raw_spin_unlock(&dl_b->lock);
>  		}
> @@ -1211,7 +1211,7 @@ static enum hrtimer_restart inactive_task_timer(struct hrtimer *timer)
>  		}
>  
>  		raw_spin_lock(&dl_b->lock);
> -		__dl_clear(dl_b, p->dl.dl_bw, dl_bw_cpus(task_cpu(p)));
> +		__dl_sub(dl_b, p->dl.dl_bw, dl_bw_cpus(task_cpu(p)));
>  		raw_spin_unlock(&dl_b->lock);
>  		__dl_clear_params(p);
>  
> @@ -2182,7 +2182,7 @@ static void set_cpus_allowed_dl(struct task_struct *p,
>  		 * until we complete the update.
>  		 */
>  		raw_spin_lock(&src_dl_b->lock);
> -		__dl_clear(src_dl_b, p->dl.dl_bw, dl_bw_cpus(task_cpu(p)));
> +		__dl_sub(src_dl_b, p->dl.dl_bw, dl_bw_cpus(task_cpu(p)));
>  		raw_spin_unlock(&src_dl_b->lock);
>  	}
>  
> @@ -2460,7 +2460,7 @@ int sched_dl_overflow(struct task_struct *p, int policy,
>  	if (dl_policy(policy) && !task_has_dl_policy(p) &&
>  	    !__dl_overflow(dl_b, cpus, 0, new_bw)) {
>  		if (hrtimer_active(&p->dl.inactive_timer))
> -			__dl_clear(dl_b, p->dl.dl_bw, cpus);
> +			__dl_sub(dl_b, p->dl.dl_bw, cpus);
>  		__dl_add(dl_b, new_bw, cpus);
>  		err = 0;
>  	} else if (dl_policy(policy) && task_has_dl_policy(p) &&
> @@ -2472,7 +2472,7 @@ int sched_dl_overflow(struct task_struct *p, int policy,
>  		 * But this would require to set the task's "inactive
>  		 * timer" when the task is not inactive.
>  		 */
> -		__dl_clear(dl_b, p->dl.dl_bw, cpus);
> +		__dl_sub(dl_b, p->dl.dl_bw, cpus);
>  		__dl_add(dl_b, new_bw, cpus);
>  		dl_change_utilization(p, new_bw);
>  		err = 0;
> diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
> index 0b93e4b..061ec3b 100644
> --- a/kernel/sched/sched.h
> +++ b/kernel/sched/sched.h
> @@ -226,7 +226,7 @@ struct dl_bw {
>  static inline void __dl_update(struct dl_bw *dl_b, s64 bw);
>  
>  static inline
> -void __dl_clear(struct dl_bw *dl_b, u64 tsk_bw, int cpus)
> +void __dl_sub(struct dl_bw *dl_b, u64 tsk_bw, int cpus)
>  {
>  	dl_b->total_bw -= tsk_bw;
>  	__dl_update(dl_b, (s32)tsk_bw / cpus);
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web