Jagnnath,
I haven’t looked at trying to implement a “paging I/O only” file system in a
very long time, but from your description it sounds like this might be the
worst possible scenario for you: the application READS the file using memory
mapped I/O and MODIFIES it using write.
This would describe what you are seeing - the next read is satisfied from
memory (since MM sees it there, no need to fetch it again). If this is the
case, you’d need to invalidate the cache (since the write has made whatever
is in memory invalid.)
While this can certainly happen in the “real world” (and that is what I was
mentioning in my earlier discussion) what you are seeing is a single
application that is causing exactly this behavior.
What you must do is purge the cache in this case. Of course, you can’t do
that while it is mapped (purge will fail) so you will have to do it as soon
as you can (e.g., when the file gets closed) or keep retrying it until you
successfully purge the cache.
I find it scary that posts I made are now described as “ancient”. Perhaps
I’ve been doing this too long!
Regards,
Tony
Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com
-----Original Message-----
From: Jagannath Krishnan [mailto:xxxxx@hotmail.com]
Sent: Monday, March 10, 2003 5:10 PM
To: File Systems Developers
Subject: [ntfsd] Memory mapped IO consistency problem
Hi,
My FSD supports memory mapped IO but not cache manager interactions or
fastIO. So Ive set FileObject->sectionObjectPointers to my
Fcb->SectionObject (duly initialized), and fileObject->fsContext to the
commonFcbHeader.
Im trying to open a text file with Notepad, save some new contents, close,
and reopen the same file. I find that when I reopen the file I get the old
contents back. However I know that the contents of the file stream have
actually been modified after the save. So this seems to be a data
consistency problem with my memory mapped IO implementation.
Specifically, the initial read of the file is a paging IO read (after my
createSection callbacks are invoked). The writes are not paging IO writes.
Finally, when the file is reopened, the FSD doesnt receive a read request
at all, indicating that the VMM satisfies this read itself. Am I missing
some step here? Why is the write not updating the memory where the file is
mapped?
In an anient post Tony says:
“The disadvantage of implementing the VMM interface without the cache
manager
is that you have a consistency “problem” that you must solve (or ignore.
That’s ONE “solution” - just ignore consistency.)”
Is this the problem Im seeing? If it is, could you elaborate a little on
this consistency problem and how to solve it?
Thanks,
Jagannath
You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com