From: John Ogness <john.ogness@linutronix.de>
To: Petr Mladek <pmladek@suse.com>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, Petr Mladek <pmladek@suse.com>
Subject: Re: [PATCH] printk/nbcon: Add assert that CPU migration is disabled when calling nbcon_context_try_acquire()
Date: Wed, 20 Sep 2023 15:06:08 +0206 [thread overview]
Message-ID: <874jjpt2xz.fsf@jogness.linutronix.de> (raw)
In-Reply-To: <20230920125136.15504-1-pmladek@suse.com>
On 2023-09-20, Petr Mladek <pmladek@suse.com> wrote:
> The nbcon console is locked when the 'prio' and 'cpu' fields in
> console->nbcon_state stay the same. The locking algorithm would
> break when the locked context got migrated to another CPU.
>
> Add assert into nbcon_context_try_acquire(). It would warn when
> the function is called in a context where the CPU migration
> is possible.
static bool nbcon_context_try_acquire(struct nbcon_context *ctxt)
{
unsigned int cpu = smp_processor_id();
Doesn't smp_processor_id() already provide the necessary checking and
warning?
John
next prev parent reply other threads:[~2023-09-20 13:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-20 12:51 Petr Mladek
2023-09-20 13:00 ` John Ogness [this message]
2023-09-20 13:08 ` Petr Mladek
2023-09-20 15:57 ` kernel test robot
2023-09-20 18:24 ` kernel test robot
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=874jjpt2xz.fsf@jogness.linutronix.de \
--to=john.ogness@linutronix.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
--cc=tglx@linutronix.de \
/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®