All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Valentin Schneider <vschneid@redhat.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: Re: [RFC PATCH v2 5/5] sched/fair: Assert user/kernel/total nr invariants
Date: Sun, 4 Feb 2024 08:04:37 +0800	[thread overview]
Message-ID: <202402040702.ytDsOZ2e-lkp@intel.com> (raw)
In-Reply-To: <20240202080920.3337862-6-vschneid@redhat.com>

Hi Valentin,

[This is a private test report for your RFC patch.]
kernel test robot noticed the following build errors:

[auto build test ERROR on tip/sched/core]
[also build test ERROR on tip/core/entry tip/master linus/master v6.8-rc2 next-20240202]
[cannot apply to tip/auto-latest]
[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/Valentin-Schneider/sched-fair-Only-throttle-CFS-tasks-on-return-to-userspace/20240202-162620
base:   tip/sched/core
patch link:    https://lore.kernel.org/r/20240202080920.3337862-6-vschneid%40redhat.com
patch subject: [RFC PATCH v2 5/5] sched/fair: Assert user/kernel/total nr invariants
config: arm-randconfig-002-20240203 (https://download.01.org/0day-ci/archive/20240204/202402040702.ytDsOZ2e-lkp@intel.com/config)
compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project.git 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240204/202402040702.ytDsOZ2e-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202402040702.ytDsOZ2e-lkp@intel.com/

All errors (new ones prefixed by >>):

   kernel/sched/fair.c:6969:53: error: no member named 'throttle_pending' in 'struct cfs_rq'
                   if (kernel_task || (!throttle_pending && !cfs_rq->throttle_pending))
                                                             ~~~~~~  ^
   kernel/sched/fair.c:6974:12: error: no member named 'h_user_running' in 'struct cfs_rq'; did you mean 'h_nr_running'?
                           cfs_rq->h_user_running++;
                                   ^~~~~~~~~~~~~~
                                   h_nr_running
   kernel/sched/sched.h:563:16: note: 'h_nr_running' declared here
           unsigned int            h_nr_running;      /* SCHED_{NORMAL,BATCH,IDLE} */
                                   ^
   kernel/sched/fair.c:6976:31: error: no member named 'throttle_pending' in 'struct cfs_rq'
                   throttle_pending |= cfs_rq->throttle_pending;
                                       ~~~~~~  ^
>> kernel/sched/fair.c:6982:3: error: call to undeclared function 'assert_cfs_rq_counts'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
                   assert_cfs_rq_counts(cfs_rq);
                   ^
   kernel/sched/fair.c:6998:3: error: call to undeclared function 'assert_cfs_rq_counts'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
                   assert_cfs_rq_counts(cfs_rq);
                   ^
   kernel/sched/fair.c:7000:53: error: no member named 'throttle_pending' in 'struct cfs_rq'
                   if (kernel_task || (!throttle_pending && !cfs_rq->throttle_pending))
                                                             ~~~~~~  ^
   kernel/sched/fair.c:7005:12: error: no member named 'h_user_running' in 'struct cfs_rq'; did you mean 'h_nr_running'?
                           cfs_rq->h_user_running++;
                                   ^~~~~~~~~~~~~~
                                   h_nr_running
   kernel/sched/sched.h:563:16: note: 'h_nr_running' declared here
           unsigned int            h_nr_running;      /* SCHED_{NORMAL,BATCH,IDLE} */
                                   ^
   kernel/sched/fair.c:7007:31: error: no member named 'throttle_pending' in 'struct cfs_rq'
                   throttle_pending |= cfs_rq->throttle_pending;
                                       ~~~~~~  ^
   kernel/sched/fair.c:7046:3: error: call to undeclared function 'unthrottle_on_enqueue'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
                   unthrottle_on_enqueue(p);
                   ^
   kernel/sched/fair.c:7063:40: error: no member named 'kernel_node' in 'struct sched_entity'
           bool kernel_task = !list_empty(&p->se.kernel_node);
                                           ~~~~~ ^
   kernel/sched/fair.c:7073:53: error: no member named 'throttle_pending' in 'struct cfs_rq'
                   if (kernel_task || (!throttle_pending && !cfs_rq->throttle_pending))
                                                             ~~~~~~  ^
   kernel/sched/fair.c:7078:12: error: no member named 'h_user_running' in 'struct cfs_rq'; did you mean 'h_nr_running'?
                           cfs_rq->h_user_running--;
                                   ^~~~~~~~~~~~~~
                                   h_nr_running
   kernel/sched/sched.h:563:16: note: 'h_nr_running' declared here
           unsigned int            h_nr_running;      /* SCHED_{NORMAL,BATCH,IDLE} */
                                   ^
   kernel/sched/fair.c:7080:31: error: no member named 'throttle_pending' in 'struct cfs_rq'
                   throttle_pending |= cfs_rq->throttle_pending;
                                       ~~~~~~  ^
   kernel/sched/fair.c:7086:3: error: call to undeclared function 'assert_cfs_rq_counts'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
                   assert_cfs_rq_counts(cfs_rq);
                   ^
   kernel/sched/fair.c:7115:53: error: no member named 'throttle_pending' in 'struct cfs_rq'
                   if (kernel_task || (!throttle_pending && !cfs_rq->throttle_pending))
                                                             ~~~~~~  ^
   kernel/sched/fair.c:7120:12: error: no member named 'h_user_running' in 'struct cfs_rq'; did you mean 'h_nr_running'?
                           cfs_rq->h_user_running--;
                                   ^~~~~~~~~~~~~~
                                   h_nr_running
   kernel/sched/sched.h:563:16: note: 'h_nr_running' declared here
           unsigned int            h_nr_running;      /* SCHED_{NORMAL,BATCH,IDLE} */
                                   ^
   kernel/sched/fair.c:7122:31: error: no member named 'throttle_pending' in 'struct cfs_rq'
                   throttle_pending |= cfs_rq->throttle_pending;
                                       ~~~~~~  ^
   kernel/sched/fair.c:7128:3: error: call to undeclared function 'assert_cfs_rq_counts'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
                   assert_cfs_rq_counts(cfs_rq);
                   ^
   kernel/sched/fair.c:13465:6: warning: no previous prototype for function 'free_fair_sched_group' [-Wmissing-prototypes]
   void free_fair_sched_group(struct task_group *tg) { }
        ^
   kernel/sched/fair.c:13465:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void free_fair_sched_group(struct task_group *tg) { }
   ^
   static 
   kernel/sched/fair.c:13467:5: warning: no previous prototype for function 'alloc_fair_sched_group' [-Wmissing-prototypes]
   int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
       ^
   kernel/sched/fair.c:13467:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
   ^
   static 
   kernel/sched/fair.c:13472:6: warning: no previous prototype for function 'online_fair_sched_group' [-Wmissing-prototypes]
   void online_fair_sched_group(struct task_group *tg) { }
        ^
   kernel/sched/fair.c:13472:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void online_fair_sched_group(struct task_group *tg) { }
   ^
   static 
   kernel/sched/fair.c:13474:6: warning: no previous prototype for function 'unregister_fair_sched_group' [-Wmissing-prototypes]
   void unregister_fair_sched_group(struct task_group *tg) { }
        ^
   kernel/sched/fair.c:13474:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void unregister_fair_sched_group(struct task_group *tg) { }
   ^
   static 
   4 warnings and 18 errors generated.


vim +/assert_cfs_rq_counts +6982 kernel/sched/fair.c

  6930	
  6931	/*
  6932	 * The enqueue_task method is called before nr_running is
  6933	 * increased. Here we update the fair scheduling stats and
  6934	 * then put the task into the rbtree:
  6935	 */
  6936	static void
  6937	enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags)
  6938	{
  6939		struct cfs_rq *cfs_rq;
  6940		struct sched_entity *se = &p->se;
  6941		int idle_h_nr_running = task_has_idle_policy(p);
  6942		int task_new = !(flags & ENQUEUE_WAKEUP);
  6943		bool kernel_task = is_kernel_task(p);
  6944		bool throttle_pending = false;
  6945	
  6946		/*
  6947		 * The code below (indirectly) updates schedutil which looks at
  6948		 * the cfs_rq utilization to select a frequency.
  6949		 * Let's add the task's estimated utilization to the cfs_rq's
  6950		 * estimated utilization, before we update schedutil.
  6951		 */
  6952		util_est_enqueue(&rq->cfs, p);
  6953	
  6954		/*
  6955		 * If in_iowait is set, the code below may not trigger any cpufreq
  6956		 * utilization updates, so do it here explicitly with the IOWAIT flag
  6957		 * passed.
  6958		 */
  6959		if (p->in_iowait)
  6960			cpufreq_update_util(rq, SCHED_CPUFREQ_IOWAIT);
  6961	
  6962		for_each_sched_entity(se) {
  6963			if (se->on_rq)
  6964				break;
  6965			cfs_rq = cfs_rq_of(se);
  6966			enqueue_entity(cfs_rq, se, flags);
  6967	
  6968	
  6969			if (kernel_task || (!throttle_pending && !cfs_rq->throttle_pending))
  6970				cfs_rq->h_nr_running++;
  6971			if (kernel_task)
  6972				enqueue_kernel(cfs_rq, se, 1);
  6973			else if (!throttle_pending)
  6974				cfs_rq->h_user_running++;
  6975	
  6976			throttle_pending |= cfs_rq->throttle_pending;
  6977	
  6978			cfs_rq->idle_h_nr_running += idle_h_nr_running;
  6979			if (cfs_rq_is_idle(cfs_rq))
  6980				idle_h_nr_running = 1;
  6981	
> 6982			assert_cfs_rq_counts(cfs_rq);
  6983	
  6984			/* end evaluation on encountering a throttled cfs_rq */
  6985			if (cfs_rq_throttled(cfs_rq))
  6986				goto enqueue_throttle;
  6987	
  6988			flags = ENQUEUE_WAKEUP;
  6989		}
  6990	
  6991		for_each_sched_entity(se) {
  6992			cfs_rq = cfs_rq_of(se);
  6993	
  6994			update_load_avg(cfs_rq, se, UPDATE_TG);
  6995			se_update_runnable(se);
  6996			update_cfs_group(se);
  6997	
  6998			assert_cfs_rq_counts(cfs_rq);
  6999	
  7000			if (kernel_task || (!throttle_pending && !cfs_rq->throttle_pending))
  7001				cfs_rq->h_nr_running++;
  7002			if (kernel_task)
  7003				enqueue_kernel(cfs_rq, se, 1);
  7004			else if (!throttle_pending)
  7005				cfs_rq->h_user_running++;
  7006	
  7007			throttle_pending |= cfs_rq->throttle_pending;
  7008	
  7009			cfs_rq->idle_h_nr_running += idle_h_nr_running;
  7010			if (cfs_rq_is_idle(cfs_rq))
  7011				idle_h_nr_running = 1;
  7012	
  7013			assert_cfs_rq_counts(cfs_rq);
  7014	
  7015			/* end evaluation on encountering a throttled cfs_rq */
  7016			if (cfs_rq_throttled(cfs_rq))
  7017				goto enqueue_throttle;
  7018		}
  7019	
  7020		/* At this point se is NULL and we are at root level*/
  7021		add_nr_running(rq, 1);
  7022	
  7023		/*
  7024		 * Since new tasks are assigned an initial util_avg equal to
  7025		 * half of the spare capacity of their CPU, tiny tasks have the
  7026		 * ability to cross the overutilized threshold, which will
  7027		 * result in the load balancer ruining all the task placement
  7028		 * done by EAS. As a way to mitigate that effect, do not account
  7029		 * for the first enqueue operation of new tasks during the
  7030		 * overutilized flag detection.
  7031		 *
  7032		 * A better way of solving this problem would be to wait for
  7033		 * the PELT signals of tasks to converge before taking them
  7034		 * into account, but that is not straightforward to implement,
  7035		 * and the following generally works well enough in practice.
  7036		 */
  7037		if (!task_new)
  7038			update_overutilized_status(rq);
  7039	
  7040	enqueue_throttle:
  7041		assert_list_leaf_cfs_rq(rq);
  7042	
  7043		hrtick_update(rq);
  7044	
  7045		if (kernel_task)
  7046			unthrottle_on_enqueue(p);
  7047	}
  7048	

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

  reply	other threads:[~2024-02-04  0:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-02  8:09 [RFC PATCH v2 0/5] sched/fair: Defer CFS throttle to user entry Valentin Schneider
2024-02-02  8:09 ` [RFC PATCH v2 1/5] sched/fair: Only throttle CFS tasks on return to userspace Valentin Schneider
2024-02-03 19:12   ` kernel test robot
2024-02-03 19:45   ` kernel test robot
2024-02-02  8:09 ` [RFC PATCH v2 2/5] sched: Note schedule() invocations at return-to-user with SM_USER Valentin Schneider
2024-02-02  8:09 ` [RFC PATCH v2 3/5] sched/fair: Delete cfs_rq_throttled_loose(), use cfs_rq->throttle_pending instead Valentin Schneider
2024-02-03 23:01   ` kernel test robot
2024-02-06 21:36   ` Benjamin Segall
2024-02-07 13:34     ` Valentin Schneider
2024-02-02  8:09 ` [RFC PATCH v2 4/5] sched/fair: Track count of tasks running in userspace Valentin Schneider
2024-02-04  3:08   ` kernel test robot
2024-02-02  8:09 ` [RFC PATCH v2 5/5] sched/fair: Assert user/kernel/total nr invariants Valentin Schneider
2024-02-04  0:04   ` kernel test robot [this message]
2024-02-06 21:55 ` [RFC PATCH v2 0/5] sched/fair: Defer CFS throttle to user entry Benjamin Segall
2024-02-07 13:34   ` Valentin Schneider

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202402040702.ytDsOZ2e-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=vschneid@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.