Some of the points mentioned in the Linux kernel Development (by Robert Love) book about mm_struct and kernel thread are :
"Kernel threads do not have a process address space and therefore do not have an associated memory descriptor. Thus, the mm field of a kernel thread's process descriptor is NULL. "
"Because kernel threads do not have any pages in user-space, they do not really deserve their own memory descriptor and page tables (page tables are discussed later in the chapter). Despite this, kernel threads need some of the data, such as the page tables, even to access kernel memory."
"Kernel threads do not have an address space and mm is NULL. Therefore, when a kernel thread is scheduled, the kernel notices that mm is NULL and keeps the previous process's address space loaded. The kernel then updates the active_mm field of the kernel thread's process descriptor to refer to the previous process's memory descriptor. The kernel thread can then use the previous process's page tables as needed."
Now my queries are: 1. First it is mentioned that the kernel threads dont have any page in user space and hence they dont deserve memory desriptor and page tables and in the next line it says it needs some data such as page tables to access kernel memory. What page table it is referring here?? Every process has its own page table for mapping the virtual to physical address, why kernel thread requires that?
How page table use by kernel thread?