From: kernel test robot <lkp@intel.com>
To: Chris Redpath <chris.redpath@arm.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
Guenter Roeck <groeck@chromium.org>
Subject: [jsarha:topic/cros-sof-v4.14-rebase 1457/9999] kernel/sched/fair.c:7171 find_energy_efficient_cpu() warn: inconsistent indenting
Date: Thu, 8 Sep 2022 21:23:55 +0800 [thread overview]
Message-ID: <202209082104.85MdOYy3-lkp@intel.com> (raw)
tree: https://github.com/jsarha/linux topic/cros-sof-v4.14-rebase
head: 18a233f3f676a98dde00947535d99ab1a54da340
commit: e56a97123c10e6d5ca2ce9a0f1329f02f79f2319 [1457/9999] ANDROID: Add find_best_target to minimise energy calculation overhead
config: i386-randconfig-m021 (https://download.01.org/0day-ci/archive/20220908/202209082104.85MdOYy3-lkp@intel.com/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
smatch warnings:
kernel/sched/fair.c:7171 find_energy_efficient_cpu() warn: inconsistent indenting
vim +7171 kernel/sched/fair.c
7092
7093 /*
7094 * Needs to be called inside rcu_read_lock critical section.
7095 * sd is a pointer to the sched domain we wish to use for an
7096 * energy-aware placement option.
7097 */
7098 static int find_energy_efficient_cpu(struct sched_domain *sd,
7099 struct task_struct *p,
7100 int cpu, int prev_cpu,
7101 int sync)
7102 {
7103 int use_fbt = sched_feat(FIND_BEST_TARGET);
7104 int cpu_iter, eas_cpu_idx = EAS_CPU_NXT;
7105 int energy_cpu = prev_cpu;
7106 struct energy_env *eenv;
7107
7108 if (sysctl_sched_sync_hint_enable && sync) {
7109 if (cpumask_test_cpu(cpu, &p->cpus_allowed)) {
7110 return cpu;
7111 }
7112 }
7113
7114 /* take ownership of our per-cpu data structure */
7115 eenv = get_eenv(p, prev_cpu);
7116 if (eenv->max_cpu_count < 2)
7117 return energy_cpu;
7118
7119 if(!use_fbt) {
7120 /*
7121 * using this function outside wakeup balance will not supply
7122 * an sd ptr. Instead, fetch the highest level with energy data.
7123 */
7124 if (!sd)
7125 sd = rcu_dereference(per_cpu(sd_ea, prev_cpu));
7126
7127 for_each_cpu_and(cpu_iter, &p->cpus_allowed, sched_domain_span(sd)) {
7128 unsigned long spare;
7129
7130 /* prev_cpu already in list */
7131 if (cpu_iter == prev_cpu)
7132 continue;
7133
7134 spare = capacity_spare_wake(cpu_iter, p);
7135
7136 if (spare * 1024 < capacity_margin * task_util(p))
7137 continue;
7138
7139 /* Add CPU candidate */
7140 eenv->cpu[eas_cpu_idx++].cpu_id = cpu_iter;
7141 eenv->max_cpu_count = eas_cpu_idx;
7142
7143 /* stop adding CPUs if we have no space left */
7144 if (eas_cpu_idx >= eenv->eenv_cpu_count)
7145 break;
7146 }
7147 } else {
7148 int boosted = (schedtune_task_boost(p) > 0);
7149 int prefer_idle;
7150
7151 /*
7152 * give compiler a hint that if sched_features
7153 * cannot be changed, it is safe to optimise out
7154 * all if(prefer_idle) blocks.
7155 */
7156 prefer_idle = sched_feat(EAS_PREFER_IDLE) ?
7157 (schedtune_prefer_idle(p) > 0) : 0;
7158
7159 eenv->max_cpu_count = EAS_CPU_BKP+1;
7160
7161 /* Find a cpu with sufficient capacity */
7162 eenv->cpu[EAS_CPU_NXT].cpu_id = find_best_target(p,
7163 &eenv->cpu[EAS_CPU_BKP].cpu_id,
7164 boosted, prefer_idle);
7165
7166 /* take note if no backup was found */
7167 if (eenv->cpu[EAS_CPU_BKP].cpu_id < 0)
7168 eenv->max_cpu_count = EAS_CPU_BKP;
7169
7170 /* take note if no target was found */
> 7171 if (eenv->cpu[EAS_CPU_NXT].cpu_id < 0)
7172 eenv->max_cpu_count = EAS_CPU_NXT;
7173 }
7174
7175 if (eenv->max_cpu_count == EAS_CPU_NXT) {
7176 /*
7177 * we did not find any energy-awareness
7178 * candidates beyond prev_cpu, so we will
7179 * fall-back to the regular slow-path.
7180 */
7181 return energy_cpu;
7182 }
7183
7184 /* find most energy-efficient CPU */
7185 eas_cpu_idx = select_energy_cpu_idx(eenv);
7186 energy_cpu = eenv->cpu[eas_cpu_idx].cpu_id;
7187
7188 return energy_cpu;
7189 }
7190
--
0-DAY CI Kernel Test Service
https://01.org/lkp
next reply other threads:[~2022-09-08 13:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-08 13:23 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-07-23 2:13 [jsarha:topic/cros-sof-v4.14-rebase 1457/9999] kernel/sched/fair.c:7171 find_energy_efficient_cpu() warn: inconsistent indenting kernel test robot
2022-06-18 0:46 kernel test robot
2022-05-14 3:19 kernel 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=202209082104.85MdOYy3-lkp@intel.com \
--to=lkp@intel.com \
--cc=chris.redpath@arm.com \
--cc=groeck@chromium.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.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 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.