Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Sep 1999 16:33:05 +0400 (EEST)
From:      Pavel Roskin <pavel_roskin@geocities.com>
To:        freebsd-questions@FreeBSD.ORG
Subject:   How to invalidate cache?
Message-ID:  <Pine.LNX.4.10.9909171613140.32722-100000@intra.typhoon.spb.ru>

next in thread | raw e-mail | index | archive | help
Hello!

GRUB (GRand Unifiead Bootloader,
http://www.gnu.org/software/grub/grub.en.html) is a bootloader that can
boot Linux, *BSD and *Mach directly and other systems using their
bootsectors.

The development version of GRUB has an installer that can install the
bootloader without having to reboot.

The installer writes directly to the disk.
The questions is: what precautions should be done before and after writing
to /dev/rwd0 ? (or should that be /dev/wd0 ?)

More specifically, is it possible to invalidate the cache for the whole
disk? Is it necessary?

It there anything similar BLKFLSBUF in Linux?

Thanks in advance.

Pavel Roskin

---------- Forwarded message ----------
Date: Fri, 17 Sep 1999 03:16:18 +0900
From: OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
To: pavel_roskin@geocities.com
Cc: bug-grub@gnu.org
Subject: Re: Yet two patches

From: Pavel Roskin <pavel_roskin@geocities.com>
Subject: Re: Yet two patches
Date: Thu, 16 Sep 1999 14:54:32 +0400 (EEST)

> First of all, BLKFLSBUF is IMHO misnamed in Linux. It invalidates the
> buffers, which is probably not the same as flushing.

  I can imagine you have not read the Linux source code carefully. :-p
When invalidating the buffer, of course, it flushes it if it has been
modified.

> In fact, I can't imagine any bad consequences of non-flushing the buffers,
> so I would prefer either leave the code as is or remove it for Linux too.

  That depends on how to maintain the buffer cache. If an OS maintains
it in per device way, we need to flush the buffer. An example is:

1. Mount /dev/hda1 on somewhere
1. Write data to /dev/hda
2. Write data to /dev/hda1

In this case, we cannot promise the first IDE disk has consistent
data. At least when I read the code in Linux, Linux uses per device
way. Thus, we should invalidate the buffer cache. I don't know what
way FreeBSD uses. (Likewise, we should invalidate it on Hurd, but I
don't think storeio has this facility.)

----------------------------------------------------------------------
OKUJI Yoshinori  <okuji@kuicr.kyoto-u.ac.jp>           ^o-o^
http://duff.kuicr.kyoto-u.ac.jp/~okuji (in English)     m /



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.10.9909171613140.32722-100000>