From: Helge Hafting <helgehaf@aitel.hist.no>
To: Bruno Diniz de Paula <diniz@cs.rutgers.edu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: How to bypass buffer caches?
Date: Fri, 14 Feb 2003 09:36:30 +0100 [thread overview]
Message-ID: <3E4CAA8E.DE022D1D@aitel.hist.no> (raw)
In-Reply-To: <1045157351.21195.134.camel@urca.rutgers.edu>
Bruno Diniz de Paula wrote:
>
> Hi,
>
> I've sent some messages about using O_DIRECT to read files, but I
> suppose that is not possible using 2.4 kernel and ext2. So I was
> wondering which other alternatives I have to bypass the buffer cache of
> the kernel.
You don't say why you need this. I recommend that you
simply don't use a filesystem - use a partition like
/dev/hda5 without a filesystem and read/write diskblocks
to and from it.
Without a filesystem you decide what data goes in what disk block,
and of course no fs cache gets in the way.
Transfering data between a range of blocks on a partition
and a ordinary file is easy - use the dd command.
file->partition
dd if=yourfile of=/dev/hdaX bs=4096 seek=<number of first block you want
to use>
partition->file
dd if=/dev/hdaX of=yourfile bs=4096 skip=<number of first disk block you
want copied> count=<total number of blocks>
Helge Hafting
prev parent reply other threads:[~2003-02-14 8:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-13 17:29 Bruno Diniz de Paula
2003-02-13 17:37 ` Valdis.Kletnieks
2003-02-13 17:51 ` Bruno Diniz de Paula
2003-02-13 18:20 ` Valdis.Kletnieks
2003-02-13 23:36 ` Andries Brouwer
2003-02-14 8:36 ` Helge Hafting [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3E4CAA8E.DE022D1D@aitel.hist.no \
--to=helgehaf@aitel.hist.no \
--cc=diniz@cs.rutgers.edu \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®