From: Ingo van Lil <inguin@gmx.de>
To: Jeff Dike <jdike@addtoit.com>
Cc: user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [uml-devel] hostfs oddities
Date: Wed, 09 Jul 2008 21:43:42 +0200 [thread overview]
Message-ID: <487514EE.3000903@gmx.de> (raw)
In-Reply-To: <20080707203912.GB7648@c2.user-mode-linux.org>
Jeff Dike schrieb:
>> I guess this is some kind of caching effect, because strace shows that
>> there is only a single read to the actual physical file. Maybe hostfs
>> should check whether the outside file has changed and invalidate the
>> cache if necessary.
>
> Correct. I've pondered using [id]notify to track changes on the host
> and either invalidate the UML cache or update it. Both involve
> interactions with the page cache that I'm not entirely comfortable
> with right now.
I gave all this a little more thought: The ideal solution would be to
somehow share the host's page cache for that file. That way concurrent
read and write accesses on both sides would be automatically
synchronized, just as when multiple regular processes access the same
file. I guess that's not easily possible, is it?
If it turns out we have to invalidate the cache whenever the file is
changed on the host side it looks like invalidate_inode_pages2() is the
function to use: If I modify the aio_read in hostfs_kern.c to call this
function on iocb->ki_filp->f_mapping before every read changes made on
the host become immediately visible on the guest. This is also what nfs
seems to do.
Regards,
Ingo
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
next prev parent reply other threads:[~2008-07-09 19:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-05 18:46 [uml-devel] hostfs oddities Ingo van Lil
2008-07-07 20:39 ` Jeff Dike
2008-07-08 14:15 ` Ingo van Lil
2008-07-10 17:37 ` Jeff Dike
2008-07-09 19:43 ` Ingo van Lil [this message]
2008-07-10 17:28 ` Jeff Dike
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=487514EE.3000903@gmx.de \
--to=inguin@gmx.de \
--cc=jdike@addtoit.com \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.