From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Petr Mladek <pmladek@suse.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>,
linux-kernel@vger.kernel.org,
Lech Perczak <l.perczak@camlintechnologies.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Theodore Ts'o <tytso@mit.edu>,
John Ogness <john.ogness@linutronix.de>
Subject: Re: [PATCH] printk: queue wake_up_klogd irq_work only if per-CPU areas are ready
Date: Tue, 3 Mar 2020 19:27:53 +0900 [thread overview]
Message-ID: <20200303102753.GB904@jagdpanzerIV.localdomain> (raw)
In-Reply-To: <20200303091847.uyy7gzac52lkl75m@pathway.suse.cz>
On (20/03/03 10:18), Petr Mladek wrote:
[..]
> > static void queue_flush_work(struct printk_safe_seq_buf *s)
> > {
> > - if (printk_safe_irq_ready)
> > + if (printk_percpu_data_ready())
> > irq_work_queue(&s->work);
>
> This is not safe. printk_percpu_data_ready() returns true even before
> s->work gets initialized by printk_safe_init().
Good catch! I'll move printk_safe_init() call from init/main.c to
set_percpu_data_ready().
> Solution would be to call printk_safe_init() from
> setup_log_buf() before calling set_percpu_data_ready().
I'll move the init call. But printk_safe/nmi called too-early
will still write to no-yet-initialised per-cpu data.
-ss
prev parent reply other threads:[~2020-03-03 10:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-03 4:40 [PATCH] printk: queue wake_up_klogd irq_work only if per-CPU areas are ready Sergey Senozhatsky
2020-03-03 9:18 ` Petr Mladek
2020-03-03 10:27 ` Sergey Senozhatsky [this message]
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=20200303102753.GB904@jagdpanzerIV.localdomain \
--to=sergey.senozhatsky@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=john.ogness@linutronix.de \
--cc=l.perczak@camlintechnologies.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=tytso@mit.edu \
/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;
as well as URLs for NNTP newsgroup(s).