[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8734tfml8v.fsf@jogness.linutronix.de>
Date: Mon, 26 Feb 2024 14:08:40 +0106
From: John Ogness <john.ogness@...utronix.de>
To: Mukesh Ojha <quic_mojha@...cinc.com>, pmladek@...e.com,
rostedt@...dmis.org, senozhatsky@...omium.org
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] printk: Update @console_may_schedule in
console_trylock_spinning()
On 2024-02-26, Mukesh Ojha <quic_mojha@...cinc.com> wrote:
> what if console_trylock_spinning() gets the lock which makes
> console_may_schedule =1 and it is still schedulable ?
I am afraid I do not understand the question.
console_trylock_spinning() is only called from the printk caller
context. In this context, console_may_schedule is always set to 0.
Only if another context acquires the console lock per sleeping wait,
console_lock(), can console_may_schedule be set to 1.
Note that the value of console_may_schedule is only relevant for the
console lock owner when console_unlock() is called. That is why its
value is set when locking the console (or, with this patch, when
transferring console lock ownerhip).
John
Powered by blists - more mailing lists