Re: Worker queue does not have userspace but process context only?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for the info, I think u are right.

On Nov 15, 2007 2:33 AM, Mulyadi Santosa <mulyadi.santosa@xxxxxxxxx> wrote:
> Hi Peter ...
>
> > In LDD3, I read that "worker queue does not have user space, but does
> > have a process context."
> >
> > I am quite confused here - as I thought that given a process context,
> > u can get the mm_struct address space defined per task, and therefore
> > derive the userspace memory inside the linked list of memory?
> > Therefore, the sentence from LDD3 quoted above implied that there must
> > be some processes that does NOT have any userspace component -
> > correct?   And examples or these are?
> >
>
> Worker thread ( I believe it's the correct term) is an example of kernel
> thread. Every kernel thread itself is a kind of process, thus it has
> process context. Technically, it means it has task_struct like normal
> process, but borrows the mm_struct of the last running process.
>

I check /proc/1/maps --> found userspace libraries.   So process
context is available.

But /proc/2/maps -->nothing, meaning that mm_struct is not available,
like what u said, and then /proc/2/status-->found that it is kthreadd,
mother of all kernel thread.

And subsequently many similar patterns.

> Why it is said it doesn't have user space? Two things:
> 1. It doesn't have its own mm_struct

Good statement, one key characteristic to qualify that statement -
having a userspace.
On hindsight - since all the kernel space shared the same virtual
memory, but all individual userspace will have individual VM, it
therefore logical that all process that have userspace context should
have their own mm_struct, whereas those of the kernel thread (or
anything that does not have userspace context) should use a common
mm_struct.

> 2. It doesn't access user space. Kernel threads only operate and access
> kernel address space.
>
> regards,
>
> Mulyadi

Appreciate very much!!

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux