public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: John Ogness <john.ogness@linutronix.de>
To: Enlin Mu <enlin.mu@outlook.com>,
	pmladek@suse.com, rostedt@goodmis.org, senozhatsky@chromium.org,
	keescook@chromium.org, tony.luck@intel.com, gpiccoli@igalia.com,
	enlin.mu@unisoc.com, enlinmu@gmail.com
Cc: linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH] printk: add cpu id information to printk() output
Date: Fri, 15 Sep 2023 10:40:03 +0206	[thread overview]
Message-ID: <8734zfx2bo.fsf@jogness.linutronix.de> (raw)
In-Reply-To: <JH0PR04MB7072A4B6946EAEEB1EB8B0BE8AF6A@JH0PR04MB7072.apcprd04.prod.outlook.com>

On 2023-09-15, Enlin Mu <enlin.mu@outlook.com> wrote:
> Sometimes we want to print cpu id of printk() messages to consoles
>
> diff --git a/include/linux/threads.h b/include/linux/threads.h
> index c34173e6c5f1..6700bd9a174f 100644
> --- a/include/linux/threads.h
> +++ b/include/linux/threads.h
> @@ -34,6 +34,9 @@
>  #define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 : \
>  	(sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT))
>  
> +#define CPU_ID_SHIFT 23
> +#define CPU_ID_MASK  0xff800000

This only supports 256 CPUs. I think it doesn't make sense to try to
squish CPU and Task IDs into 32 bits.

What about introducing a caller_id option to always only print the CPU
ID? Or do you really need Task _and_ CPU?

John Ogness

  reply	other threads:[~2023-09-15  8:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-15  7:40 [PATCH] printk: add cpu id information to printk() output Enlin Mu
2023-09-15  8:34 ` John Ogness [this message]
2023-09-15  8:46   ` Enlin Mu
2023-09-15  9:53     ` Greg KH
2023-09-15 16:32       ` Petr Mladek
2023-09-18  8:54         ` John Ogness
2023-09-22  7:20         ` Enlin Mu
2023-09-22  8:03           ` Petr Mladek
2023-09-22  7:34   ` Enlin Mu
2023-09-22  7:47     ` Petr Mladek
2023-09-15  9:51 ` Greg KH
2023-09-15 16:31 ` Luck, Tony

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=8734zfx2bo.fsf@jogness.linutronix.de \
    --to=john.ogness@linutronix.de \
    --cc=enlin.mu@outlook.com \
    --cc=enlin.mu@unisoc.com \
    --cc=enlinmu@gmail.com \
    --cc=gpiccoli@igalia.com \
    --cc=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    --cc=tony.luck@intel.com \
    /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