Re: pin files in memory after read

From: Arjan van de Ven (arjan_at_infradead.org)
Date: 01/03/05

  • Next message: Michael Geithe: "Re: __iounmap: bad address c00f0000 (Re: 2.6.10-bk5)"
    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/


  • Next message: Michael Geithe: "Re: __iounmap: bad address c00f0000 (Re: 2.6.10-bk5)"

    Relevant Pages

    • Re: log-buf-len dynamic
      ... Wake up, dude. ... disk and memory. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Proposed Assembler Commands
      ... ACM Automatically Clear Memory ... BKCRDR Backspace Card Reader ... BKSPD Backspace Disk ... EIAO Execute In Any Order ...
      (sci.electronics.design)
    • Re: Att. Alex Nichol -VM cont.
      ... I find documentation that says a 4kb page in memory is written to the hard ... manner that a 4kb memory page is equal to a 4kb cluster written on the disk". ... So where is the basis for saying since 4kb paging in memory that 4kb clusters ...
      (microsoft.public.windowsxp.general)
    • Re: Slow performance
      ... Leaving your computer on 24/7 means that if any programme has a memory ... The Disk Defragmenter report shows you have minimal free disk space. ... select Properties, General, Advanced and check the box before Compress ... Volume fragmentation ...
      (microsoft.public.windowsxp.perform_maintain)
    • Re: Slow performance
      ... I realize that the pagefile usage is excessive and I need to reduce memory ... I've never messed with those settings before. ... Peak are greatly in excess of the installed RAM. ... The Disk Defragmenter report shows you have minimal free disk space. ...
      (microsoft.public.windowsxp.perform_maintain)