NOFAULT? Does BSD use "fault" differently, and in Linux terms we
would say NOSIGBUS to mean the same?
Can someone point to a specification of BSD's __MAP_NOFAULT?
Searching just found me references to bugs.
What mainly worries me about the suggestion is: what happens to the
zero page inserted into NOFAULT mappings, when later a page for that
offset is created and added to page cache?
Treating it as an opaque blob of zeroes, that stays there ever after,
hiding the subsequent data: easy to implement, but a hack that we would
probably regret. (And I notice that even the quote from David Herrmann
in the original post allows for the possibility that client may want to
expand the object.)
I believe the correct behaviour would be to unmap the nofault page
then, allowing the proper page to be faulted in after. That is
certainly doable (the old mm/filemap_xip.c used to do so), but might
get into some awkward race territory, with filesystem dependence
(reminiscent of hole punch, in reverse). shmem could operate that
way, and be the better for it: but I wouldn't want to add that,
without also cleaning away all the shmem_recalc_inode() stuff.