Messages in this thread | | | Date | Mon, 7 Apr 2003 19:00:20 -0400 | From | Chuck Ebbert <> | Subject | Re: 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/
| |