Re: [PATCH 7/8] pstore: Remove needless lock during console writes
From: Kees Cook
Date: Fri Nov 02 2018 - 16:40:14 EST
On Fri, Nov 2, 2018 at 11:32 AM, Joel Fernandes <joel@xxxxxxxxxxxxxxxxx> wrote:
> On Thu, Nov 01, 2018 at 04:51:59PM -0700, Kees Cook wrote:
>> Since commit 70ad35db3321 ("pstore: Convert console write to use
>> ->write_buf"), the console writer does not use the preallocated crash
>> dump buffer any more, so there is no reason to perform locking around it.
>
> Out of curiosity, what was the reason for having this preallocated crash
> buffer in the first place? I thought the 'console' type only did regular
> kernel console logging, not crash dumps.
The primary reason is that the dumper needs to write to somewhere and
we don't know the state of the system (memory allocation may not work
for example).
The other frontends tend to run at "sane" locations in the kernel. The
dumper, however, is quite fragile.
> I looked at all the patches and had some minor nits, with the nits addressed
> (if you agree with them), feel free to add my Reviewed-by on future respins:
>
> Reviewed-by: Joel Fernandes (Google) <joel@xxxxxxxxxxxxxxxxx>
Thanks!
> Also I wonder if Namhyung is still poking around that virtio pstore driver he
> mentioned in the commit mentioned above. :)
Did that never land? I thought it mostly had to happen at the qemu end?
With nvdimm emulation, we can just use ramoops. :)
-Kees
--
Kees Cook