Content-Type: multipart/mixed; boundary="===============0978256988015436576==" MIME-Version: 1.0 From: Chengming Zhou To: kbuild-all@lists.01.org Subject: Re: [External] Re: [PATCH v2 2/2] sched/fair: optimize and simplify rq leaf_cfs_rq_list Date: Thu, 26 May 2022 18:25:03 +0800 Message-ID: <843a2292-b62d-a2cf-e87c-e01d920721ef@bytedance.com> In-Reply-To: <202205261617.YUT1ixQ8-lkp@intel.com> List-Id: --===============0978256988015436576== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 2022/5/26 16:53, kernel test robot wrote: > Hi Chengming, > = > Thank you for the patch! Yet something to improve: > = > [auto build test ERROR on tip/sched/core] > [also build test ERROR on tip/master linus/master v5.18 next-20220525] > [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] > = > url: https://github.com/intel-lab-lkp/linux/commits/Chengming-Zhou/sch= ed-fair-optimize-and-simplify-rq-leaf_cfs_rq_list/20220526-151850 > base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 991d8= d8142cad94f9c5c05db25e67fa83d6f772a > config: powerpc-allnoconfig (https://download.01.org/0day-ci/archive/2022= 0526/202205261617.YUT1ixQ8-lkp(a)intel.com/config) > compiler: powerpc-linux-gcc (GCC) 11.3.0 > reproduce (this is a W=3D1 build): > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbi= n/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # https://github.com/intel-lab-lkp/linux/commit/cb2b1810aeb3f8f29= 0a932f3e625ab9df1110054 > git remote add linux-review https://github.com/intel-lab-lkp/linux > git fetch --no-tags linux-review Chengming-Zhou/sched-fair-optimi= ze-and-simplify-rq-leaf_cfs_rq_list/20220526-151850 > git checkout cb2b1810aeb3f8f290a932f3e625ab9df1110054 > # save the config file > mkdir build_dir && cp config build_dir/.config > COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-11.3.0 make.cro= ss W=3D1 O=3Dbuild_dir ARCH=3Dpowerpc SHELL=3D/bin/bash kernel/sched/ > = > If you fix the issue, kindly add following tag where applicable > Reported-by: kernel test robot Thanks, will fix !CONFIG_FAIR_GROUP_SCHED build next version. > = > All errors (new ones prefixed by >>): > = > kernel/sched/fair.c:645:5: warning: no previous prototype for 'sched_u= pdate_scaling' [-Wmissing-prototypes] > 645 | int sched_update_scaling(void) > | ^~~~~~~~~~~~~~~~~~~~ > kernel/sched/fair.c: In function 'enqueue_entity': >>> kernel/sched/fair.c:4343:22: error: implicit declaration of function 't= hrottled_hierarchy' [-Werror=3Dimplicit-function-declaration] > 4343 | if (!throttled_hierarchy(cfs_rq)) > | ^~~~~~~~~~~~~~~~~~~ > kernel/sched/fair.c: At top level: >>> kernel/sched/fair.c:5484:19: error: static declaration of 'throttled_hi= erarchy' follows non-static declaration > 5484 | static inline int throttled_hierarchy(struct cfs_rq *cfs_rq) > | ^~~~~~~~~~~~~~~~~~~ > kernel/sched/fair.c:4343:22: note: previous implicit declaration of 't= hrottled_hierarchy' with type 'int()' > 4343 | if (!throttled_hierarchy(cfs_rq)) > | ^~~~~~~~~~~~~~~~~~~ > kernel/sched/fair.c:5495:6: warning: no previous prototype for 'init_c= fs_bandwidth' [-Wmissing-prototypes] > 5495 | void init_cfs_bandwidth(struct cfs_bandwidth *cfs_b) {} > | ^~~~~~~~~~~~~~~~~~ > kernel/sched/fair.c:11654:6: warning: no previous prototype for 'free_= fair_sched_group' [-Wmissing-prototypes] > 11654 | void free_fair_sched_group(struct task_group *tg) { } > | ^~~~~~~~~~~~~~~~~~~~~ > kernel/sched/fair.c:11656:5: warning: no previous prototype for 'alloc= _fair_sched_group' [-Wmissing-prototypes] > 11656 | int alloc_fair_sched_group(struct task_group *tg, struct task_= group *parent) > | ^~~~~~~~~~~~~~~~~~~~~~ > kernel/sched/fair.c:11661:6: warning: no previous prototype for 'onlin= e_fair_sched_group' [-Wmissing-prototypes] > 11661 | void online_fair_sched_group(struct task_group *tg) { } > | ^~~~~~~~~~~~~~~~~~~~~~~ > kernel/sched/fair.c:11663:6: warning: no previous prototype for 'unreg= ister_fair_sched_group' [-Wmissing-prototypes] > 11663 | void unregister_fair_sched_group(struct task_group *tg) { } > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > cc1: some warnings being treated as errors > = > = > vim +/throttled_hierarchy +4343 kernel/sched/fair.c > = > 4263 = > 4264 /* > 4265 * MIGRATION > 4266 * > 4267 * dequeue > 4268 * update_curr() > 4269 * update_min_vruntime() > 4270 * vruntime -=3D min_vruntime > 4271 * > 4272 * enqueue > 4273 * update_curr() > 4274 * update_min_vruntime() > 4275 * vruntime +=3D min_vruntime > 4276 * > 4277 * this way the vruntime transition between RQs is done when both > 4278 * min_vruntime are up-to-date. > 4279 * > 4280 * WAKEUP (remote) > 4281 * > 4282 * ->migrate_task_rq_fair() (p->state =3D=3D TASK_WAKING) > 4283 * vruntime -=3D min_vruntime > 4284 * > 4285 * enqueue > 4286 * update_curr() > 4287 * update_min_vruntime() > 4288 * vruntime +=3D min_vruntime > 4289 * > 4290 * this way we don't have the most up-to-date min_vruntime on the = originating > 4291 * CPU and an up-to-date min_vruntime on the destination CPU. > 4292 */ > 4293 = > 4294 static void > 4295 enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int= flags) > 4296 { > 4297 bool renorm =3D !(flags & ENQUEUE_WAKEUP) || (flags & ENQUEUE_MIG= RATED); > 4298 bool curr =3D cfs_rq->curr =3D=3D se; > 4299 = > 4300 /* > 4301 * If we're the current task, we must renormalise before calling > 4302 * update_curr(). > 4303 */ > 4304 if (renorm && curr) > 4305 se->vruntime +=3D cfs_rq->min_vruntime; > 4306 = > 4307 update_curr(cfs_rq); > 4308 = > 4309 /* > 4310 * Otherwise, renormalise after, such that we're placed at the cu= rrent > 4311 * moment in time, instead of some random moment in the past. Bei= ng > 4312 * placed in the past could significantly boost this task to the > 4313 * fairness detriment of existing tasks. > 4314 */ > 4315 if (renorm && !curr) > 4316 se->vruntime +=3D cfs_rq->min_vruntime; > 4317 = > 4318 /* > 4319 * When enqueuing a sched_entity, we must: > 4320 * - Update loads to have both entity and cfs_rq synced with no= w. > 4321 * - Add its load to cfs_rq->runnable_avg > 4322 * - For group_entity, update its weight to reflect the new sha= re of > 4323 * its group cfs_rq > 4324 * - Add its new weight to cfs_rq->load.weight > 4325 */ > 4326 update_load_avg(cfs_rq, se, UPDATE_TG | DO_ATTACH); > 4327 se_update_runnable(se); > 4328 update_cfs_group(se); > 4329 account_entity_enqueue(cfs_rq, se); > 4330 = > 4331 if (flags & ENQUEUE_WAKEUP) > 4332 place_entity(cfs_rq, se, 0); > 4333 = > 4334 check_schedstat_required(); > 4335 update_stats_enqueue_fair(cfs_rq, se, flags); > 4336 check_spread(cfs_rq, se); > 4337 if (!curr) > 4338 __enqueue_entity(cfs_rq, se); > 4339 se->on_rq =3D 1; > 4340 = > 4341 if (cfs_rq->nr_running =3D=3D 1) { > 4342 check_enqueue_throttle(cfs_rq); >> 4343 if (!throttled_hierarchy(cfs_rq)) > 4344 list_add_leaf_cfs_rq(cfs_rq); > 4345 } > 4346 } > 4347 = >=20 --===============0978256988015436576==--