lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALqELGwttee-TmN6=0YGD2kKpzAQOuw_niDRQHVPRD02b-25ig@mail.gmail.com>
Date: Tue, 30 Sep 2025 14:21:05 +0100
From: Andrew Murray <amurray@...goodpenguin.co.uk>
To: John Ogness <john.ogness@...utronix.de>
Cc: Petr Mladek <pmladek@...e.com>, Steven Rostedt <rostedt@...dmis.org>, 
	Sergey Senozhatsky <senozhatsky@...omium.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/3] printk: Introduce console_flush_one_record

On Tue, 30 Sept 2025 at 13:54, John Ogness <john.ogness@...utronix.de> wrote:
>
> On 2025-09-27, Andrew Murray <amurray@...goodpenguin.co.uk> wrote:
> > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> > index 0efbcdda9aaba9d8d877df5e4f1db002d3a596bc..060d4919de320fe21fd7aca73ba497e27c4ff334 100644
> > --- a/kernel/printk/printk.c
> > +++ b/kernel/printk/printk.c
> > @@ -3161,6 +3161,100 @@ static inline void printk_kthreads_check_locked(void) { }
> >
> >  #endif /* CONFIG_PRINTK */
> >
> > +
> > +/*
> > + * Print out one record for each console.
> > + *
> > + * @do_cond_resched is set by the caller. It can be true only in schedulable
> > + * context.
> > + *
> > + * @next_seq is set to the sequence number after the last available record.
> > + * The value is valid only when this function returns true.
> > + *
> > + * @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.
> > + *
> > + * 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.
> > + *
> > + * Requires the console_lock.
> > + */
> > +static bool console_flush_one_record(bool do_cond_resched, u64 *next_seq, bool *handover,
> > +                                  bool *any_usable)
> > +{
> > +     struct console_flush_type ft;
> > +     struct console *con;
> > +     bool any_progress;
> > +     int cookie;
> > +
> > +     any_progress = false;
>
> I would let this be a definition initializer. And then place it sorted
> by length:
>
>         struct console_flush_type ft;
>         bool any_progress = false;
>         struct console *con;
>         int cookie;
>
> John

Sure, I'll update it on the next iteration.

Thanks,

Andrew Murray

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ