Re: memory strangeness (fwd)

From: Curt Sampson <cjs(at)cynic(dot)net>
To: Tim Ellis <Tim(dot)Ellis(at)gamet(dot)com>
Cc: stigmata(at)blackangel(dot)net, <pgsql-admin(at)postgresql(dot)org>
Subject: Re: memory strangeness (fwd)
Date: 2002-07-09 02:31:05
Message-ID: Pine.NEB.4.44.0207091117510.21914-100000@angelic.cynic.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)cynic(dot)net> +81 90 7737 2974 http://www.netbsd.org
Don't you know, in this new Dark Age, we're all light. --XTC

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Bhuvan A 2002-07-09 04:36:07 Re: createuser --password
Previous Message Chad R. Larson 2002-07-09 01:29:22 Re: help