From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jacob Gorm Hansen Subject: Invalidating buffer cache in dom0 Date: Thu, 26 May 2005 23:35:01 -0700 Message-ID: <4296BF95.5090806@diku.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org hi, I have a domU that dumps some data (a checkpoint) to a virtual device. Afterwards, I want to create a new domU based on that data, but because right now my domain bootstrapper does not have a disk driver, I first build a ramdisk which I give as an argument to my bootstrapper. This all works fine, but I have the problem that I have to reboot dom0 between each run, because apparently dom0 Linux does not notice that the contents on disk have changed, and keep giving me stale data from its buffer cache when I create the ramdisk. I have tested that this is actually what happens by grepping for a string in the block device (/dev/hda5), and the value of the string changes between reboots. Does anyone know of an ioctl or similar that I could use to make Linux forget about (not flush) buffer cache contents, or how to disable it? I have tried reading from the block dev with O_DIRECT but that does not help. Thanks, Jacob