Re: [PATCH 00/14] Pramfs: Persistent and protected ram filesystem

David VomLehn
2009-06-23T01:42:23Z

On Mon, Jun 22, 2009 at 05:26:45PM -0600, Chris Friesen wrote:
> Pavel Machek wrote:
>
> > More politely said: "I believe you would be better off modifying
> > ramdisk to include the functionality for persistence." New filesystem
> > should not really be neccessary. ext2 for performance, ext3 if you
> > need robustness from journalling, maybe something else makes sense,
> > too.
>
> I agree that a persistent block device makes more sense.
>
> However, as someone with some experience in using this type of
> mechanism, a special filesystem (separate from the special block device)
> could also be useful. We often use things like circular buffers,
> per-cpu areas, both log-structured and variable-length records, etc. A
> filesystem that would take care of this type of thing under the hood
> might simplify a few things.
>
> Also note that it's very useful for the kernel itself to be able to
> access the contents of this persistent area...we use it for parts of the
> log stream, various forms of "flight recorder" information, panic
> tracebacks, etc. as well as making it available to select userspace apps.

I think we might step back from this particular patch and look at what people
actually want. From my standpoint, we use, or intend to use, persistent memory
in three ways:

1. Recording crash logs from user space
2. Recording crash logs from kernel space
3. Flight recorder/continuous logging.

The first two uses share the same chunk of memory. In the first case, the
interface is through filesystem operations from user space, but simple memcpys
in kernel space. Neither of these uses is performance critical

The third use is a different memory chunk and, depending on just what you log,
can have a significant performance impact. It is helpful if this can be a
single chunk of pram that is contiguous in kernel virtual space. Depending
on how you use it, you might even want it to be uncached. I'm not clear on
whether Pramfs supports this.

All three use cases can be satisfied with a persistent memory block device,
as others have mentioned, so long as multiple pram partitions are supported.
We might steal the mtdparts syntax for this (see drivers/mtd/cmdlinepart.c).

Another consideration--we actually stopped using a checksum on our crash logs.
The crash logs are in text, so if they are a little bit stomped on, they
are still usable. If you require a matching checksum, you lose the ability
to read those slightly dented logs. So, all the work that's being done to
ensure data integrity in the pram filesystem is actually harmful in this case.

I don't know whether a pram block device helps at all with a pramfs, but I
wouldn't want to lose ability to choose to use the block device directly
or switch to a pramfs.

> Chris