From: kernel test robot <lkp@intel.com>
To: Tejun Heo <tj@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
linux-kernel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>
Subject: block/blk-iocost.c:1183:6: warning: variable 'last_period' set but not used
Date: Wed, 10 Jan 2024 23:19:04 +0800 [thread overview]
Message-ID: <202401102335.GiWdeIo9-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: ab27740f76654ed58dd32ac0ba0031c18a6dea3b
commit: ac33e91e2daca40fcad66c68712276da7b40f169 blk-iocost: implement vtime loss compensation
date: 3 years, 4 months ago
config: x86_64-buildonly-randconfig-001-20240107 (https://download.01.org/0day-ci/archive/20240110/202401102335.GiWdeIo9-lkp@intel.com/config)
compiler: ClangBuiltLinux clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240110/202401102335.GiWdeIo9-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401102335.GiWdeIo9-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> block/blk-iocost.c:1183:6: warning: variable 'last_period' set but not used [-Wunused-but-set-variable]
1183 | u64 last_period, cur_period;
| ^
1 warning generated.
vim +/last_period +1183 block/blk-iocost.c
1179
1180 static bool iocg_activate(struct ioc_gq *iocg, struct ioc_now *now)
1181 {
1182 struct ioc *ioc = iocg->ioc;
> 1183 u64 last_period, cur_period;
1184 u64 vtime, vtarget;
1185 int i;
1186
1187 /*
1188 * If seem to be already active, just update the stamp to tell the
1189 * timer that we're still active. We don't mind occassional races.
1190 */
1191 if (!list_empty(&iocg->active_list)) {
1192 ioc_now(ioc, now);
1193 cur_period = atomic64_read(&ioc->cur_period);
1194 if (atomic64_read(&iocg->active_period) != cur_period)
1195 atomic64_set(&iocg->active_period, cur_period);
1196 return true;
1197 }
1198
1199 /* racy check on internal node IOs, treat as root level IOs */
1200 if (iocg->child_active_sum)
1201 return false;
1202
1203 spin_lock_irq(&ioc->lock);
1204
1205 ioc_now(ioc, now);
1206
1207 /* update period */
1208 cur_period = atomic64_read(&ioc->cur_period);
1209 last_period = atomic64_read(&iocg->active_period);
1210 atomic64_set(&iocg->active_period, cur_period);
1211
1212 /* already activated or breaking leaf-only constraint? */
1213 if (!list_empty(&iocg->active_list))
1214 goto succeed_unlock;
1215 for (i = iocg->level - 1; i > 0; i--)
1216 if (!list_empty(&iocg->ancestors[i]->active_list))
1217 goto fail_unlock;
1218
1219 if (iocg->child_active_sum)
1220 goto fail_unlock;
1221
1222 /*
1223 * Always start with the target budget. On deactivation, we throw away
1224 * anything above it.
1225 */
1226 vtarget = now->vnow - ioc->margins.target;
1227 vtime = atomic64_read(&iocg->vtime);
1228
1229 atomic64_add(vtarget - vtime, &iocg->vtime);
1230 atomic64_add(vtarget - vtime, &iocg->done_vtime);
1231 vtime = vtarget;
1232
1233 /*
1234 * Activate, propagate weight and start period timer if not
1235 * running. Reset hweight_gen to avoid accidental match from
1236 * wrapping.
1237 */
1238 iocg->hweight_gen = atomic_read(&ioc->hweight_gen) - 1;
1239 list_add(&iocg->active_list, &ioc->active_iocgs);
1240
1241 propagate_weights(iocg, iocg->weight,
1242 iocg->last_inuse ?: iocg->weight, true, now);
1243
1244 TRACE_IOCG_PATH(iocg_activate, iocg, now,
1245 last_period, cur_period, vtime);
1246
1247 iocg->activated_at = now->now;
1248
1249 if (ioc->running == IOC_IDLE) {
1250 ioc->running = IOC_RUNNING;
1251 ioc->debt_busy_at = now->now;
1252 ioc_start_period(ioc, now);
1253 }
1254
1255 succeed_unlock:
1256 spin_unlock_irq(&ioc->lock);
1257 return true;
1258
1259 fail_unlock:
1260 spin_unlock_irq(&ioc->lock);
1261 return false;
1262 }
1263
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-01-10 15:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202401102335.GiWdeIo9-lkp@intel.com \
--to=lkp@intel.com \
--cc=axboe@kernel.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--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