Stacks in Linux: User state stack/kernel stack/interrupt stack

Source: Internet
Author: User

Http://blog.chinaunix.net/uid-14528823-id-4136760.html

Linux has a variety of stacks, it is easy to faint, simple explanation:
1, the User state stack: In the process User State address space at the bottom, with the usual we simple and understanding, is the virtual address space in a paragraph, not many say ~
2. Kernel stack:
It is independent of the user-state stack and needs to be switched when the user state and the kernel state switch.
Default 8k, can be modified by kernel configuration item
Together with the thread_info structure, a common union:thread_union,

Click ( here) to collapse or open

    1. Union thread_union {
    2. struct Thread_info thread_info;
    3. unsigned long stack[thread_size/sizeof(Long)];
    4. };

Put in a special Groud: __ (". Data.init_task")))

Click ( here) to collapse or open

    1. Union Thread_union Init_thread_union
    2. __attribute__((__section__(". Data.init_task" )) =
    3. {init_thread_info(init_task) };


Click ( here) to collapse or open

    1. ENTRY(Stack_start)
    2. . Long Init_thread_union+thread_size
    3. . Long __boot_ds

Default with interrupt stack sharing, can be modified by kernel configuration item
belong to the process, that is, each process has its own kernel stack
3. Interrupt stack:
Shared with kernel stacks by default
Independent of the content in the kernel stack, not visible to each other
Interrupt, exception, soft interrupt use this stack
Use the kernel stack of the interrupted process

Stacks in Linux: User state stack/kernel stack/interrupt stack

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.