mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: subhra mazumdar <subhra.mazumdar@oracle.com>
Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org,
	peterz@infradead.org, mingo@redhat.com,
	steven.sistare@oracle.com, dhaval.giani@oracle.com,
	rohit.k.jain@oracle.com, daniel.lezcano@linaro.org
Subject: Re: [PATCH 1/5] sched: limit cpu search in select_idle_cpu
Date: Wed, 13 Jun 2018 04:33:43 +0800	[thread overview]
Message-ID: <201806130240.AQdYDV0h%fengguang.wu@intel.com> (raw)
In-Reply-To: <20180612175002.31453-2-subhra.mazumdar@oracle.com>

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

Hi subhra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on tip/sched/core]
[also build test WARNING on v4.17 next-20180612]
[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/subhra-mazumdar/Improve-scheduler-scalability-for-fast-path/20180613-015158
config: i386-randconfig-x070-201823 (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 warnings (new ones prefixed by >>):

   kernel/sched/fair.c: In function 'select_idle_cpu':
>> kernel/sched/fair.c:6396:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
      u64 span_avg = sd->span_weight * avg_idle;
      ^~~

vim +6396 kernel/sched/fair.c

10e2f1acd Peter Zijlstra  2016-05-09  6363  
10e2f1acd Peter Zijlstra  2016-05-09  6364  /*
10e2f1acd Peter Zijlstra  2016-05-09  6365   * Scan the LLC domain for idle CPUs; this is dynamically regulated by
10e2f1acd Peter Zijlstra  2016-05-09  6366   * comparing the average scan cost (tracked in sd->avg_scan_cost) against the
10e2f1acd Peter Zijlstra  2016-05-09  6367   * average idle time for this rq (as found in rq->avg_idle).
10e2f1acd Peter Zijlstra  2016-05-09  6368   */
10e2f1acd Peter Zijlstra  2016-05-09  6369  static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int target)
10e2f1acd Peter Zijlstra  2016-05-09  6370  {
9cfb38a7b Wanpeng Li      2016-10-09  6371  	struct sched_domain *this_sd;
1ad3aaf3f Peter Zijlstra  2017-05-17  6372  	u64 avg_cost, avg_idle;
10e2f1acd Peter Zijlstra  2016-05-09  6373  	u64 time, cost;
10e2f1acd Peter Zijlstra  2016-05-09  6374  	s64 delta;
8dd662615 subhra mazumdar 2018-06-12  6375  	int cpu, limit, floor, nr = INT_MAX;
10e2f1acd Peter Zijlstra  2016-05-09  6376  
9cfb38a7b Wanpeng Li      2016-10-09  6377  	this_sd = rcu_dereference(*this_cpu_ptr(&sd_llc));
9cfb38a7b Wanpeng Li      2016-10-09  6378  	if (!this_sd)
9cfb38a7b Wanpeng Li      2016-10-09  6379  		return -1;
9cfb38a7b Wanpeng Li      2016-10-09  6380  
10e2f1acd Peter Zijlstra  2016-05-09  6381  	/*
10e2f1acd Peter Zijlstra  2016-05-09  6382  	 * Due to large variance we need a large fuzz factor; hackbench in
10e2f1acd Peter Zijlstra  2016-05-09  6383  	 * particularly is sensitive here.
10e2f1acd Peter Zijlstra  2016-05-09  6384  	 */
1ad3aaf3f Peter Zijlstra  2017-05-17  6385  	avg_idle = this_rq()->avg_idle / 512;
1ad3aaf3f Peter Zijlstra  2017-05-17  6386  	avg_cost = this_sd->avg_scan_cost + 1;
1ad3aaf3f Peter Zijlstra  2017-05-17  6387  
1ad3aaf3f Peter Zijlstra  2017-05-17  6388  	if (sched_feat(SIS_AVG_CPU) && avg_idle < avg_cost)
10e2f1acd Peter Zijlstra  2016-05-09  6389  		return -1;
10e2f1acd Peter Zijlstra  2016-05-09  6390  
1ad3aaf3f Peter Zijlstra  2017-05-17  6391  	if (sched_feat(SIS_PROP)) {
8dd662615 subhra mazumdar 2018-06-12  6392  		floor = cpumask_weight(topology_sibling_cpumask(target));
8dd662615 subhra mazumdar 2018-06-12  6393  		if (floor < 2)
8dd662615 subhra mazumdar 2018-06-12  6394  			floor = 2;
8dd662615 subhra mazumdar 2018-06-12  6395  		limit = 2*floor;
1ad3aaf3f Peter Zijlstra  2017-05-17 @6396  		u64 span_avg = sd->span_weight * avg_idle;
8dd662615 subhra mazumdar 2018-06-12  6397  		if (span_avg > floor*avg_cost) {
1ad3aaf3f Peter Zijlstra  2017-05-17  6398  			nr = div_u64(span_avg, avg_cost);
8dd662615 subhra mazumdar 2018-06-12  6399  			if (nr > limit)
8dd662615 subhra mazumdar 2018-06-12  6400  				nr = limit;
8dd662615 subhra mazumdar 2018-06-12  6401  		} else {
8dd662615 subhra mazumdar 2018-06-12  6402  			nr = floor;
8dd662615 subhra mazumdar 2018-06-12  6403  		}
1ad3aaf3f Peter Zijlstra  2017-05-17  6404  	}
1ad3aaf3f Peter Zijlstra  2017-05-17  6405  
10e2f1acd Peter Zijlstra  2016-05-09  6406  	time = local_clock();
10e2f1acd Peter Zijlstra  2016-05-09  6407  
c743f0a5c Peter Zijlstra  2017-04-14  6408  	for_each_cpu_wrap(cpu, sched_domain_span(sd), target) {
1ad3aaf3f Peter Zijlstra  2017-05-17  6409  		if (!--nr)
1ad3aaf3f Peter Zijlstra  2017-05-17  6410  			return -1;
0c98d344f Ingo Molnar     2017-02-05  6411  		if (!cpumask_test_cpu(cpu, &p->cpus_allowed))
10e2f1acd Peter Zijlstra  2016-05-09  6412  			continue;
943d355d7 Rohit Jain      2018-05-09  6413  		if (available_idle_cpu(cpu))
10e2f1acd Peter Zijlstra  2016-05-09  6414  			break;
10e2f1acd Peter Zijlstra  2016-05-09  6415  	}
10e2f1acd Peter Zijlstra  2016-05-09  6416  
10e2f1acd Peter Zijlstra  2016-05-09  6417  	time = local_clock() - time;
10e2f1acd Peter Zijlstra  2016-05-09  6418  	cost = this_sd->avg_scan_cost;
10e2f1acd Peter Zijlstra  2016-05-09  6419  	delta = (s64)(time - cost) / 8;
10e2f1acd Peter Zijlstra  2016-05-09  6420  	this_sd->avg_scan_cost += delta;
10e2f1acd Peter Zijlstra  2016-05-09  6421  
10e2f1acd Peter Zijlstra  2016-05-09  6422  	return cpu;
10e2f1acd Peter Zijlstra  2016-05-09  6423  }
10e2f1acd Peter Zijlstra  2016-05-09  6424  

:::::: The code at line 6396 was first introduced by commit
:::::: 1ad3aaf3fcd2444406628a19a9b9e0922b95e2d4 sched/core: Implement new approach to scale select_idle_cpu()

:::::: TO: Peter Zijlstra <peterz@infradead.org>
:::::: CC: Ingo Molnar <mingo@kernel.org>

---
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: 28330 bytes --]

  reply	other threads:[~2018-06-12 20:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-12 17:49 [RFC/RFT V2 PATCH 0/5] Improve scheduler scalability for fast path subhra mazumdar
2018-06-12 17:49 ` [PATCH 1/5] sched: limit cpu search in select_idle_cpu subhra mazumdar
2018-06-12 20:33   ` kbuild test robot [this message]
2018-06-12 22:12     ` Subhra Mazumdar
2018-06-20  7:32   ` [lkp-robot] [sched] 8dd662615c: reaim.jobs_per_min -3.3% regression kernel test robot
2018-06-12 17:49 ` [PATCH 2/5] sched: introduce per-cpu var next_cpu to track search limit subhra mazumdar
2018-06-12 17:50 ` [PATCH 3/5] sched: rotate the cpu search window for better spread subhra mazumdar
2018-06-12 17:50 ` [PATCH 4/5] sched: add sched feature to disable idle core search subhra mazumdar
2018-06-12 17:50 ` [PATCH 5/5] sched: SIS_CORE " subhra mazumdar
2018-06-28 22:44 [RESEND RFC/RFT V2 PATCH 0/5] Improve scheduler scalability for fast path subhra mazumdar
2018-06-28 22:44 ` [PATCH 1/5] sched: limit cpu search in select_idle_cpu subhra mazumdar

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=201806130240.AQdYDV0h%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=dhaval.giani@oracle.com \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rohit.k.jain@oracle.com \
    --cc=steven.sistare@oracle.com \
    --cc=subhra.mazumdar@oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®