Re: [RFC][PATCHv2 3/7] printk: introduce per-cpu alt_print seq buffer

From: Sergey Senozhatsky
Date: Sun Oct 09 2016 - 21:56:32 EST


On (10/06/16 15:08), Petr Mladek wrote:
[..]
> > +static int vprintk_nmi(const char *fmt, va_list args)
> > +{
> > + struct alt_printk_seq_buf *s = this_cpu_ptr(&nmi_print_seq);
> > + int add;
> > +
> > + add = alt_printk_log_store(s, fmt, args);
> > + if (!add)
> > + atomic_inc(&nmi_message_lost);
>
> This would could also empty string as an error. A solution might be
> update alt_printk_log_store() to return -1 in case of lost log.
> Note that vprintk_nmi() still needs to return 0 in this case to
> stay compatible with printk().

will do.

> > +static int vprintk_alt(const char *fmt, va_list args)
> > +{
> > + struct alt_printk_seq_buf *s = this_cpu_ptr(&alt_print_seq);
> > +
> > + return alt_printk_log_store(s, fmt, args);
>
> We should handle lost strings here as well. But it can be
> done in a followup patch.

ok, will do.

-ss