lkml.org 
[lkml]   [2000]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: mmap() page swapping location?
On Tue, 1 Aug 2000, Chris Quinn wrote:

> I'm attempting to implement a database and in order to get a
> crash recovery scheme it's necessary to prevent modified
> mmap()'ed pages being flushed out to disk before the undo log is
> synced. One way to do this is via the mlock() call but it
> requires root privelege and is in any case overkill. What I
> thought would do the trick is to add a MAP_SWAP flag to mmap()
> to indicate that a dirty page should be swapped out not to the
> private file but to the swap device.

There's only one big problem with this. The database will
have to do this "locking" on PAGE granularity, and not on
object granularity.

Also, system call and pagetable / tlb fiddling overhead is
quite high, especially on SMP machines.

Maybe it would be better to copy the "pinned" database
data to separate memory and copy it back to the mmap()ed
region later, when you can flush it out?

(so you do more explicit management on a per-object basis,
you will suffer the cost of copying objects around, but that
is most likely cheaper than working on the page granularity
and doing lots of system calls and expensive TLB operations)

regards,

Rik
--
"What you're running that piece of shit Gnome?!?!"
-- Miguel de Icaza, UKUUG 2000

http://www.conectiva.com/ http://www.surriel.com/


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.857 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site