Re: [RESEND PATCH 1/2] delayacct: refactor the code to simplify the implementation

From: kernel test robot
Date: Tue Apr 13 2021 - 19:19:51 EST


Hi brookxu,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.12-rc7 next-20210413]
[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/0day-ci/linux/commits/brookxu/delayacct-refactor-the-code-to-simplify-the-implementation/20210413-093934
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 89698becf06d341a700913c3d89ce2a914af69a2
config: microblaze-randconfig-r026-20210413 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0
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
# https://github.com/0day-ci/linux/commit/37860ad48e2e1c1b332172849833ebb49802d0a8
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review brookxu/delayacct-refactor-the-code-to-simplify-the-implementation/20210413-093934
git checkout 37860ad48e2e1c1b332172849833ebb49802d0a8
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=microblaze

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

All errors (new ones prefixed by >>):

kernel/cgroup/cgroup-v1.c: In function 'cgroupstats_build':
>> kernel/cgroup/cgroup-v1.c:730:8: error: implicit declaration of function 'delayacct_is_task_waiting_on_io' [-Werror=implicit-function-declaration]
730 | if (delayacct_is_task_waiting_on_io(tsk))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors


vim +/delayacct_is_task_waiting_on_io +730 kernel/cgroup/cgroup-v1.c

0a268dbd7932c7 Tejun Heo 2016-12-27 676
0a268dbd7932c7 Tejun Heo 2016-12-27 677 /**
0a268dbd7932c7 Tejun Heo 2016-12-27 678 * cgroupstats_build - build and fill cgroupstats
0a268dbd7932c7 Tejun Heo 2016-12-27 679 * @stats: cgroupstats to fill information into
0a268dbd7932c7 Tejun Heo 2016-12-27 680 * @dentry: A dentry entry belonging to the cgroup for which stats have
0a268dbd7932c7 Tejun Heo 2016-12-27 681 * been requested.
0a268dbd7932c7 Tejun Heo 2016-12-27 682 *
0a268dbd7932c7 Tejun Heo 2016-12-27 683 * Build and fill cgroupstats so that taskstats can export it to user
0a268dbd7932c7 Tejun Heo 2016-12-27 684 * space.
0a268dbd7932c7 Tejun Heo 2016-12-27 685 */
0a268dbd7932c7 Tejun Heo 2016-12-27 686 int cgroupstats_build(struct cgroupstats *stats, struct dentry *dentry)
0a268dbd7932c7 Tejun Heo 2016-12-27 687 {
0a268dbd7932c7 Tejun Heo 2016-12-27 688 struct kernfs_node *kn = kernfs_node_from_dentry(dentry);
0a268dbd7932c7 Tejun Heo 2016-12-27 689 struct cgroup *cgrp;
0a268dbd7932c7 Tejun Heo 2016-12-27 690 struct css_task_iter it;
0a268dbd7932c7 Tejun Heo 2016-12-27 691 struct task_struct *tsk;
0a268dbd7932c7 Tejun Heo 2016-12-27 692
0a268dbd7932c7 Tejun Heo 2016-12-27 693 /* it should be kernfs_node belonging to cgroupfs and is a directory */
0a268dbd7932c7 Tejun Heo 2016-12-27 694 if (dentry->d_sb->s_type != &cgroup_fs_type || !kn ||
0a268dbd7932c7 Tejun Heo 2016-12-27 695 kernfs_type(kn) != KERNFS_DIR)
0a268dbd7932c7 Tejun Heo 2016-12-27 696 return -EINVAL;
0a268dbd7932c7 Tejun Heo 2016-12-27 697
0a268dbd7932c7 Tejun Heo 2016-12-27 698 mutex_lock(&cgroup_mutex);
0a268dbd7932c7 Tejun Heo 2016-12-27 699
0a268dbd7932c7 Tejun Heo 2016-12-27 700 /*
0a268dbd7932c7 Tejun Heo 2016-12-27 701 * We aren't being called from kernfs and there's no guarantee on
0a268dbd7932c7 Tejun Heo 2016-12-27 702 * @kn->priv's validity. For this and css_tryget_online_from_dir(),
0a268dbd7932c7 Tejun Heo 2016-12-27 703 * @kn->priv is RCU safe. Let's do the RCU dancing.
0a268dbd7932c7 Tejun Heo 2016-12-27 704 */
0a268dbd7932c7 Tejun Heo 2016-12-27 705 rcu_read_lock();
e0aed7c74f0bf6 Tejun Heo 2016-12-27 706 cgrp = rcu_dereference(*(void __rcu __force **)&kn->priv);
0a268dbd7932c7 Tejun Heo 2016-12-27 707 if (!cgrp || cgroup_is_dead(cgrp)) {
0a268dbd7932c7 Tejun Heo 2016-12-27 708 rcu_read_unlock();
0a268dbd7932c7 Tejun Heo 2016-12-27 709 mutex_unlock(&cgroup_mutex);
0a268dbd7932c7 Tejun Heo 2016-12-27 710 return -ENOENT;
0a268dbd7932c7 Tejun Heo 2016-12-27 711 }
0a268dbd7932c7 Tejun Heo 2016-12-27 712 rcu_read_unlock();
0a268dbd7932c7 Tejun Heo 2016-12-27 713
bc2fb7ed089ffd Tejun Heo 2017-05-15 714 css_task_iter_start(&cgrp->self, 0, &it);
0a268dbd7932c7 Tejun Heo 2016-12-27 715 while ((tsk = css_task_iter_next(&it))) {
0a268dbd7932c7 Tejun Heo 2016-12-27 716 switch (tsk->state) {
0a268dbd7932c7 Tejun Heo 2016-12-27 717 case TASK_RUNNING:
0a268dbd7932c7 Tejun Heo 2016-12-27 718 stats->nr_running++;
0a268dbd7932c7 Tejun Heo 2016-12-27 719 break;
0a268dbd7932c7 Tejun Heo 2016-12-27 720 case TASK_INTERRUPTIBLE:
0a268dbd7932c7 Tejun Heo 2016-12-27 721 stats->nr_sleeping++;
0a268dbd7932c7 Tejun Heo 2016-12-27 722 break;
0a268dbd7932c7 Tejun Heo 2016-12-27 723 case TASK_UNINTERRUPTIBLE:
0a268dbd7932c7 Tejun Heo 2016-12-27 724 stats->nr_uninterruptible++;
0a268dbd7932c7 Tejun Heo 2016-12-27 725 break;
0a268dbd7932c7 Tejun Heo 2016-12-27 726 case TASK_STOPPED:
0a268dbd7932c7 Tejun Heo 2016-12-27 727 stats->nr_stopped++;
0a268dbd7932c7 Tejun Heo 2016-12-27 728 break;
0a268dbd7932c7 Tejun Heo 2016-12-27 729 default:
0a268dbd7932c7 Tejun Heo 2016-12-27 @730 if (delayacct_is_task_waiting_on_io(tsk))
0a268dbd7932c7 Tejun Heo 2016-12-27 731 stats->nr_io_wait++;
0a268dbd7932c7 Tejun Heo 2016-12-27 732 break;
0a268dbd7932c7 Tejun Heo 2016-12-27 733 }
0a268dbd7932c7 Tejun Heo 2016-12-27 734 }
0a268dbd7932c7 Tejun Heo 2016-12-27 735 css_task_iter_end(&it);
0a268dbd7932c7 Tejun Heo 2016-12-27 736
0a268dbd7932c7 Tejun Heo 2016-12-27 737 mutex_unlock(&cgroup_mutex);
0a268dbd7932c7 Tejun Heo 2016-12-27 738 return 0;
0a268dbd7932c7 Tejun Heo 2016-12-27 739 }
0a268dbd7932c7 Tejun Heo 2016-12-27 740

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

Attachment: .config.gz
Description: application/gzip