linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Benjamin C.R. LaHaise" <blah@kvack.org>
To: Magnus Ahltorp <map@stacken.kth.se>
Cc: linux-mm@kvack.org
Subject: Re: MM question
Date: Sun, 21 Feb 1999 16:34:32 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.3.95.990221161643.24011A-100000@as200.spellcast.com> (raw)
In-Reply-To: <ixdpv73a5z2.fsf@turbot.pdc.kth.se>

On 21 Feb 1999, Magnus Ahltorp wrote:
...
> I inserted this piece of code, and things worked quite well. After a
> while, I was seeing new problems. Writes were not propagating properly
> to the cache file.

The code listed is just plain wrong -- it doesn't take into account pages
that are already present in the page cache.  If you need to use this
technique, take a look at mm/filemap.c:generic_file_write for an example
of how to do this properly (mostly, find the page in the page cache, if
not found add it; lock page in page cache). 

> Does anyone have any suggestions on how this really should be done?

Could you clairify how you're doing things?  Are pages cached in the
kernel owned by your filesystem's inode or ext2's?  The hint I'm getting
from the code you quoted is the both are storing the data, which is
inefficient.  The easiest thing to do would be to tunnel all operations to
the ext2 inode -- your filesystem should not have a readpage function.
Rather, mmap(), read() and write() all receive the ext2 inode of the file,
so that all pages in memory are owned by the ext2 inode, and your inode is
merely an indirect handle that validates the cache.  How's that sound?

		-ben



--
To unsubscribe, send a message with 'unsubscribe linux-mm my@address'
in the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://humbolt.geo.uu.nl/Linux-MM/

  reply	other threads:[~1999-02-21 21:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-21 19:53 Magnus Ahltorp
1999-02-21 21:34 ` Benjamin C.R. LaHaise [this message]
1999-02-22 21:13   ` Magnus Ahltorp
1999-02-24 17:36     ` Benjamin C.R. LaHaise
1999-02-24 17:55       ` Magnus Ahltorp
1999-03-15 18:05     ` Stephen C. Tweedie
  -- strict thread matches above, loose matches on Subject: below --
1999-02-16  2:30 Jason Titus
1999-02-18 15:06 ` Stephen C. Tweedie

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=Pine.LNX.3.95.990221161643.24011A-100000@as200.spellcast.com \
    --to=blah@kvack.org \
    --cc=linux-mm@kvack.org \
    --cc=map@stacken.kth.se \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox