mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Yafang Shao <laoar.shao@gmail.com>
Cc: Tejun Heo <tj@kernel.org>, Jan Engelhardt <jengelh@inai.de>,
	Craig Small <csmall@enc.com.au>,
	linux-kernel@vger.kernel.org,
	Lai Jiangshan <jiangshanlai@gmail.com>
Subject: Re: [PATCH workqueue/for-6.10-fixes] workqueue: Refactor worker ID formatting and make wq_worker_comm() use full ID string
Date: Thu, 23 May 2024 09:16:49 +0200	[thread overview]
Message-ID: <d225dac2-501b-40de-b9d9-305a9ebfff51@prevas.dk> (raw)
In-Reply-To: <CAHk-=wj9gFa31JiMhwN6aw7gtwpkbAJ76fYvT5wLL_tMfRF77g@mail.gmail.com>

On 21/05/2024 20.05, Linus Torvalds wrote:
> On Mon, 20 May 2024 at 19:34, Yafang Shao <laoar.shao@gmail.com> wrote:
>>
>> We discussed extending it to 24 characters several years ago [0], but
>> some userspace tools might break.
> 
> Well, the fact that we already expose names longer than 16 bytes in
> /proc means that at least *that* side of it could use an extended
> comm[] array.
> 
> Yes, some other interfaces might want to still use a 16-byte limit as
> the length for the buffers they use (tracing?) but I suspect we could
> make the comm[] array easily bigger.
> 
> But what I suspect we should do *first* is to try to get rid of a lot
> of the "current->comm" users. One of the most common uses is purely
> for printing, and we could actually just add a new '%p' pointer for
> printing the current name. That would allow our vsprintf() code to not
> just use tsk->comm, but to use the full_name for threads etc.
> 
> So instead of
> 
>    printf("%s ..", tsk->comm..);
> 
> we could have something like
> 
>    printf("%pc ..", tsk);

The alphabet is running out of letters, so if somebody goes and
implement this, I'd suggest making this %pc thing take extra modifiers,
so one could also get the pid or whatever else one might want to print
from a task. I.e. %pcN, %pcP, ... We could of course have %pc with no
following letter mean ->comm (or "real name" for kernel threads) if that
is the most common thing, which it very well might be.

Rasmus


      parent reply	other threads:[~2024-05-23  7:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <o89373n4-3oq5-25qr-op7n-55p9657r96o8@vanv.qr>
     [not found] ` <CAHk-=wjxdtkFMB8BPYpU3JedjAsva3XXuzwxtzKoMwQ2e8zRzw@mail.gmail.com>
2024-05-20 22:30   ` Tejun Heo
2024-05-20 23:26     ` Jan Engelhardt
2024-05-20 23:27       ` Tejun Heo
2024-05-21  2:33     ` Yafang Shao
2024-05-21 18:05       ` Linus Torvalds
2024-05-23  2:38         ` Yafang Shao
2024-05-23  4:32           ` Linus Torvalds
2024-05-23 13:03             ` Yafang Shao
2024-05-23 15:55               ` Linus Torvalds
2024-05-24  7:42                 ` Yafang Shao
2024-05-24 14:58                   ` Linus Torvalds
2024-05-26  2:34                     ` Yafang Shao
2024-05-23 17:25             ` Steven Rostedt
2024-05-23 19:03               ` Linus Torvalds
2024-05-23  7:16         ` Rasmus Villemoes [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 \
    --in-reply-to=d225dac2-501b-40de-b9d9-305a9ebfff51@prevas.dk \
    --to=rasmus.villemoes@prevas.dk \
    --cc=csmall@enc.com.au \
    --cc=jengelh@inai.de \
    --cc=jiangshanlai@gmail.com \
    --cc=laoar.shao@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.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

all inboxes | Powered by JetHome®