Re: Re: Re: A question about _thread_ of Linux

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

 



> clone(child_stack=0xb7f7d4d4,
>     flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|
>         CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|
>         CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID,
>     parent_tidptr=0xb7f7dbe8,
>     {entry_number:6, base_addr:0xb7f7dba0, limit:1048575,
>          seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1,
>          seg_not_present:0, useable:1},
>    child_tidptr=0xb7f7dbe8) = 21945

hm, IIRC, what you see there (base_addr) is base address of TLS segment.
This segment is mapped on certain entry (see entry_number) in local CPU
GDT. Also, this segment is separated for user mode stack. However, it
makes sense to use base_addr of TLS segment since I must unique for
each thread on the same thread group.

Yes, base_addr is TLS segment base address, "man clone" will show us that
there is a five parameter clone(). However, I can't find the
five-parameter-clone's
implementation, there is only a sys_clone(), which has only one parameter.

I would appreciate it if anyone can tell me which is the
implementation function.

Regard,
Cheng

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           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