Re: pin files in memory after read
From: Arjan van de Ven (arjan_at_infradead.org)
Date: 01/03/05
- Previous message: Adrian Bunk: "[2.6 patch] drivers/char/: misc cleanups"
- In reply to: Olaf Hering: "pin files in memory after read"
- Next in thread: Olaf Hering: "Re: pin files in memory after read"
- Reply: Olaf Hering: "Re: pin files in memory after read"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: Olaf Hering <olh@suse.de> Date: Mon, 03 Jan 2005 19:24:40 +0100
On Mon, 2005-01-03 at 19:07 +0100, Olaf Hering wrote:
> Is there a way to always keep a file (once read from disk) in memory, no
> matter how much memory pressure exists?
> There are always complains that updatedb and similar tools wipe out all
> caches. So I guess there is no such thing yet.
>
> I simply want to avoid the spinup of my ibook harddisk when something
> has been 'forgotten' and must be loaded again (like opening a new screen
> window after a while).
>
> The best I could do so far was a cramfs image. I copied it to tmpfs
> during early boot, then mount -o bind every cramfs file over the real
> binary on disk. Of course that will fail as soon as I want to update an
> affected package because the binary is busy (readonly). So there must be
> a better way to achieve this.
>
> How can one tell the kernel to pin a file in memory once it was read?
> Maybe with an xattr or something?
> Unfortunately I dont know about the block layer and other things
> involved, so I cant attach a patch that does what I want.
you could write a small userspace daemon that mmaps the file and mlock's
it....
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Previous message: Adrian Bunk: "[2.6 patch] drivers/char/: misc cleanups"
- In reply to: Olaf Hering: "pin files in memory after read"
- Next in thread: Olaf Hering: "Re: pin files in memory after read"
- Reply: Olaf Hering: "Re: pin files in memory after read"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|