Re: [PATCH v5 15/19] sched: Add proxy deactivate helper

From: kernel test robot
Date: Thu Aug 24 2023 - 07:36:01 EST


Hi John,

kernel test robot noticed the following build warnings:

[auto build test WARNING on tip/locking/core]
[also build test WARNING on linus/master tip/auto-latest v6.5-rc7]
[cannot apply to tip/sched/core tip/master next-20230824]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/John-Stultz/sched-Unify-runtime-accounting-across-classes/20230821-121604
base: tip/locking/core
patch link: https://lore.kernel.org/r/20230819060915.3001568-16-jstultz%40google.com
patch subject: [PATCH v5 15/19] sched: Add proxy deactivate helper
config: loongarch-allmodconfig (https://download.01.org/0day-ci/archive/20230824/202308241905.goxohVDL-lkp@xxxxxxxxx/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230824/202308241905.goxohVDL-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308241905.goxohVDL-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

kernel/sched/core.c:6565:6: warning: no previous prototype for 'try_to_deactivate_task' [-Wmissing-prototypes]
6565 | bool try_to_deactivate_task(struct rq *rq, struct task_struct *p,
| ^~~~~~~~~~~~~~~~~~~~~~
>> kernel/sched/core.c:6603:6: warning: no previous prototype for 'proxy_deactivate' [-Wmissing-prototypes]
6603 | bool proxy_deactivate(struct rq *rq, struct task_struct *next)
| ^~~~~~~~~~~~~~~~


vim +/proxy_deactivate +6603 kernel/sched/core.c

6564
> 6565 bool try_to_deactivate_task(struct rq *rq, struct task_struct *p,
6566 unsigned long state, bool deactivate_cond)
6567 {
6568 if (signal_pending_state(state, p)) {
6569 WRITE_ONCE(p->__state, TASK_RUNNING);
6570 } else if (deactivate_cond) {
6571 p->sched_contributes_to_load =
6572 (state & TASK_UNINTERRUPTIBLE) &&
6573 !(state & TASK_NOLOAD) &&
6574 !(state & TASK_FROZEN);
6575
6576 if (p->sched_contributes_to_load)
6577 rq->nr_uninterruptible++;
6578
6579 /*
6580 * __schedule() ttwu()
6581 * prev_state = prev->state; if (p->on_rq && ...)
6582 * if (prev_state) goto out;
6583 * p->on_rq = 0; smp_acquire__after_ctrl_dep();
6584 * p->state = TASK_WAKING
6585 *
6586 * Where __schedule() and ttwu() have matching control dependencies.
6587 *
6588 * After this, schedule() must not care about p->state any more.
6589 */
6590 deactivate_task(rq, p, DEQUEUE_SLEEP | DEQUEUE_NOCLOCK);
6591
6592 if (p->in_iowait) {
6593 atomic_inc(&rq->nr_iowait);
6594 delayacct_blkio_start();
6595 }
6596 return true;
6597 }
6598 return false;
6599 }
6600
6601 #ifdef CONFIG_PROXY_EXEC
6602
> 6603 bool proxy_deactivate(struct rq *rq, struct task_struct *next)
6604 {
6605 unsigned long state = READ_ONCE(next->__state);
6606
6607 /* Don't deactivate if the state has been changed to TASK_RUNNING */
6608 if (!state)
6609 return false;
6610 if (!try_to_deactivate_task(rq, next, state, true))
6611 return false;
6612 put_prev_task(rq, next);
6613 rq_set_selected(rq, rq->idle);
6614 resched_curr(rq);
6615 return true;
6616 }
6617

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki