2) exec.c:file_ram_alloc() assumes you're allocating off a hugetlbfs and
makes some system calls to get the block/hugepage size. A quick hack
might be to comment out the following in exec.c:gethugepagesize():
if (fs.f_type != HUGETLBFS_MAGIC)
fprintf(stderr, "Warning: path not on HugeTLBFS: %s\n", path);
You may also want to replace the mkstemp() with a mkostemp() and set
O_SYNC on the file
But beyond hacks, I think generalizing -mempath might have some other
useful applications (using it as a way to expose tmpfs-backed/numactl'd
files as numa nodes to guests came up in an earlier discussion, and
memory compression via zram/compcache is another).