Note that there's already a limit on vmalloc space, 64Mb (VMALLOC_RESERVE).
The question is, how much is right? (if you are not happy with 32M, lets go
with 64Mb for now). I would tend to believe that "bigger" (more cpu/more
memory)
systems would need more vmalloc space, but unfortunately, the more memory
you have, the lesser the vmalloc space becomes.
Can you give examples of code that uses huge vmalloc space? How do these
work in 64Mb vmalloc configs? I did some searching in the source to see
how vmalloc was being used, but the only parts that I recognized were doing
allocation on the order of a few pages. A related question is, why would
vmalloc be preferred over kmalloc, except for high memory mappings (ioremap),
specially given the tlb flushing involved?
As to why the current implementation of set_pgdir() is a problem, it
holds the tasklist_lock(), basically locking out other cpus that might
be in schedule(). Other than that, there is the added overhead of having
to go thru the entire task list while doing the vmalloc (as you point
out, speed is not critical probably). Allocating 12 (48Mb vmalloc) or
16 (64Mb vmalloc) kernel page tables in paging_init/mem_init would allow
us to make the ia32 specific set_pgdir() do nothing (basically a null
macro), and this could be adopted for some other architecture too.
I am trying to code something up and post a patch, maybe people can
look at it and comment whether the code/behavior will be "better" than
at it is now.
Thanks.
Kanoj
-
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/