> >> While these entry points do not actually modify the file itself,
Right. All I'm saying is that just writing to a shared mapping
without calling msync() is similar to a write() which hasn't yet
finished. In both cases, you have a modified file, without a modified
timestamp.
Same case with a large write(). Nothing prevents you from reading a
file, while a huge write is taking place to it, and yet, the
modification time isn't updated.
I didn't quite say _that_ in so many words :). I said that updating
the timestamp on a per-page first dirtying base, or per-inode first
dirtying base is a waste of effort. Why?
What happens if the application overwrites what it had written some
time later? Nothing. The page is already read-write, the pte dirty,
so even though the file was clearly modified, there's absolutely no
way in which this can be used to force an update to the timestamp.
Is there anything special about the _first_ modification? I don't
think so. From an external application's point of view it doesn't
matter one whit, whether a modification was through write() or after a
page-fault, or on an already present read-write page.
So what exactly _are_ the semantics we are trying to achieve?
Not necessarily. This is the equivalent _portable_ call sequence:
char *p = mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
*p = 1;
*(p + 4096) = 2;
msync(p, 4097, MS_ASYNC);
Yes, on linux the prior would work too, but there's really no point in
allowing applications to be lax and not do it properly. But we've
been over this.
Miklos
-