linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched: Declare sched_rt_bandwidth_account() in include file
@ 2020-06-26 14:02 Guenter Roeck
  2020-06-26 15:03 ` kernel test robot
  2020-06-26 19:16 ` kernel test robot
  0 siblings, 2 replies; 4+ messages in thread
From: Guenter Roeck @ 2020-06-26 14:02 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Peter Zijlstra, Juri Lelli, Vincent Guittot, linux-kernel, Guenter Roeck

gcc reports:

kernel/sched/rt.c:626:6: warning:
		no previous prototype for ‘sched_rt_bandwidth_account’

Let's declare it, and remove the declaration from the source file
where it is called.

Fixes: faa5993736d9 ("sched/deadline: Prevent rt_time growth to infinity")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
Note:
    I know that checkpatch complains about this.
    I declared the function 'extern' to match other declarations in sched.h.

 kernel/sched/deadline.c | 2 --
 kernel/sched/sched.h    | 1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 504d2f51b0d6..ca1b66db5787 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1131,8 +1131,6 @@ int dl_runtime_exceeded(struct sched_dl_entity *dl_se)
 	return (dl_se->runtime <= 0);
 }
 
-extern bool sched_rt_bandwidth_account(struct rt_rq *rt_rq);
-
 /*
  * This function implements the GRUB accounting rule:
  * according to the GRUB reclaiming algorithm, the runtime is
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 1d4e94c1e5fe..02c5d48ed7f3 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -469,6 +469,7 @@ extern int sched_group_set_rt_period(struct task_group *tg, u64 rt_period_us);
 extern long sched_group_rt_runtime(struct task_group *tg);
 extern long sched_group_rt_period(struct task_group *tg);
 extern int sched_rt_can_attach(struct task_group *tg, struct task_struct *tsk);
+extern bool sched_rt_bandwidth_account(struct rt_rq *rt_rq);
 
 extern struct task_group *sched_create_group(struct task_group *parent);
 extern void sched_online_group(struct task_group *tg,
-- 
2.17.1


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

* Re: [PATCH] sched: Declare sched_rt_bandwidth_account() in include file
  2020-06-26 14:02 [PATCH] sched: Declare sched_rt_bandwidth_account() in include file Guenter Roeck
@ 2020-06-26 15:03 ` kernel test robot
  2020-06-26 19:16 ` kernel test robot
  1 sibling, 0 replies; 4+ messages in thread
From: kernel test robot @ 2020-06-26 15:03 UTC (permalink / raw)
  To: Guenter Roeck, Ingo Molnar
  Cc: kbuild-all, Peter Zijlstra, Juri Lelli, Vincent Guittot,
	linux-kernel, Guenter Roeck

[-- Attachment #1: Type: text/plain, Size: 9940 bytes --]

Hi Guenter,

I love your patch! Yet something to improve:

[auto build test ERROR on tip/sched/core]
[also build test ERROR on tip/auto-latest linux/master linus/master v5.8-rc2 next-20200626]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use  as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Guenter-Roeck/sched-Declare-sched_rt_bandwidth_account-in-include-file/20200626-220544
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 01e377c539ca52a6c753d0fdbe93b3b8fcd66a1c
config: i386-tinyconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce (this is a W=1 build):
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   kernel/sched/deadline.c: In function 'update_curr_dl':
>> kernel/sched/deadline.c:1315:7: error: implicit declaration of function 'sched_rt_bandwidth_account' [-Werror=implicit-function-declaration]
    1315 |   if (sched_rt_bandwidth_account(rt_rq))
         |       ^~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/sched_rt_bandwidth_account +1315 kernel/sched/deadline.c

c52f14d384628d Luca Abeni      2017-05-18  1213  
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1214  /*
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1215   * Update the current task's runtime statistics (provided it is still
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1216   * a -deadline task and has not been removed from the dl_rq).
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1217   */
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1218  static void update_curr_dl(struct rq *rq)
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1219  {
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1220  	struct task_struct *curr = rq->curr;
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1221  	struct sched_dl_entity *dl_se = &curr->dl;
07881166a892fa Juri Lelli      2017-12-04  1222  	u64 delta_exec, scaled_delta_exec;
07881166a892fa Juri Lelli      2017-12-04  1223  	int cpu = cpu_of(rq);
6fe0ce1eb04f99 Wen Yang        2018-02-06  1224  	u64 now;
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1225  
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1226  	if (!dl_task(curr) || !on_dl_rq(dl_se))
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1227  		return;
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1228  
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1229  	/*
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1230  	 * Consumed budget is computed considering the time as
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1231  	 * observed by schedulable tasks (excluding time spent
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1232  	 * in hardirq context, etc.). Deadlines are instead
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1233  	 * computed using hard walltime. This seems to be the more
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1234  	 * natural solution, but the full ramifications of this
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1235  	 * approach need further study.
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1236  	 */
6fe0ce1eb04f99 Wen Yang        2018-02-06  1237  	now = rq_clock_task(rq);
6fe0ce1eb04f99 Wen Yang        2018-02-06  1238  	delta_exec = now - curr->se.exec_start;
48be3a67da7413 Peter Zijlstra  2016-02-23  1239  	if (unlikely((s64)delta_exec <= 0)) {
48be3a67da7413 Peter Zijlstra  2016-02-23  1240  		if (unlikely(dl_se->dl_yielded))
48be3a67da7413 Peter Zijlstra  2016-02-23  1241  			goto throttle;
734ff2a71f9e6a Kirill Tkhai    2014-03-04  1242  		return;
48be3a67da7413 Peter Zijlstra  2016-02-23  1243  	}
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1244  
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1245  	schedstat_set(curr->se.statistics.exec_max,
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1246  		      max(curr->se.statistics.exec_max, delta_exec));
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1247  
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1248  	curr->se.sum_exec_runtime += delta_exec;
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1249  	account_group_exec_runtime(curr, delta_exec);
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1250  
6fe0ce1eb04f99 Wen Yang        2018-02-06  1251  	curr->se.exec_start = now;
d2cc5ed6949085 Tejun Heo       2017-09-25  1252  	cgroup_account_cputime(curr, delta_exec);
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1253  
794a56ebd9a57d Juri Lelli      2017-12-04  1254  	if (dl_entity_is_special(dl_se))
794a56ebd9a57d Juri Lelli      2017-12-04  1255  		return;
794a56ebd9a57d Juri Lelli      2017-12-04  1256  
07881166a892fa Juri Lelli      2017-12-04  1257  	/*
07881166a892fa Juri Lelli      2017-12-04  1258  	 * For tasks that participate in GRUB, we implement GRUB-PA: the
07881166a892fa Juri Lelli      2017-12-04  1259  	 * spare reclaimed bandwidth is used to clock down frequency.
07881166a892fa Juri Lelli      2017-12-04  1260  	 *
07881166a892fa Juri Lelli      2017-12-04  1261  	 * For the others, we still need to scale reservation parameters
07881166a892fa Juri Lelli      2017-12-04  1262  	 * according to current frequency and CPU maximum capacity.
07881166a892fa Juri Lelli      2017-12-04  1263  	 */
07881166a892fa Juri Lelli      2017-12-04  1264  	if (unlikely(dl_se->flags & SCHED_FLAG_RECLAIM)) {
07881166a892fa Juri Lelli      2017-12-04  1265  		scaled_delta_exec = grub_reclaim(delta_exec,
07881166a892fa Juri Lelli      2017-12-04  1266  						 rq,
07881166a892fa Juri Lelli      2017-12-04  1267  						 &curr->dl);
07881166a892fa Juri Lelli      2017-12-04  1268  	} else {
07881166a892fa Juri Lelli      2017-12-04  1269  		unsigned long scale_freq = arch_scale_freq_capacity(cpu);
8ec59c0f5f4966 Vincent Guittot 2019-06-17  1270  		unsigned long scale_cpu = arch_scale_cpu_capacity(cpu);
07881166a892fa Juri Lelli      2017-12-04  1271  
07881166a892fa Juri Lelli      2017-12-04  1272  		scaled_delta_exec = cap_scale(delta_exec, scale_freq);
07881166a892fa Juri Lelli      2017-12-04  1273  		scaled_delta_exec = cap_scale(scaled_delta_exec, scale_cpu);
07881166a892fa Juri Lelli      2017-12-04  1274  	}
07881166a892fa Juri Lelli      2017-12-04  1275  
07881166a892fa Juri Lelli      2017-12-04  1276  	dl_se->runtime -= scaled_delta_exec;
48be3a67da7413 Peter Zijlstra  2016-02-23  1277  
48be3a67da7413 Peter Zijlstra  2016-02-23  1278  throttle:
48be3a67da7413 Peter Zijlstra  2016-02-23  1279  	if (dl_runtime_exceeded(dl_se) || dl_se->dl_yielded) {
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1280  		dl_se->dl_throttled = 1;
34be39305a77b8 Juri Lelli      2017-12-12  1281  
34be39305a77b8 Juri Lelli      2017-12-12  1282  		/* If requested, inform the user about runtime overruns. */
34be39305a77b8 Juri Lelli      2017-12-12  1283  		if (dl_runtime_exceeded(dl_se) &&
34be39305a77b8 Juri Lelli      2017-12-12  1284  		    (dl_se->flags & SCHED_FLAG_DL_OVERRUN))
34be39305a77b8 Juri Lelli      2017-12-12  1285  			dl_se->dl_overrun = 1;
34be39305a77b8 Juri Lelli      2017-12-12  1286  
1019a359d3dc4b Peter Zijlstra  2014-11-26  1287  		__dequeue_task_dl(rq, curr, 0);
a649f237db1845 Peter Zijlstra  2015-06-11  1288  		if (unlikely(dl_se->dl_boosted || !start_dl_timer(curr)))
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1289  			enqueue_task_dl(rq, curr, ENQUEUE_REPLENISH);
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1290  
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1291  		if (!is_leftmost(curr, &rq->dl))
8875125efe8402 Kirill Tkhai    2014-06-29  1292  			resched_curr(rq);
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1293  	}
1724813d9f2c7f Peter Zijlstra  2013-12-17  1294  
1724813d9f2c7f Peter Zijlstra  2013-12-17  1295  	/*
1724813d9f2c7f Peter Zijlstra  2013-12-17  1296  	 * Because -- for now -- we share the rt bandwidth, we need to
1724813d9f2c7f Peter Zijlstra  2013-12-17  1297  	 * account our runtime there too, otherwise actual rt tasks
1724813d9f2c7f Peter Zijlstra  2013-12-17  1298  	 * would be able to exceed the shared quota.
1724813d9f2c7f Peter Zijlstra  2013-12-17  1299  	 *
1724813d9f2c7f Peter Zijlstra  2013-12-17  1300  	 * Account to the root rt group for now.
1724813d9f2c7f Peter Zijlstra  2013-12-17  1301  	 *
1724813d9f2c7f Peter Zijlstra  2013-12-17  1302  	 * The solution we're working towards is having the RT groups scheduled
1724813d9f2c7f Peter Zijlstra  2013-12-17  1303  	 * using deadline servers -- however there's a few nasties to figure
1724813d9f2c7f Peter Zijlstra  2013-12-17  1304  	 * out before that can happen.
1724813d9f2c7f Peter Zijlstra  2013-12-17  1305  	 */
1724813d9f2c7f Peter Zijlstra  2013-12-17  1306  	if (rt_bandwidth_enabled()) {
1724813d9f2c7f Peter Zijlstra  2013-12-17  1307  		struct rt_rq *rt_rq = &rq->rt;
1724813d9f2c7f Peter Zijlstra  2013-12-17  1308  
1724813d9f2c7f Peter Zijlstra  2013-12-17  1309  		raw_spin_lock(&rt_rq->rt_runtime_lock);
1724813d9f2c7f Peter Zijlstra  2013-12-17  1310  		/*
1724813d9f2c7f Peter Zijlstra  2013-12-17  1311  		 * We'll let actual RT tasks worry about the overflow here, we
faa5993736d9b4 Juri Lelli      2014-02-21  1312  		 * have our own CBS to keep us inline; only account when RT
faa5993736d9b4 Juri Lelli      2014-02-21  1313  		 * bandwidth is relevant.
1724813d9f2c7f Peter Zijlstra  2013-12-17  1314  		 */
faa5993736d9b4 Juri Lelli      2014-02-21 @1315  		if (sched_rt_bandwidth_account(rt_rq))
faa5993736d9b4 Juri Lelli      2014-02-21  1316  			rt_rq->rt_time += delta_exec;
1724813d9f2c7f Peter Zijlstra  2013-12-17  1317  		raw_spin_unlock(&rt_rq->rt_runtime_lock);
1724813d9f2c7f Peter Zijlstra  2013-12-17  1318  	}
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1319  }
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1320  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 7287 bytes --]

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

* Re: [PATCH] sched: Declare sched_rt_bandwidth_account() in include file
  2020-06-26 14:02 [PATCH] sched: Declare sched_rt_bandwidth_account() in include file Guenter Roeck
  2020-06-26 15:03 ` kernel test robot
@ 2020-06-26 19:16 ` kernel test robot
  2020-06-26 22:41   ` Guenter Roeck
  1 sibling, 1 reply; 4+ messages in thread
From: kernel test robot @ 2020-06-26 19:16 UTC (permalink / raw)
  To: Guenter Roeck, Ingo Molnar
  Cc: kbuild-all, clang-built-linux, Peter Zijlstra, Juri Lelli,
	Vincent Guittot, linux-kernel, Guenter Roeck

[-- Attachment #1: Type: text/plain, Size: 10227 bytes --]

Hi Guenter,

I love your patch! Yet something to improve:

[auto build test ERROR on tip/sched/core]
[also build test ERROR on tip/auto-latest linux/master linus/master v5.8-rc2 next-20200626]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use  as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Guenter-Roeck/sched-Declare-sched_rt_bandwidth_account-in-include-file/20200626-220544
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 01e377c539ca52a6c753d0fdbe93b3b8fcd66a1c
config: x86_64-allnoconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 6e11ed52057ffc39941cb2de6d93cae522db4782)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> kernel/sched/deadline.c:1315:7: error: implicit declaration of function 'sched_rt_bandwidth_account' [-Werror,-Wimplicit-function-declaration]
                   if (sched_rt_bandwidth_account(rt_rq))
                       ^
   1 error generated.

vim +/sched_rt_bandwidth_account +1315 kernel/sched/deadline.c

c52f14d384628d Luca Abeni      2017-05-18  1213  
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1214  /*
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1215   * Update the current task's runtime statistics (provided it is still
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1216   * a -deadline task and has not been removed from the dl_rq).
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1217   */
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1218  static void update_curr_dl(struct rq *rq)
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1219  {
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1220  	struct task_struct *curr = rq->curr;
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1221  	struct sched_dl_entity *dl_se = &curr->dl;
07881166a892fa Juri Lelli      2017-12-04  1222  	u64 delta_exec, scaled_delta_exec;
07881166a892fa Juri Lelli      2017-12-04  1223  	int cpu = cpu_of(rq);
6fe0ce1eb04f99 Wen Yang        2018-02-06  1224  	u64 now;
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1225  
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1226  	if (!dl_task(curr) || !on_dl_rq(dl_se))
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1227  		return;
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1228  
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1229  	/*
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1230  	 * Consumed budget is computed considering the time as
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1231  	 * observed by schedulable tasks (excluding time spent
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1232  	 * in hardirq context, etc.). Deadlines are instead
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1233  	 * computed using hard walltime. This seems to be the more
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1234  	 * natural solution, but the full ramifications of this
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1235  	 * approach need further study.
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1236  	 */
6fe0ce1eb04f99 Wen Yang        2018-02-06  1237  	now = rq_clock_task(rq);
6fe0ce1eb04f99 Wen Yang        2018-02-06  1238  	delta_exec = now - curr->se.exec_start;
48be3a67da7413 Peter Zijlstra  2016-02-23  1239  	if (unlikely((s64)delta_exec <= 0)) {
48be3a67da7413 Peter Zijlstra  2016-02-23  1240  		if (unlikely(dl_se->dl_yielded))
48be3a67da7413 Peter Zijlstra  2016-02-23  1241  			goto throttle;
734ff2a71f9e6a Kirill Tkhai    2014-03-04  1242  		return;
48be3a67da7413 Peter Zijlstra  2016-02-23  1243  	}
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1244  
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1245  	schedstat_set(curr->se.statistics.exec_max,
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1246  		      max(curr->se.statistics.exec_max, delta_exec));
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1247  
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1248  	curr->se.sum_exec_runtime += delta_exec;
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1249  	account_group_exec_runtime(curr, delta_exec);
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1250  
6fe0ce1eb04f99 Wen Yang        2018-02-06  1251  	curr->se.exec_start = now;
d2cc5ed6949085 Tejun Heo       2017-09-25  1252  	cgroup_account_cputime(curr, delta_exec);
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1253  
794a56ebd9a57d Juri Lelli      2017-12-04  1254  	if (dl_entity_is_special(dl_se))
794a56ebd9a57d Juri Lelli      2017-12-04  1255  		return;
794a56ebd9a57d Juri Lelli      2017-12-04  1256  
07881166a892fa Juri Lelli      2017-12-04  1257  	/*
07881166a892fa Juri Lelli      2017-12-04  1258  	 * For tasks that participate in GRUB, we implement GRUB-PA: the
07881166a892fa Juri Lelli      2017-12-04  1259  	 * spare reclaimed bandwidth is used to clock down frequency.
07881166a892fa Juri Lelli      2017-12-04  1260  	 *
07881166a892fa Juri Lelli      2017-12-04  1261  	 * For the others, we still need to scale reservation parameters
07881166a892fa Juri Lelli      2017-12-04  1262  	 * according to current frequency and CPU maximum capacity.
07881166a892fa Juri Lelli      2017-12-04  1263  	 */
07881166a892fa Juri Lelli      2017-12-04  1264  	if (unlikely(dl_se->flags & SCHED_FLAG_RECLAIM)) {
07881166a892fa Juri Lelli      2017-12-04  1265  		scaled_delta_exec = grub_reclaim(delta_exec,
07881166a892fa Juri Lelli      2017-12-04  1266  						 rq,
07881166a892fa Juri Lelli      2017-12-04  1267  						 &curr->dl);
07881166a892fa Juri Lelli      2017-12-04  1268  	} else {
07881166a892fa Juri Lelli      2017-12-04  1269  		unsigned long scale_freq = arch_scale_freq_capacity(cpu);
8ec59c0f5f4966 Vincent Guittot 2019-06-17  1270  		unsigned long scale_cpu = arch_scale_cpu_capacity(cpu);
07881166a892fa Juri Lelli      2017-12-04  1271  
07881166a892fa Juri Lelli      2017-12-04  1272  		scaled_delta_exec = cap_scale(delta_exec, scale_freq);
07881166a892fa Juri Lelli      2017-12-04  1273  		scaled_delta_exec = cap_scale(scaled_delta_exec, scale_cpu);
07881166a892fa Juri Lelli      2017-12-04  1274  	}
07881166a892fa Juri Lelli      2017-12-04  1275  
07881166a892fa Juri Lelli      2017-12-04  1276  	dl_se->runtime -= scaled_delta_exec;
48be3a67da7413 Peter Zijlstra  2016-02-23  1277  
48be3a67da7413 Peter Zijlstra  2016-02-23  1278  throttle:
48be3a67da7413 Peter Zijlstra  2016-02-23  1279  	if (dl_runtime_exceeded(dl_se) || dl_se->dl_yielded) {
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1280  		dl_se->dl_throttled = 1;
34be39305a77b8 Juri Lelli      2017-12-12  1281  
34be39305a77b8 Juri Lelli      2017-12-12  1282  		/* If requested, inform the user about runtime overruns. */
34be39305a77b8 Juri Lelli      2017-12-12  1283  		if (dl_runtime_exceeded(dl_se) &&
34be39305a77b8 Juri Lelli      2017-12-12  1284  		    (dl_se->flags & SCHED_FLAG_DL_OVERRUN))
34be39305a77b8 Juri Lelli      2017-12-12  1285  			dl_se->dl_overrun = 1;
34be39305a77b8 Juri Lelli      2017-12-12  1286  
1019a359d3dc4b Peter Zijlstra  2014-11-26  1287  		__dequeue_task_dl(rq, curr, 0);
a649f237db1845 Peter Zijlstra  2015-06-11  1288  		if (unlikely(dl_se->dl_boosted || !start_dl_timer(curr)))
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1289  			enqueue_task_dl(rq, curr, ENQUEUE_REPLENISH);
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1290  
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1291  		if (!is_leftmost(curr, &rq->dl))
8875125efe8402 Kirill Tkhai    2014-06-29  1292  			resched_curr(rq);
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1293  	}
1724813d9f2c7f Peter Zijlstra  2013-12-17  1294  
1724813d9f2c7f Peter Zijlstra  2013-12-17  1295  	/*
1724813d9f2c7f Peter Zijlstra  2013-12-17  1296  	 * Because -- for now -- we share the rt bandwidth, we need to
1724813d9f2c7f Peter Zijlstra  2013-12-17  1297  	 * account our runtime there too, otherwise actual rt tasks
1724813d9f2c7f Peter Zijlstra  2013-12-17  1298  	 * would be able to exceed the shared quota.
1724813d9f2c7f Peter Zijlstra  2013-12-17  1299  	 *
1724813d9f2c7f Peter Zijlstra  2013-12-17  1300  	 * Account to the root rt group for now.
1724813d9f2c7f Peter Zijlstra  2013-12-17  1301  	 *
1724813d9f2c7f Peter Zijlstra  2013-12-17  1302  	 * The solution we're working towards is having the RT groups scheduled
1724813d9f2c7f Peter Zijlstra  2013-12-17  1303  	 * using deadline servers -- however there's a few nasties to figure
1724813d9f2c7f Peter Zijlstra  2013-12-17  1304  	 * out before that can happen.
1724813d9f2c7f Peter Zijlstra  2013-12-17  1305  	 */
1724813d9f2c7f Peter Zijlstra  2013-12-17  1306  	if (rt_bandwidth_enabled()) {
1724813d9f2c7f Peter Zijlstra  2013-12-17  1307  		struct rt_rq *rt_rq = &rq->rt;
1724813d9f2c7f Peter Zijlstra  2013-12-17  1308  
1724813d9f2c7f Peter Zijlstra  2013-12-17  1309  		raw_spin_lock(&rt_rq->rt_runtime_lock);
1724813d9f2c7f Peter Zijlstra  2013-12-17  1310  		/*
1724813d9f2c7f Peter Zijlstra  2013-12-17  1311  		 * We'll let actual RT tasks worry about the overflow here, we
faa5993736d9b4 Juri Lelli      2014-02-21  1312  		 * have our own CBS to keep us inline; only account when RT
faa5993736d9b4 Juri Lelli      2014-02-21  1313  		 * bandwidth is relevant.
1724813d9f2c7f Peter Zijlstra  2013-12-17  1314  		 */
faa5993736d9b4 Juri Lelli      2014-02-21 @1315  		if (sched_rt_bandwidth_account(rt_rq))
faa5993736d9b4 Juri Lelli      2014-02-21  1316  			rt_rq->rt_time += delta_exec;
1724813d9f2c7f Peter Zijlstra  2013-12-17  1317  		raw_spin_unlock(&rt_rq->rt_runtime_lock);
1724813d9f2c7f Peter Zijlstra  2013-12-17  1318  	}
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1319  }
aab03e05e8f7e2 Dario Faggioli  2013-11-28  1320  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 7515 bytes --]

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

* Re: [PATCH] sched: Declare sched_rt_bandwidth_account() in include file
  2020-06-26 19:16 ` kernel test robot
@ 2020-06-26 22:41   ` Guenter Roeck
  0 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2020-06-26 22:41 UTC (permalink / raw)
  To: kernel test robot
  Cc: Ingo Molnar, kbuild-all, clang-built-linux, Peter Zijlstra,
	Juri Lelli, Vincent Guittot, linux-kernel

On Sat, Jun 27, 2020 at 03:16:15AM +0800, kernel test robot wrote:
> Hi Guenter,
> 
> I love your patch! Yet something to improve:
> 
> [auto build test ERROR on tip/sched/core]
> [also build test ERROR on tip/auto-latest linux/master linus/master v5.8-rc2 next-20200626]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use  as documented in
> https://git-scm.com/docs/git-format-patch]
> 
> url:    https://github.com/0day-ci/linux/commits/Guenter-Roeck/sched-Declare-sched_rt_bandwidth_account-in-include-file/20200626-220544
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 01e377c539ca52a6c753d0fdbe93b3b8fcd66a1c
> config: x86_64-allnoconfig (attached as .config)
> compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 6e11ed52057ffc39941cb2de6d93cae522db4782)
> reproduce (this is a W=1 build):
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # install x86_64 cross compiling tool for clang build
>         # apt-get install binutils-x86-64-linux-gnu
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
> >> kernel/sched/deadline.c:1315:7: error: implicit declaration of function 'sched_rt_bandwidth_account' [-Werror,-Wimplicit-function-declaration]
>                    if (sched_rt_bandwidth_account(rt_rq))
>                        ^

Guess I missed some condition. I'll try again.

Guenter

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

end of thread, other threads:[~2020-06-26 22:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-26 14:02 [PATCH] sched: Declare sched_rt_bandwidth_account() in include file Guenter Roeck
2020-06-26 15:03 ` kernel test robot
2020-06-26 19:16 ` kernel test robot
2020-06-26 22:41   ` Guenter Roeck

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