From: Stefan Metzmacher <[email protected]>
To: Jens Axboe <[email protected]>, [email protected]
Subject: Re: [PATCH v3 0/6] Complete setup before calling wake_up_new_task()
Date: Mon, 26 Apr 2021 18:01:30 +0200 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
Hi Jens,
>> now that we have an explicit wake_up_new_task() in order to start the
>> result from create_io_thread(), we should set things up before calling
>> wake_up_new_task().
>>
>> Changes in v3:
>> - rebased on for-5.13/io_uring.
>> - I dropped this:
>> fs/proc: hide PF_IO_WORKER in get_task_cmdline()
>> - I added:
>> set_task_comm() overflow checks
>
> Looks good to me, a few comments:
>
> 1) I agree with Pavel that the WARN on overflow is kinda silly,
> it doesn't matter that much. So I'd rather drop those for now.
I think the overflow matters, the last time, it went unnoticed in
commit c5def4ab849494d3c97f6c9fc84b2ddb868fe78c
worker->task = kthread_create_on_node(io_wqe_worker, worker, wqe->node,
- "io_wqe_worker-%d", wqe->node);
+ "io_wqe_worker-%d/%d", index, wqe->node);
With that "io_wqe_worker-0" or "io_wqe_worker-1" are still (up to 5.11)
reported to userspace. And between 5.3 and 5.4 the meaning changed,
the shown value is now unbound vs. bound, while it was the numa node before.
While I was debugging numa related problems, that took a long time to
figure out.
Now that we have the pid encoded in the name, it should not be truncated,
otherwise it will make it impossible to debug problems.
If the userspace application has 10 threads (with pids which would all cause
on overflow) and each uses io_uring (64 io-workers each), then we may have
640 io-workers all with the same name, which are all in the same userspace
process, and it's not possible to find which workers belong to which userspace
thread.
Currently we can ignore as there's no problem, so I'm fine with dropping
5-6 for now.
Maybe a better assertion would be BUILD_BUG_ON(PID_MAX_LIMIT > 9999999);
(or something similar) in order to prevent this from happening.
> 2) Would really love it to see some decent commit messages, quite
> a few of them are empty. In general some reasoning is nice in
> the commit message, when you don't have the context available.
>
> Do you want to do a v4 with 5-6/6 dropped for now, and 3-4 having
> some reasoning? I can also just apply as-is and write some commit
> message myself, let me know. I'll add 1-2 for now.
I'm currently busy with other stuff, it would be great if you could
expand the commit messages!
Thanks!
metze
prev parent reply other threads:[~2021-04-26 16:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-24 23:26 [PATCH v3 0/6] Complete setup before calling wake_up_new_task() Stefan Metzmacher
2021-04-24 23:26 ` [PATCH v3 1/6] kernel: always initialize task->pf_io_worker to NULL Stefan Metzmacher
2021-04-24 23:26 ` [PATCH v3 2/6] io_uring: io_sq_thread() no longer needs to reset current->pf_io_worker Stefan Metzmacher
2021-04-24 23:26 ` [PATCH v3 3/6] io-wq: call set_task_comm() before wake_up_new_task() Stefan Metzmacher
2021-04-24 23:26 ` [PATCH v3 4/6] io_uring: complete sq_thread setup before calling wake_up_new_task() Stefan Metzmacher
2021-04-24 23:26 ` [PATCH v3 5/6] io-wq: warn about future set_task_comm() overflows Stefan Metzmacher
2021-04-25 0:08 ` Pavel Begunkov
2021-04-24 23:26 ` [PATCH v3 6/6] io_uring: " Stefan Metzmacher
2021-04-25 16:28 ` [PATCH v3 0/6] Complete setup before calling wake_up_new_task() Jens Axboe
2021-04-26 16:01 ` Stefan Metzmacher [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] \
/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