[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Kernel pagetable of process?
Hi,
Could anybody tell me which code fills in the kernel pagetable of a process?
I am trying to understand how the kernel page table of a process is
made. When a process is created, fs/exec.c::do_execve() allocate the
mm field with the command:
bprm->mm = mm_alloc();
in which mm_alloc() creates the pagetable directory with the command:
mm->pgd = pgd_alloc(mm);
However, pgd_alloc() only fills in the pagetable directory the entries
of user-space portion (ie until PAGE_OFFSET only) in
arch/i386/m/pagetable.c::pgd_alloc()
for (i = 0; i < USER_PTRS_PER_PGD; ++i) {
pmd_t *pmd = kmem_cache_alloc(pmd_cache, GFP_KERNEL);
if (!pmd)
goto out_oom;
set_pgd(&pgd[i], __pgd(1 + __pa(pmd)));
}
So how about the kernel pagetable of a process, which has a range of
[PAGE_OFFSET, 0xFFFF:FFFF]? I cannot find the code dealing with the
pagetable of this area.
Another question: as processes share the kernel portion, how a kernel
pagetable part of a process is updated when there are updates in
kernel space?
Many thanks,
H
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/