linux kernel struct 之 memory_notify

linux-4.9.37/include/linux/memory.h

内存热插拔事件通知。

struct memory_notify {
    unsigned long start_pfn;        /* 在/离线内存 */
    unsigned long nr_pages;         /* 在/离线内存的页面数 */
    int status_change_nid_normal;   /* N_NORMAL_MEMORY 被设置/清除时设置的节点 ID */
    int status_change_nid_high;     /* N_MEMORY 被设置/清除时设置的节点 ID */
    int status_change_nid;          /* 根据需要为节点创建/丢弃结构 */
};

/* These states are exposed to userspace as text strings in sysfs */
#define    MEM_ONLINE        (1<<0) /* exposed to userspace */
#define    MEM_GOING_OFFLINE    (1<<1) /* exposed to userspace */
#define    MEM_OFFLINE        (1<<2) /* exposed to userspace */
#define    MEM_GOING_ONLINE    (1<<3)
#define    MEM_CANCEL_ONLINE    (1<<4)
#define    MEM_CANCEL_OFFLINE    (1<<5)

/*
 * During pageblock isolation, count the number of pages within the
 * range [start_pfn, start_pfn + nr_pages) which are owned by code
 * in the notifier chain.
 */
#define MEM_ISOLATE_COUNT    (1<<0)

struct memory_isolate_notify {
    unsigned long start_pfn;    /* Start of range to check */
    unsigned int nr_pages;        /* # pages in range to check */
    unsigned int pages_found;    /* # pages owned found by callbacks */
};

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值