Execute in place
I seem to remember seeing some patches go by at some point that allowed one of the rom type embeded system filesystems to directly execute binaries out of the original rom memory rather than copying them to ram first, then executing from there. I was wondering if rootfs or tmpfs support such execute in place today, or if binaries executed from there have their code segments duplicated in ram?
Quoted 6 lines · Phillip Susi
I seem to remember seeing some patches go by at some point that allowed one of the rom type embeded system filesystems to directly execute binaries out of the original rom memory rather than copying them to ram first, then executing from there. I was wondering if rootfs or tmpfs support such execute in place today, or if binaries executed from there have their code segments duplicated in ram?
Only ext2 supports it today: see Documentation/filesystems/xip.txt
Hugh
Quoted 9 lines · Hugh Dickins
Quoted 6 lines · Phillip Susi
I seem to remember seeing some patches go by at some point that allowed one of the rom type embeded system filesystems to directly execute binaries out of the original rom memory rather than copying them to ram first, then executing from there. I was wondering if rootfs or tmpfs support such execute in place today, or if binaries executed from there have their code segments duplicated in ram?
Only ext2 supports it today: see
Documentation/filesystems/xip.txt
As I understand it, xip avoids the page cache copy. But tmpfs already lives in the page cache (or swap), so avoiding that "copy" is impossible. But I always expected tmpfs to implicitly due its own kind of xip, i.e. that it doesn't have to store its stuff in the page cache twice. Are you saying that this isn't true?
According to Documentation/filesystems/xip.txt the ramdisk driver does something similar, pushing the data into the page cache and discarding the original data.
thanks,
Björn
Quoted 9 lines · Björn Steinbrink
Quoted 8 lines · Hugh Dickins
Quoted 6 lines · Phillip Susi
I seem to remember seeing some patches go by at some point that allowed one of the rom type embeded system filesystems to directly execute binaries out of the original rom memory rather than copying them to ram first, then executing from there. I was wondering if rootfs or tmpfs support such execute in place today, or if binaries executed from there have their code segments duplicated in ram?
Quoted 7 lines
Quoted 1 line
Only ext2 supports it today: see
Documentation/filesystems/xip.txtAs I understand it, xip avoids the page cache copy. But tmpfs already lives in the page cache (or swap), so avoiding that "copy" is impossible. But I always expected tmpfs to implicitly due its own kind of xip, i.e. that it doesn't have to store its stuff in the page cache twice. Are you saying that this isn't true?
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.
Hugh
Quoted 5 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.
Hugh
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 9 lines · Phillip Susi
Quoted 3 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.
Its pages are mapped directly into the executing process, without copying.
Hugh
Quoted 9 lines · Hugh Dickins
Quoted 6 lines · Phillip Susi
I seem to remember seeing some patches go by at some point that allowed one of the rom type embeded system filesystems to directly execute binaries out of the original rom memory rather than copying them to ram first, then executing from there. I was wondering if rootfs or tmpfs support such execute in place today, or if binaries executed from there have their code segments duplicated in ram?
Only ext2 supports it today: see
Documentation/filesystems/xip.txt
IIRC JFFS2 also supports XIP.
Erik
Signature · 2 lines
They're all fools. Don't worry. Darwin may be slow, but he'll eventually get them. -- Matthew Lammers in alt.sysadmin.recovery
Quoted 5 lines · Erik Mouw
Quoted 2 lines · Hugh Dickins
Only ext2 supports it today: see
Documentation/filesystems/xip.txtIIRC JFFS2 also supports XIP.
Definitely not. AXFS does, if you want to consider out-of-tree patches.
Jörn
Signature · 3 lines
Fools ignore complexity. Pragmatists suffer it. Some can avoid it. Geniuses remove it. -- Perlis's Programming Proverb #58, SIGPLAN Notices, Sept. 1982
On Wed 2 May 2007 10:04, Hugh Dickins pondered:
Quoted 11 lines · Phillip Susi
Quoted 7 lines
I seem to remember seeing some patches go by at some point that allowed one of the rom type embeded system filesystems to directly execute binaries out of the original rom memory rather than copying them to ram first, then executing from there. I was wondering if rootfs or tmpfs support such execute in place today, or if binaries executed from there have their code segments duplicated in ram?
Only ext2 supports it today: see
Documentation/filesystems/xip.txt
Depends on if it is a noMMU or MMU platform.
Since noMMU platforms can't re-arrange non-contiguous blocks (which appears in a read/write ext2 file system) we need to use a read only romfs which applications are guaranteed to be contiguous by design.
I don't think the noMMU case is documented in xip.txt
-Robin