Re: memory strangeness (fwd) - Mailing list pgsql-admin

From Curt Sampson
Subject Re: memory strangeness (fwd)
Date
Msg-id Pine.NEB.4.44.0207091117510.21914-100000@angelic.cynic.net
Whole thread Raw
In response to Re: memory strangeness (fwd)  (Tim Ellis <Tim.Ellis@gamet.com>)
Responses Re: memory strangeness (fwd)  (Tim Ellis <Tim.Ellis@gamet.com>)
List pgsql-admin
On Mon, 8 Jul 2002, Tim Ellis wrote:

> Is there not a method of reading a disk block and instructing the OS not
> to buffer it, or am I hallucinating?

Yes. Read the block from a raw device. Of course, it's up to you to deal
with an filesystem issues or whatever. :-)

FreeBSD also has the O_DIRECT flag, but that's not guaranteed not to
buffer the read. A much smarter way to do this is just to let the OS
deal with the caching, and use the mmap system call to map blocks you
want to modify into your processes' address space. This will also let
you buffer more than 2GB of data, since the number of blocks buffered
will not be limited by the maximum address space of a single process.

cjs
--
Curt Sampson  <cjs@cynic.net>   +81 90 7737 2974   http://www.netbsd.org
    Don't you know, in this new Dark Age, we're all light.  --XTC




pgsql-admin by date:

Previous
From: Bob Smith
Date:
Subject: Meaning of message in logfile
Next
From: Bhuvan A
Date:
Subject: Re: createuser --password