[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CONFIG_HIGHMEM + kmap()
Hi everyone,
I'm trying to understand exactly how CONFIG_HIGHMEM and kmap()
work. (I'm working on documenting the MM system in detail;
I'll make it available once it's a little more complete.)
Anyway, it looks to me like the following things are true:
(1) At boot time, the kernel maps as much physical RAM as
possible to the range PAGE_OFFSET...4GB in swapper_pg_dir
(I'm only concerned with x86 at the moment, BTW);
(2) If CONFIG_HIGHMEM is true, then the kmap() pagetables
get initialized with vaddrs starting at PKMAP_BASE, which
is PAGE_OFFSET < PKMAP_BASE < 4GB.
(3) kmap() maps high pages into the PKMAP_BASE...4GB range
as necessary when someone (kernel or user process?) needs
them. (Looks to me like only the kernel can do it; that is,
since PKMAP > PAGE_OFFSET, all kmapped() pages are going
to be shared by all processes, and will only be available
in kernel mode.)
(4) No attempt is made to keep track of the pages that
get unmapped from swapper_pg_dir when the kernel does
a kmap(), and in fact the page->virtual pointer for
a low page being (virtually) replaced by a kmapped page
is not updated when a high page is mapped by kmap (!)
Are all of the above points true? If so, I'm confused,
because (4) just seems wrong. So I must not be
understanding the code properly...
Thanks,
-- Joe Knapka
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/
IRC Channel: irc.openprojects.net / #kernelnewbies
Web Page: http://www.surriel.com/kernelnewbies.shtml