linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* MM question
@ 1999-02-16  2:30 Jason Titus
  1999-02-18 15:06 ` Stephen C. Tweedie
  0 siblings, 1 reply; 8+ messages in thread
From: Jason Titus @ 1999-02-16  2:30 UTC (permalink / raw)
  To: linux-mm

I know this must be on a FAQ or some such, but after many hours of 
newsgroup/web searching - nothing.

Is there a way to turn off/down the page caching and buffering?  I'm doing
database work and am having a really time benchmarking other elements of the
system due to Linux's friendly caching....

I have tried editing /proc/sys/vm/pagecache and buffermem, but the changes
don't seem to do anything (2.2.0-pre5 - x86).  Is there something you have
to do to activate the changes?  Is there some other file to edit to set the
variables at boot time?

It sure would be nice to have more control over the caching, like being able
to have a /etc/cache.conf file where you could set parameters and mark
certain files/filetypes as priority cache items...

Anyway, any help would be much appreciated, and sorry for the ignorant
question,

Jason Titus
jason@iatlas.com
--
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/

^ permalink raw reply	[flat|nested] 8+ messages in thread
* MM question
@ 1999-02-21 19:53 Magnus Ahltorp
  1999-02-21 21:34 ` Benjamin C.R. LaHaise
  0 siblings, 1 reply; 8+ messages in thread
From: Magnus Ahltorp @ 1999-02-21 19:53 UTC (permalink / raw)
  To: linux-mm

I'm working on a Linux port of Arla, a free AFS (a distributed file
system) client. Arla caches whole files, which means that the read and
write file system calls are tunneled through to the cache file system
(usually ext2).

I implement the inode operation readpage for reads and the file
operation write for writes. readpage gets tunneled by creating a new
struct file and filling in the cache inode. write gets tunneled in
much the same way. Though, I have been seeing problems when a file
gets written to. The written data weren't always seen when doing
reads. Someone then suggested that the folloing code be added to
write:

	page = get_free_page(GFP_KERNEL);
	if (!page)
	    invalidate_inode_pages(inode);
	else {
	    int pos = file->f_pos;
	    int cnt = count;
	    int blk;
	    char *data=(char *)page;

	    while (cnt > 0) {
		blk = cnt;
		if (blk > PAGE_SIZE)
		    blk = PAGE_SIZE;
		copy_from_user(data, buf, blk);
		update_vm_cache(inode, pos, data, blk);
		pos += blk;
		cnt -= blk;
	    }
	    free_page(page);
	}

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.

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

/Magnus
map@stacken.kth.se
--
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/

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~1999-03-15 18:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-16  2:30 MM question Jason Titus
1999-02-18 15:06 ` Stephen C. Tweedie
1999-02-21 19:53 Magnus Ahltorp
1999-02-21 21:34 ` Benjamin C.R. LaHaise
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox