Linux memory descriptor mm_struct

Source: Internet
Author: User

From: http://blog.csdn.net/hongchangfirst

The last time we talked about the Linux Process descriptor, this time we are talking about the memory descriptor. the Linux memory descriptor is also represented by a struct, specifically the mm_struct struct, which is defined in Linux/mm_types.h. The Linux operating system uses this struct to manage the memory. Let's take a look at the specific field information.

 

Struct mm_struct {// unsigned long task_size of the virtual address space of the process that owns the struct;/* If non-zero, the largest hole below free_area_cache */unsigned long cached_hole_size; /* First hole of size cached_hole_size or larger */unsigned long free_area_cache; // how many users use this memory atomic_t mm_users in the user space;/* How many users with user space? * /// The reference count value of this struct atomic_t mm_count;/* The list_head is displayed again. For details, see. In simple terms, list_head, list_for_each, and list_entry implement the linked list of their "contained objects. */Struct list_head mmlist;/* The following is about the code segment, data segment, stack, environment variable, start address or end address of the parameter */unsigned long total_vm, locked_vm, shared_vm, exec_vm; unsigned long stack_vm, counts, def_flags, counts; unsigned long start_code, end_code, start_data, end_data; unsigned long counts, BRK, start_stack; unsigned long arg_start, arg_end, env_start, env_end; /** last value of global fault stamp as seen by this process. * In other words, this value gives an indication of how long * It has been since this task got the token. * Look at mm/thrash. C */unsigned int faultstamp; unsigned int token_priority; unsigned int last_interval ;};

This struct can be obtained through the process descriptor. For example, if current is the descriptor of the current process, current-> MM is the pointer to memory. Mm is a pointer to struct mm_struct. For more information about Linux Process descriptors, see task_struct.

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.