public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: zhangq95 <qiangzh.hust@gmail.com>
Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org, tj@kernel.org,
	lizefan@huawei.com, hannes@cmpxchg.org, mingo@redhat.com,
	peterz@infradead.org, cgroups@vger.kernel.org, riel@redhat.com,
	gs051095@gmail.com, akpm@linux-foundation.org, oleg@redhat.com,
	tglx@linutronix.de, keescook@chromium.org,
	gregkh@linuxfoundation.org, longman@redhat.com,
	prsood@codeaurora.org, guro@fb.com, davem@davemloft.net,
	mhocko@suse.com, kirill.shutemov@linux.intel.com,
	marcos.souza.org@gmail.com, hoeun.ryu@gmail.com,
	rostedt@goodmis.org, bigeasy@linutronix.de,
	alexander.levin@verizon.com, paulmck@linux.vnet.ibm.com,
	fweisbec@gmail.com, zhangq95 <qiangzh.hust@gmail.com>
Subject: Re: [PATCH] Add a file named cgroup.procs_stat in cgroup
Date: Sat, 5 May 2018 15:15:07 +0800	[thread overview]
Message-ID: <201805051345.lbfSFpSU%fengguang.wu@intel.com> (raw)
In-Reply-To: <1525444100-4858-1-git-send-email-qiangzh.hust@gmail.com>

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

Hi zhangq95,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v4.17-rc3]
[cannot apply to cgroup/for-next]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/zhangq95/Add-a-file-named-cgroup-procs_stat-in-cgroup/20180505-115518
config: i386-randconfig-x076-201817 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   kernel/cgroup/cgroup-v1.c: In function 'cgroup_procs_stat_show':
   kernel/cgroup/cgroup-v1.c:634:11: warning: return makes integer from pointer without a cast [-Wint-conversion]
       return ERR_PTR(ret);
              ^~~~~~~~~~~~
>> kernel/cgroup/cgroup-v1.c:645:21: error: 'cpuset_cgrp_id' undeclared (first use in this function); did you mean 'cpu_cgrp_id'?
      if (task_css(tsk, cpuset_cgrp_id)) {
                        ^~~~~~~~~~~~~~
                        cpu_cgrp_id
   kernel/cgroup/cgroup-v1.c:645:21: note: each undeclared identifier is reported only once for each function it appears in
   kernel/cgroup/cgroup-v1.c:647:4: error: implicit declaration of function 'get_tsk_cpu_allowed'; did you mean 'do_set_cpus_allowed'? [-Werror=implicit-function-declaration]
       get_tsk_cpu_allowed(tsk, &cpus_allowed);
       ^~~~~~~~~~~~~~~~~~~
       do_set_cpus_allowed
   kernel/cgroup/cgroup-v1.c:655:5: error: 'CPUACCT_PROCS_SWITCHES' undeclared (first use in this function)
        CPUACCT_PROCS_SWITCHES, 0);
        ^~~~~~~~~~~~~~~~~~~~~~
   kernel/cgroup/cgroup-v1.c:657:5: error: 'CPUACCT_PROCS_FORKS' undeclared (first use in this function); did you mean 'CPUACCT_PROCS_SWITCHES'?
        CPUACCT_PROCS_FORKS, 0);
        ^~~~~~~~~~~~~~~~~~~
        CPUACCT_PROCS_SWITCHES
   kernel/cgroup/cgroup-v1.c:659:5: error: 'CPUACCT_PROCS_RUNNING' undeclared (first use in this function); did you mean 'CPUACCT_PROCS_FORKS'?
        CPUACCT_PROCS_RUNNING, 0);
        ^~~~~~~~~~~~~~~~~~~~~
        CPUACCT_PROCS_FORKS
   kernel/cgroup/cgroup-v1.c:661:5: error: 'CPUACCT_PROCS_IOWAIT' undeclared (first use in this function); did you mean 'CPUACCT_PROCS_FORKS'?
        CPUACCT_PROCS_IOWAIT, 0);
        ^~~~~~~~~~~~~~~~~~~~
        CPUACCT_PROCS_FORKS
   cc1: some warnings being treated as errors

vim +645 kernel/cgroup/cgroup-v1.c

   609	
   610	static int cgroup_procs_stat_show(struct seq_file *s, void *v)
   611	{
   612		struct kernfs_open_file *of = s->private;
   613		struct cgroup *cgrp = seq_css(s)->cgroup;
   614		struct cgroup_pidlist *l;
   615		enum cgroup_filetype type = seq_cft(s)->private;
   616		struct task_struct *tsk;
   617		int ret, i = 0, j = 0, tmp = 0;
   618		unsigned long forks = 0, iowait = 0, nr_runnable = 0;
   619		pid_t *start;
   620		struct timespec64 boottime;
   621		unsigned long long start_time, switches = 0;
   622		unsigned long per_softirq_nums[NR_SOFTIRQS] = {0};
   623		unsigned long sum_softirq = 0;
   624		struct cpumask cpus_allowed;
   625	
   626		mutex_lock(&cgrp->pidlist_mutex);
   627		if (of->priv)
   628			of->priv = cgroup_pidlist_find(cgrp, type);
   629	
   630		if (!of->priv) {
   631			ret = pidlist_array_load(cgrp, type,
   632						 (struct cgroup_pidlist **)&of->priv);
   633			if (ret)
 > 634				return ERR_PTR(ret);
   635		}
   636		l = of->priv;
   637	
   638		start = l->list;
   639	
   640		tsk = find_task_by_pid_ns(*start, &init_pid_ns);
   641		getboottime64(&boottime);
   642	
   643		if (in_noninit_pid_ns(tsk) &&
   644			task_in_nonroot_cpuacct(tsk)) {
 > 645			if (task_css(tsk, cpuset_cgrp_id)) {
   646				memset(&cpus_allowed, 0, sizeof(cpus_allowed));
   647				get_tsk_cpu_allowed(tsk, &cpus_allowed);
   648			}
   649	
   650			start_time = tsk->real_start_time / NSEC_PER_SEC;
   651			start_time += (unsigned long long)boottime.tv_sec;
   652	
   653			for_each_cpu_and(i, cpu_possible_mask, &cpus_allowed) {
   654				switches += task_ca_procs_stat(tsk, i,
   655					CPUACCT_PROCS_SWITCHES, 0);
   656				forks += task_ca_procs_stat(tsk, i,
   657					CPUACCT_PROCS_FORKS, 0);
   658				nr_runnable += task_ca_procs_stat(tsk, i,
   659					CPUACCT_PROCS_RUNNING, 0);
   660				iowait += task_ca_procs_stat(tsk, i,
   661					CPUACCT_PROCS_IOWAIT, 0);
   662	
   663				for (j = 0; j < NR_SOFTIRQS; j++) {
   664					tmp = task_ca_procs_stat(tsk, i, j, 1);
   665					per_softirq_nums[j] += tmp;
   666					sum_softirq += tmp;
   667				}
   668			}
   669	
   670		} else {
   671			cpumask_copy(&cpus_allowed, cpu_possible_mask);
   672			nr_runnable = nr_running();
   673			forks = total_forks;
   674			iowait = nr_iowait();
   675			switches = nr_context_switches();
   676			start_time = (unsigned long long)boottime.tv_sec;
   677	
   678			for (j = 0; j < NR_SOFTIRQS; j++) {
   679				unsigned long softirq_stat = kstat_softirqs_cpu(j, i);
   680	
   681				per_softirq_nums[j] += softirq_stat;
   682				sum_softirq += softirq_stat;
   683			}
   684		}
   685	
   686		seq_printf(s, "softirq %lu ", sum_softirq);
   687		for (j = 0; j < NR_SOFTIRQS; j++)
   688			seq_printf(s, "%lu ", per_softirq_nums[j]);
   689	
   690		seq_puts(s, "\n");
   691		seq_printf(s,
   692			"ctxt %llu\n"
   693			"btime %llu\n"
   694			"processes %lu\n"
   695			"procs_running %lu\n"
   696			"procs_blocked %lu\n",
   697			switches,
   698			start_time,
   699			forks,
   700			nr_runnable,
   701			iowait);
   702	
   703		mod_delayed_work(cgroup_pidlist_destroy_wq, &l->destroy_dwork,
   704			CGROUP_PIDLIST_DESTROY_DELAY);
   705		mutex_unlock(&cgrp->pidlist_mutex);
   706	
   707		return 0;
   708	}
   709	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

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

  parent reply	other threads:[~2018-05-05  7:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-04 14:28 [PATCH] Add a file named cgroup.procs_stat in cgroup zhangq95
2018-05-04 15:43 ` Peter Zijlstra
2018-05-04 17:31 ` Greg KH
2018-05-05  7:15 ` kbuild test robot [this message]
2018-05-05  7:15 ` kbuild test robot
2018-05-05  7:34 ` kbuild test robot

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=201805051345.lbfSFpSU%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.levin@verizon.com \
    --cc=bigeasy@linutronix.de \
    --cc=cgroups@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=fweisbec@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gs051095@gmail.com \
    --cc=guro@fb.com \
    --cc=hannes@cmpxchg.org \
    --cc=hoeun.ryu@gmail.com \
    --cc=kbuild-all@01.org \
    --cc=keescook@chromium.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=longman@redhat.com \
    --cc=marcos.souza.org@gmail.com \
    --cc=mhocko@suse.com \
    --cc=mingo@redhat.com \
    --cc=oleg@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=prsood@codeaurora.org \
    --cc=qiangzh.hust@gmail.com \
    --cc=riel@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox