From: kernel test robot <[email protected]>
To: Xiaobing Li <[email protected]>,
[email protected], [email protected], [email protected],
[email protected], [email protected],
[email protected], [email protected], [email protected],
[email protected], [email protected], [email protected],
[email protected]
Cc: [email protected], [email protected],
[email protected], [email protected],
[email protected], [email protected],
[email protected], [email protected],
[email protected], [email protected],
[email protected], Xiaobing Li <[email protected]>
Subject: Re: [PATCH 3/3] IO_URING: Statistics of the true utilization of sq threads.
Date: Fri, 29 Sep 2023 02:33:50 +0800 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
Hi Xiaobing,
kernel test robot noticed the following build errors:
[auto build test ERROR on tip/sched/core]
[also build test ERROR on linus/master v6.6-rc3 next-20230928]
[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#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Xiaobing-Li/SCHEDULER-Add-an-interface-for-counting-real-utilization/20230928-103219
base: tip/sched/core
patch link: https://lore.kernel.org/r/20230928022228.15770-4-xiaobing.li%40samsung.com
patch subject: [PATCH 3/3] IO_URING: Statistics of the true utilization of sq threads.
config: arm-mmp2_defconfig (https://download.01.org/0day-ci/archive/20230929/[email protected]/config)
compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project.git 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230929/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
io_uring/sqpoll.c:254:7: error: no member named 'sq_avg' in 'struct sched_entity'
se->sq_avg.last_update_time;
~~ ^
>> io_uring/sqpoll.c:260:3: error: call to undeclared function '__update_sq_avg_block'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
__update_sq_avg_block(now, se);
^
io_uring/sqpoll.c:272:7: error: no member named 'sq_avg' in 'struct sched_entity'
se->sq_avg.last_update_time;
~~ ^
>> io_uring/sqpoll.c:275:4: error: call to undeclared function '__update_sq_avg'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
__update_sq_avg(now, se);
^
4 errors generated.
vim +/__update_sq_avg_block +260 io_uring/sqpoll.c
221
222 static int io_sq_thread(void *data)
223 {
224 struct io_sq_data *sqd = data;
225 struct io_ring_ctx *ctx;
226 unsigned long timeout = 0;
227 char buf[TASK_COMM_LEN];
228 DEFINE_WAIT(wait);
229
230 snprintf(buf, sizeof(buf), "iou-sqp-%d", sqd->task_pid);
231 set_task_comm(current, buf);
232
233 if (sqd->sq_cpu != -1)
234 set_cpus_allowed_ptr(current, cpumask_of(sqd->sq_cpu));
235 else
236 set_cpus_allowed_ptr(current, cpu_online_mask);
237
238 mutex_lock(&sqd->lock);
239 bool first = true;
240 struct timespec64 ts_start, ts_end;
241 struct timespec64 ts_delta;
242 struct sched_entity *se = &sqd->thread->se;
243 while (1) {
244 bool cap_entries, sqt_spin = false;
245
246 if (io_sqd_events_pending(sqd) || signal_pending(current)) {
247 if (io_sqd_handle_event(sqd))
248 break;
249 timeout = jiffies + sqd->sq_thread_idle;
250 }
251 ktime_get_boottime_ts64(&ts_start);
252 ts_delta = timespec64_sub(ts_start, ts_end);
253 unsigned long long now = ts_delta.tv_sec * NSEC_PER_SEC + ts_delta.tv_nsec +
254 se->sq_avg.last_update_time;
255
256 if (first) {
257 now = 0;
258 first = false;
259 }
> 260 __update_sq_avg_block(now, se);
261 cap_entries = !list_is_singular(&sqd->ctx_list);
262 list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) {
263 int ret = __io_sq_thread(ctx, cap_entries);
264
265 if (!sqt_spin && (ret > 0 || !wq_list_empty(&ctx->iopoll_list)))
266 sqt_spin = true;
267 }
268
269 ktime_get_boottime_ts64(&ts_end);
270 ts_delta = timespec64_sub(ts_end, ts_start);
271 now = ts_delta.tv_sec * NSEC_PER_SEC + ts_delta.tv_nsec +
272 se->sq_avg.last_update_time;
273
274 if (sqt_spin)
> 275 __update_sq_avg(now, se);
276 else
277 __update_sq_avg_block(now, se);
278 if (io_run_task_work())
279 sqt_spin = true;
280
281 if (sqt_spin || !time_after(jiffies, timeout)) {
282 if (sqt_spin)
283 timeout = jiffies + sqd->sq_thread_idle;
284 if (unlikely(need_resched())) {
285 mutex_unlock(&sqd->lock);
286 cond_resched();
287 mutex_lock(&sqd->lock);
288 }
289 continue;
290 }
291
292 prepare_to_wait(&sqd->wait, &wait, TASK_INTERRUPTIBLE);
293 if (!io_sqd_events_pending(sqd) && !task_work_pending(current)) {
294 bool needs_sched = true;
295
296 list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) {
297 atomic_or(IORING_SQ_NEED_WAKEUP,
298 &ctx->rings->sq_flags);
299 if ((ctx->flags & IORING_SETUP_IOPOLL) &&
300 !wq_list_empty(&ctx->iopoll_list)) {
301 needs_sched = false;
302 break;
303 }
304
305 /*
306 * Ensure the store of the wakeup flag is not
307 * reordered with the load of the SQ tail
308 */
309 smp_mb__after_atomic();
310
311 if (io_sqring_entries(ctx)) {
312 needs_sched = false;
313 break;
314 }
315 }
316
317 if (needs_sched) {
318 mutex_unlock(&sqd->lock);
319 schedule();
320 mutex_lock(&sqd->lock);
321 }
322 list_for_each_entry(ctx, &sqd->ctx_list, sqd_list)
323 atomic_andnot(IORING_SQ_NEED_WAKEUP,
324 &ctx->rings->sq_flags);
325 }
326
327 finish_wait(&sqd->wait, &wait);
328 timeout = jiffies + sqd->sq_thread_idle;
329 }
330
331 io_uring_cancel_generic(true, sqd);
332 sqd->thread = NULL;
333 list_for_each_entry(ctx, &sqd->ctx_list, sqd_list)
334 atomic_or(IORING_SQ_NEED_WAKEUP, &ctx->rings->sq_flags);
335 io_run_task_work();
336 mutex_unlock(&sqd->lock);
337
338 complete(&sqd->exited);
339 do_exit(0);
340 }
341
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
prev parent reply other threads:[~2023-09-28 18:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20230928023004epcas5p4a6dac4cda9c867f3673690521a8c18b6@epcas5p4.samsung.com>
2023-09-28 2:22 ` [PATCH 0/3] Sq thread real utilization statistics Xiaobing Li
[not found] ` <CGME20230928023007epcas5p276b6e029a67001a6ed8ab28c05b2be9c@epcas5p2.samsung.com>
2023-09-28 2:22 ` [PATCH 1/3] SCHEDULER: Add an interface for counting real utilization Xiaobing Li
2023-09-28 7:52 ` kernel test robot
2023-09-28 8:02 ` Peter Zijlstra
2023-09-29 0:31 ` Thomas Gleixner
[not found] ` <CGME20230928023011epcas5p32668b193b447f1cd6bf78035f4894c42@epcas5p3.samsung.com>
2023-09-28 2:22 ` [PATCH 2/3] PROC FILESYSTEM: Add real utilization data of sq thread Xiaobing Li
[not found] ` <CGME20230928023015epcas5p273b3eaebf3759790c278b03c7f0341c8@epcas5p2.samsung.com>
2023-09-28 2:22 ` [PATCH 3/3] IO_URING: Statistics of the true utilization of sq threads Xiaobing Li
2023-09-28 8:01 ` Peter Zijlstra
2023-09-28 8:23 ` Jens Axboe
2023-09-28 8:37 ` Matthew Wilcox
2023-09-28 8:41 ` Jens Axboe
2023-09-28 18:33 ` kernel test robot [this message]
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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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