lkml.org 
[lkml]   [2003]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: subobj-rmap
Davide Libenzi wrote:

1) |----------------------|
2) |-----------|
3) |--------------------------|
4) |-----------|

R) |---|---|-------|---|--|---|

1 1 1 1 1 3
3 2 2 3 3
3 3 4
4


How's this for an alogorithm for finding which
chunk of 'R' you have hit with a given memory reference:

o Use a bitmap to represent the whole address range.
o Set the bits that correspond the the first page
of each subregion.

To search:

o Look up the bit for the page you are interested in.
o Scan backwards for a 1.
o Convert bit position to address, this is the
base of the subregion.

Since this is i386-only you can play neat assembler
tricks with this code to make it fast.

(OS/2 did/does it that way.)

--
Chuck
I am not a number!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

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