public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: John Ogness <john.ogness@linutronix.de>
Cc: Andrew Murray <amurray@thegoodpenguin.co.uk>,
	Steven Rostedt <rostedt@goodmis.org>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/3] printk: console_flush_one_record() code cleanup
Date: Thu, 23 Oct 2025 16:54:31 +0200	[thread overview]
Message-ID: <aPpBpzjm2TpnbiNs@pathway.suse.cz> (raw)
In-Reply-To: <873479daeh.fsf@jogness.linutronix.de>

On Thu 2025-10-23 15:24:14, John Ogness wrote:
> On 2025-10-20, Andrew Murray <amurray@thegoodpenguin.co.uk> wrote:
> > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> > index 1c048c66d09919967e57326e1732bd17c10f3c76..6c846d2d37d9d20bad58c6e3a7caada3be9552ca 100644
> > --- a/kernel/printk/printk.c
> > +++ b/kernel/printk/printk.c
> > @@ -3142,31 +3142,33 @@ static inline void printk_kthreads_check_locked(void) { }
> >   * context.
> >   *
> >   * @next_seq is set to the sequence number after the last available record.
> > - * The value is valid only when there is at least one usable console and all
> > - * usable consoles were flushed.
> > + * The value is valid only when all usable consoles were flushed. It is
> > + * when the function returns true (can do the job) and @try_again parameter
> > + * is set to false, see below.
> >   *
> >   * @handover will be set to true if a printk waiter has taken over the
> >   * console_lock, in which case the caller is no longer holding the
> >   * console_lock. Otherwise it is set to false.
> >   *
> > - * @any_usable will be set to true if there are any usable consoles.
> > + * @try_again will be set to true when it still makes sense to call this
> > + * function again. The function could do the job, see the return value.
> > + * And some consoles still make progress.
> >   *
> > - * Returns true when there was at least one usable console and a record was
> > - * flushed. A returned false indicates there were no records to flush for any
> > - * of the consoles. It may also indicate that there were no usable consoles,
> > - * the context has been lost or there is a panic suitation. Regardless the
> > - * reason, the caller should assume it is not useful to immediately try again.
> > + * Returns true when the function could do the job. Some consoles are usable,
> > + * and there was no takeover and no panic_on_other_cpu().
> >   *
> >   * Requires the console_lock.
> >   */
> >  static bool console_flush_one_record(bool do_cond_resched, u64 *next_seq, bool *handover,
> > -				     bool *any_usable)
> > +				     bool *try_again)
> >  {
> >  	struct console_flush_type ft;
> > -	bool any_progress = false;
> > +	int any_usable = false;
> 
> Nit: This should be a bool.

Great catch! No need to resend the patch. I could fix this when committing.

> With the change:
> 
> Reviewed-by: John Ogness <john.ogness@linutronix.de>

Thanks for the review. 

Best Regards,
Petr

  reply	other threads:[~2025-10-23 14:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-20 15:38 [PATCH v3 0/3] printk: Release console_lock between printing records in legacy thread Andrew Murray
2025-10-20 15:38 ` [PATCH v3 1/3] printk: Introduce console_flush_one_record Andrew Murray
2025-10-23 13:17   ` John Ogness
2025-10-20 15:38 ` [PATCH v3 2/3] printk: console_flush_one_record() code cleanup Andrew Murray
2025-10-23 13:18   ` John Ogness
2025-10-23 14:54     ` Petr Mladek [this message]
2025-10-23 15:21       ` Andrew Murray
2025-10-20 15:38 ` [PATCH v3 3/3] printk: Use console_flush_one_record for legacy printer kthread Andrew Murray
2025-10-23 13:19   ` John Ogness
2025-10-23 14:56     ` Petr Mladek
2025-10-23 15:21       ` Andrew Murray
2025-10-23 15:38 ` [PATCH v3 0/3] printk: Release console_lock between printing records in legacy thread Petr Mladek

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=aPpBpzjm2TpnbiNs@pathway.suse.cz \
    --to=pmladek@suse.com \
    --cc=amurray@thegoodpenguin.co.uk \
    --cc=john.ogness@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.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