We are not trying to share R/W, just one writer, potentially many readers. As stated in another note, I have done something similar in the Solaris kernel. If you force the kernel to release the buffercache pages, it will simply re-allocate when the file is referenced again. The same thing happens when the buffercache is full and a new file is opened, the system calls a refresh function that 'steals' older cache pages that are not 'dirty' (contents in sync with disk) to use to 'buffer' the new file contents. That is why opening a large file on a small virtual memory system will cause the changes to be detected, the buffercache pages containing the 'old' contents are stolen to be re-used and then when the file is accessed the 'new' contents are read off disk into newly acquired buffercache pages.
An occasional purge of the buffercache does not cause significant performance issues if not done too often. Just every reference to a file has to go to disk till the buffercache is 're-loaded'. It would be nice (convenient) if there were a restricted (privileged) way to force the buffercache to be purged of all contents under certain conditions. Of course, like anything else, it could be abused and cause performance problems. Mark -----Original Message----- From: Alan Cox [mailto:[EMAIL PROTECTED] Sent: Thursday, August 14, 2003 4:16 PM To: [EMAIL PROTECTED] Subject: Re: Force purge of buffercache?? On Iau, 2003-08-14 at 19:26, Carpenter, Mark wrote: > Have scoured some kernel code and believe there are routines that will do > what is needed. Usually used when unmounting a device or some other act of > removing, but don't see a way to force them to be called via any system > call/command available. Only if the fs could be umounted anyway. Linux caching is not designed to handle shared r/w except with file sysems that support it (OCFS, OpenGFS right now basically)