All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFD] pstore: pmsg: ramoops: add multiple pmsg instances
@ 2015-10-09  1:52 Hiraku Toyooka
  2015-10-09 16:15 ` Mark Salyzyn
  0 siblings, 1 reply; 3+ messages in thread
From: Hiraku Toyooka @ 2015-10-09  1:52 UTC (permalink / raw)
  To: tony.luck, keescook, anton, salyzyn, ccross, seiji.aguchi.tr,
	LKML

Hello,

I'm trying to make the feature of multiple pmsg instances for ramoops.
I would like to discuss a possible way of getting the feature added to
mainline.

The reason to add the multiple pmsg is to preserve particular
messages over a long time, which are useful for failure analysis.

Currently, we can use /dev/pmsg0 to log userspace messages into pstore.
It is useful but we can use only one pstore buffer even if pstore
backend module (e.g. ramoops) can create multiple buffers. When one
messages happen to be generated repeatedly, old messages are
overwritten by them regardless of the importance of the messages.

Multiple pmsg will solves the problem. If we have two pmsg files:
/dev/pmsg{0,1}, we can write all messages into /dev/pmsg0, while
writing important ones into /dev/pmsg1. It can also be used for
preserving important kernel messages selected by an userspace daemon.

We have two types of files for pmsg. /dev/pmsg0 is for logging and
/sys/fs/pstore/pmsg-$backend-0 is for read. We can extend these files
like pmsg{0,1,2,...}, pmsg-$backend-{0,1,2,...}.

To realize this /dev/pmsgN interface, pstore backend modules which
manage multiple buffers for pmsg should tell the necessary numbers of
buffer to pstore_register_pmsg() via pstore_info. In addition, for
ramoops, I think the following works for ram.c are necessary at least.

* Parse multiple pmsg size in module parameter, for example,
  pmsg_size=0x2000,0x1000,...

* Change pmsg_size in ramoops_platform_data to a pointer of size
  array.

 struct ramoops_platform_data {
        ...
-	unsigned long	pmsg_size;
+	unsigned long	*pmsg_size;
        ...
 };

  When a ramoops's backend driver registers the platform_data and want
  pmsg buffers, it should allocate an array of size for pmsg_size.
  (Although there is no ramoops's backend which uses pmsg currently)

* Give an ID for each pmsg buffer, and modify some functions related to
  buffer allocation.

What do you think about this idea?

Best regards,
Hiraku Toyooka



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-10-19  1:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-09  1:52 [RFD] pstore: pmsg: ramoops: add multiple pmsg instances Hiraku Toyooka
2015-10-09 16:15 ` Mark Salyzyn
2015-10-19  1:59   ` Hiraku Toyooka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.