Execute in place
Quoted 7 lines · Hugh Dickins
Quoted 6 lines · Phillip Susi
Quoted 4 lines · Hugh Dickins
tmpfs doesn't store its stuff in the page cache twice: that's true, and I didn't mean to imply otherwise. But tmpfs doesn't contain any support for rom memory: you'd have to copy from rom to tmpfs to use it.
Quoted 7 lines
Quoted 5 lines
The question is, when you execute a binary on tmpfs, does its code segment get mapped directly where it's at in the buffer cache, or does it get copied to another page for the executing process? At least, assuming this is possible due to the vma and file offsets of the segment being aligned.
Its pages are mapped directly into the executing process, without copying.
Thank GOD! Boy, was I worried there for a second.
Now, if there were only an easy way to make tmpfs persistent?
Thanks!
--
Al
Quoted 12 lines · Al Boldi
Quoted 11 lines · Hugh Dickins
Quoted 10 lines · Phillip Susi
Quoted 4 lines · Hugh Dickins
tmpfs doesn't store its stuff in the page cache twice: that's true, and I didn't mean to imply otherwise. But tmpfs doesn't contain any support for rom memory: you'd have to copy from rom to tmpfs to use it.
The question is, when you execute a binary on tmpfs, does its code segment get mapped directly where it's at in the buffer cache, or does it get copied to another page for the executing process? At least, assuming this is possible due to the vma and file offsets of the segment being aligned.
Quoted 7 lines
Quoted 1 line
Its pages are mapped directly into the executing process, without copying.
Thank GOD! Boy, was I worried there for a second.
Now, if there were only an easy way to make tmpfs persistent?
It would be not a tmpfs (*temporary* fs)then, but something like this
http://pramfs.sourceforge.net/
Regards,
Dmitry
Quoted 4 lines · Dmitry Krivoschekov
Quoted 1 line · Al Boldi
Now, if there were only an easy way to make tmpfs persistent?
It would be not a tmpfs (*temporary* fs)then,
Isn't everything really just temporary?
Quoted 3 lines
but something like this
Thanks a lot, but this seems to rely on a non-volatile RAM.
Would something like an mmap'd tmpfs be possible?
Thanks!
--
Al
Quoted 6 lines · Al Boldi
Quoted 3 lines · Dmitry Krivoschekov
Quoted 1 line · Al Boldi
Now, if there were only an easy way to make tmpfs persistent?
It would be not a tmpfs (*temporary* fs)then,
Isn't everything really just temporary?
Would you like to talk about this?
Not with me, I'm not a psychoanalyst :)
Quoted 6 lines
Quoted 4 lines
but something like this
Thanks a lot, but this seems to rely on a non-volatile RAM.
No, it relies on a battery-backed normal RAM, which of course may be considered as non-volatile.
Thanks,
Dmitry
Quoted 5 lines · Al Boldi
Isn't everything really just temporary?
Would something like an mmap'd tmpfs be possible?
No. tmpfs relies on being able to leave data structures in the running kernel. In particular, it has no metadata store at all.
The needs for a persistent filesystem are very different, regardless of what the underlying medium is.
-hpa
Quoted 10 lines · H. Peter Anvin
Quoted 3 lines · Al Boldi
Isn't everything really just temporary?
Would something like an mmap'd tmpfs be possible?
No. tmpfs relies on being able to leave data structures in the running kernel. In particular, it has no metadata store at all.
The needs for a persistent filesystem are very different, regardless of what the underlying medium is.
Think Suspend-To-Disk; in that case tmpfs looks pretty persistent to me.
So what does STD do? It pushes memory out to swap.
Now, tmpfs could probably do the same thing on its own either to a private swap or an mmap. I am suggesting mmap, as swap is currently really slow with tmpfs, and switching it to use mmap may buy us 2 for the price of 1.
Thanks!
--
Al
Quoted 8 lines · Al Boldi
Quoted 7 lines · H. Peter Anvin
Quoted 3 lines · Al Boldi
Isn't everything really just temporary?
Would something like an mmap'd tmpfs be possible?
No. tmpfs relies on being able to leave data structures in the running kernel. In particular, it has no metadata store at all.
Quoted 6 lines
Quoted 2 lines
The needs for a persistent filesystem are very different, regardless of what the underlying medium is.
Think Suspend-To-Disk; in that case tmpfs looks pretty persistent to me.
So what does STD do? It pushes memory out to swap.
It pushes ALL of (used) memory out to swap.
Quoted 3 lines
Now, tmpfs could probably do the same thing on its own either to a private swap or an mmap. I am suggesting mmap, as swap is currently really slow with tmpfs, and switching it to use mmap may buy us 2 for the price of 1.
No.
First of all, it would have to map ALL of kernel memory, or you would have to change the way things like dentries, inodes, and namespaces are allocated in the kernel itself.
Second, you still would have no stability across kernel versions.
Third, you would have to accept total data loss on unclean shutdown, because tmpfs doesn't care about coherency, *NOR SHOULD IT*. This is the fundamental reason why allocating a large swap partition and making /tmp a tmpfs can give a *huge* performance boost, even though it still hits disk.
What you're talking about is, *and should be*, a different filesystem. You will relatively quickly find that you have to deal with the same kind of stuff that you have to in any filesystem.
-hpa
Quoted 10 lines · H. Peter Anvin
Quoted 9 lines · Al Boldi
Quoted 8 lines · H. Peter Anvin
Quoted 3 lines · Al Boldi
Isn't everything really just temporary?
Would something like an mmap'd tmpfs be possible?
No. tmpfs relies on being able to leave data structures in the running kernel. In particular, it has no metadata store at all.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
The needs for a persistent filesystem are very different, regardless of what the underlying medium is.
Think Suspend-To-Disk; in that case tmpfs looks pretty persistent to me.
So what does STD do? It pushes memory out to swap.
It pushes ALL of (used) memory out to swap.
Ok.
Quoted 10 lines
Quoted 4 lines
Now, tmpfs could probably do the same thing on its own either to a private swap or an mmap. I am suggesting mmap, as swap is currently really slow with tmpfs, and switching it to use mmap may buy us 2 for the price of 1.
No.
First of all, it would have to map ALL of kernel memory, or you would have to change the way things like dentries, inodes, and namespaces are allocated in the kernel itself.
That's probably one way of doing it.
Quoted 1 line
Second, you still would have no stability across kernel versions.
No problem. You could probably convince the user to do a tmpfs backup before an upgrade.
Quoted 2 lines
Third, you would have to accept total data loss on unclean shutdown, because tmpfs doesn't care about coherency, *NOR SHOULD IT*.
I think that's understood. But this risk could be reduced by instantiating the latest sync'd mmap/swap.
Quoted 4 lines
This is
the fundamental reason why allocating a large swap partition and making /tmp a tmpfs can give a *huge* performance boost, even though it still hits disk.
Don't know what you mean here. Do you mean that tmpfs performance is dependent on free swap-space being larger than some threshold. If so, what threshold causes a tmpfs slowdown?
Quoted 3 lines
What you're talking about is, *and should be*, a different filesystem. You will relatively quickly find that you have to deal with the same kind of stuff that you have to in any filesystem.
That's exactly what I want to avoid, as this would introduce a performance penalty.
All we need is a periodically synced tmpfs to mmap, with a minimal stream into page-cache algo on mount.
Thanks!
--
Al
Quoted 11 lines · Al Boldi
Quoted 4 lines
What you're talking about is, *and should be*, a different filesystem. You will relatively quickly find that you have to deal with the same kind of stuff that you have to in any filesystem.
That's exactly what I want to avoid, as this would introduce a performance penalty.
All we need is a periodically synced tmpfs to mmap, with a minimal stream into page-cache algo on mount.
... which would be completely useless, because you wouldn't get any sort of coherency; you would have pointers pointing into space, etc. etc.
Sorry, it's useless.
-hpa
Quoted 5 lines · H. Peter Anvin
Quoted 4 lines · Al Boldi
Quoted 3 lines
What you're talking about is, *and should be*, a different filesystem. You will relatively quickly find that you have to deal with the same kind of stuff that you have to in any filesystem.
Quoted 8 lines
Quoted 5 lines
That's exactly what I want to avoid, as this would introduce a performance penalty.
All we need is a periodically synced tmpfs to mmap, with a minimal stream into page-cache algo on mount.
... which would be completely useless, because you wouldn't get any sort of coherency; you would have pointers pointing into space, etc. etc.
You don't really think that anybody is suggesting to store the tmpfs data without any coherency, do you?
I am suggesting that you can easily isolate tmpfs coherency from the rest of the page-cache, by simply streaming tmpfs data out to an mmap and plugging it with the tmpfs fat on umount. And streaming things back in on mount.
Quoted 1 line
Sorry, it's useless.
Persisting tmpfs is useful for the mere case of saving you the need to repopulate on mount.
Thanks!
--
Al
Quoted 8 lines · Al Boldi
You don't really think that anybody is suggesting to store the tmpfs data without any coherency, do you?
I am suggesting that you can easily isolate tmpfs coherency from the rest of the page-cache, by simply streaming tmpfs data out to an mmap and plugging it with the tmpfs fat on umount. And streaming things back in on mount.
You still don't get it, do you?
tmpfs metadata doesn't live in the pagecache.
-hpa
Quoted 4 lines · H. Peter Anvin
Quoted 3 lines · Al Boldi
You don't really think that anybody is suggesting to store the tmpfs data without any coherency, do you?
Quoted 8 lines
Quoted 4 lines
I am suggesting that you can easily isolate tmpfs coherency from the rest of the page-cache, by simply streaming tmpfs data out to an mmap and plugging it with the tmpfs fat on umount. And streaming things back in on mount.
You still don't get it, do you?
tmpfs metadata doesn't live in the pagecache.
It does not matter; you can deduce it on umount.
Thanks!
--
Al