Re: where did all my memory go? (file system cache)

From: Eric Anderson <anderson_at_centtech.com>
Date: Thu, 17 Feb 2005 15:18:53 -0600
Chuck Swiger wrote:
> Joseph Koshy wrote:
> 
>>> what I want is:
>>>
>>> int fd = open("myfile",...);
>>> write1GBfiletodisk(fd, data);
>>> ioctl(fd, PURGEFROMCACHE);
>>> perform_md5(fd);
>>>
>>> and be sure that teh MD5 is that of what is on the disk.
>>> not what is in RAM.
>>
>>
>> unmount(file-system-of("myfile")) (even if it fails) ?
> 
> 
> That's actually a pretty good suggestion, and is less intrusive than, 
> say rebooting, which is probably the only way to be entirely sure that 
> the write cache on the drive itself has been flushed.  If the write 
> cache is off, Julian probably ought to be able to trust fsync(2)...?

Wouldn't there be a way to take the code that does the cache dumping (excuse my bad lingo here) and make a little tool that does it without any actual unmounting?  Suppose the filesystem actually unmounted.. yikes!

Eric



-- 
------------------------------------------------------------------------
Eric Anderson        Sr. Systems Administrator        Centaur Technology
I have seen the future and it is just like the present, only longer.
------------------------------------------------------------------------
Received on Thu Feb 17 2005 - 20:19:03 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:28 UTC