[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZRaLbUHStnPAGAjR@alley>
Date: Fri, 29 Sep 2023 10:31:41 +0200
From: Petr Mladek <pmladek@...e.com>
To: John Ogness <john.ogness@...utronix.de>
Cc: Sergey Senozhatsky <senozhatsky@...omium.org>,
Steven Rostedt <rostedt@...dmis.org>,
Thomas Gleixner <tglx@...utronix.de>,
linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
Waiman Long <longman@...hat.com>,
Boqun Feng <boqun.feng@...il.com>
Subject: Re: [PATCH printk v2 11/11] lockdep: Add atomic write enforcement
for lockdep splats
On Wed 2023-09-20 01:14:56, John Ogness wrote:
> Invoke the atomic write enforcement functions for lockdep
> splats to ensure that the information gets out to the consoles.
>
> --- a/kernel/locking/lockdep.c
> +++ b/kernel/locking/lockdep.c
> @@ -3967,9 +3968,13 @@ static void
> print_usage_bug(struct task_struct *curr, struct held_lock *this,
> enum lock_usage_bit prev_bit, enum lock_usage_bit new_bit)
> {
> + enum nbcon_prio prev_prio;
> +
> if (!debug_locks_off() || debug_locks_silent)
> return;
>
> + prev_prio = nbcon_atomic_enter(NBCON_PRIO_EMERGENCY);
> +
> pr_warn("\n");
> pr_warn("================================\n");
> pr_warn("WARNING: inconsistent lock state\n");
> @@ -3998,6 +4003,8 @@ print_usage_bug(struct task_struct *curr, struct held_lock *this,
>
> pr_warn("\nstack backtrace:\n");
> dump_stack();
> +
> + nbcon_atomic_exit(NBCON_PRIO_EMERGENCY, prev_prio);
> }
The location of the emergency context looks good. I have just proposed
another way for tracking the emergency context. It would allow to
call nbcon_emergency_enter()/exit() without any parameter,
see https://lore.kernel.org/r/ZRLBxsXPCym2NC5Q@alley
Best Regards,
Petr
Powered by blists - more mailing lists