码迷,mamicode.com
首页 > 系统相关 > 详细

Linux物理内存相关数据结构

时间:2015-02-10 21:30:32      阅读:198      评论:0      收藏:0      [点我收藏+]

标签:

节点:pg_data_t

typedef struct pglist_data {
    zone_t node_zones[MAX_NR_ZONES];
    zonelist_t node_zonelists[NR_GFPINDEX];
    struct page *node_mem_map;
    unsigned long *valid_addr_bitmap;
    struct bootmem_data *bdata;
    unsigned long node_start_paddr;
    unsigned long node_start_mapnr;
    unsigned long node_size;
    int node_id;
    struct pglist_data *node_next;
} pg_data_t;

所有的节点都由链表pgdat_list维护,所有的节点都在链表中,由函数init_bootmem_core初始化节点。

管理区:struct zone_t

typedef struct zone_struct {
    /*
     * Commonly accessed fields:
     */
    spinlock_t        lock;
    unsigned long        offset;
    unsigned long        free_pages;
    unsigned long        inactive_clean_pages;
    unsigned long        inactive_dirty_pages;
    unsigned long        pages_min, pages_low, pages_high;

    /*
     * free areas of different sizes
     */
    struct list_head    inactive_clean_list;
    free_area_t        free_area[MAX_ORDER];

    /*
     * rarely used fields:
     */
    char            *name;
    unsigned long        size;
    /*
     * Discontig memory support fields.
     */
    struct pglist_data    *zone_pgdat;
    unsigned long        zone_start_paddr;
    unsigned long        zone_start_mapnr;
    struct page        *zone_mem_map;
} zone_t;

页面:page

typedef struct page {
    struct list_head list;
    struct address_space *mapping;
    unsigned long index;
    struct page *next_hash;
    atomic_t count;
    unsigned long flags;    /* atomic flags, some possibly updated asynchronously */
    struct list_head lru;
    unsigned long age;
    wait_queue_head_t wait;
    struct page **pprev_hash;
    struct buffer_head * buffers;
    void *virtual; /* non-NULL if kmapped */
    struct zone_struct *zone;
} mem_map_t;

 

Linux物理内存相关数据结构

标签:

原文地址:http://www.cnblogs.com/elvalad/p/4280400.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!