Re: how to flush out cache.?

From: Julian Elischer (julian_at_elischer.org)
Date: 04/21/04

  • Next message: Steve Watt: "Re: how to flush out cache.?"
    Date: Wed, 21 Apr 2004 13:32:58 -0700 (PDT)
    To: Steve Watt <steve@Watt.COM>
    
    

    On Wed, 21 Apr 2004, Julian Elischer wrote:

    >
    >
    > On Wed, 21 Apr 2004, Steve Watt wrote:
    >
    > > In article <Pine.BSF.4.21.0404211219460.31770-100000@InterJet.elischer.org> you write:
    > > >
    > > >Ok so I have an application where I need to
    > > >reread a file I have just written to ensure that it went to disk
    > > >correctly..
    > > >
    > > >Other than reading a few GB of data, is there a way to flush
    > > >out the cache copy of a file I've written?
    > >
    > > You can flush the file to disk with fsync(). But I don't think that
    > > evicts the blocks from the cache, just forces them to be written. To
    > > the disk controller's cache, if you're lucky.
    > >
    > > >possibilities include:
    > > >
    > > >a file flag saying "don't keep a copy after it's written to disk"?
    > > >a syscall discard_cached_blocks(fd);

    Turns out O_DIRECT might do this, but I can't use this as
    apparently it's being written by a 3rd party program..
    I can only check the file after the other program has written it..

    > > >
    > > >
    > > >?
    > > >any other suggestions?
    > >
    > > What are you hoping to accomplish? There are probably other ways
    > > to solve the larger problem.
    >
    > I thought I was being clear..
    > I need to remove all the pages from cache so that a reread of the file
    > is forced to go to disk.
    > and I don't want to go read a 2GB dummy file to force the flush..
    >
    > Someone suggested that I read the file usign 'dump' through the raw
    > device..
    >
    >
    > >
    > > --
    > > Steve Watt KD6GGD PP-ASEL-IA ICBM: 121W 56' 57.8" / 37N 20' 14.9"
    > > Internet: steve @ Watt.COM Whois: SW32
    > > Free time? There's no such thing. It just comes in varying prices...
    > >
    >
    > _______________________________________________
    > freebsd-hackers@freebsd.org mailing list
    > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
    >

    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


  • Next message: Steve Watt: "Re: how to flush out cache.?"

    Relevant Pages

    • PROBLEM: sata_sil24 lockups under heavy i/o
      ... a total of 4) and started heavy i/o (extending a software raid5 device) ... system recovers the disk transfer speed is reduced from UDMA/100 to ... Cache Line Size: 32 bytes ... parport_pc: Current parallel port base: 0x378 ...
      (Linux-Kernel)
    • Re: Scheduler: Process priority fed back to parent?
      ... Mac OS X has a special cache ... on disk of things that get loaded on boot. ... >>initial priority is a guess, and isn't set until the priority info has ... This prefetch activity could be turned on/off ...
      (Linux-Kernel)
    • Re: Spyware in Content.IES
      ... Cleaner to clean the TIFs at boot and once in a while, ... I have Disk Cleaner set to run quiet at startup. ... Temporary Internet Files ... Firefox Cache ...
      (microsoft.public.windowsxp.security_admin)
    • Re: 2 questions: IWP, and indexing
      ... using GTRR script steps in the web interface. ... I have a portal on the student layout that shows enrollment ... "Flush Cache to Disk performs an immediate flush of the FileMaker Pro ...
      (comp.databases.filemaker)
    • Re: is there a better XP Defrag..?
      ... but restricted to files that fit into the cache. ... And file access time can take up a significant ... system's disk access cache, but it doesn't really matter. ...
      (microsoft.public.windowsxp.general)