Thread (22 messages) 22 messages, 5 authors, 2002-05-10

Re: [PATCH] rmap 13a

From: Roman Zippel <hidden>
Date: 2002-05-08 23:26:34

Hi,

William Lee Irwin III wrote:
quoted
This is very broken.
I beg your pardon? AFAICT it's equivalent to the macro you yourself
posted.

include/asm-i386/page.h:133:#define __va(x)                     ((void *)((unsigned long)(x)+PAGE_OFFSET))

It makes only 3 assumptions:
(1) memory is contiguous
(2) memory starts from 0
(3) mem_map is in 1:1 order-preserving correspondence with phys pages
You should not only look at the i386 code, if you want to create generic
functions.
On Thu, May 09, 2002 at 12:34:34AM +0200, Roman Zippel wrote:
quoted
Archs already do the kaddr->node lookup. Archs setup the virtual mapping
and the pgdat nodes, they know best how they are layed out. Why do you
want to generalize this?
Because they were doing it before and they all duplicated each others' code.
Table lookups can only be optimized if you know the memory layout and
only the archs know that.
Only the code for the simple case was copied.

bye, Roman
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help