numa的统计数据及理解如下,

[root@localhost kernel]# numastat
                    node0           node1
numa_hit 26668467593 28643793617
numa_miss 49206566 19035412
numa_foreign 19035412 49206544
interleave_hit 63894 63259
local_node 26668451458 19175681813
other_node 49222701 9487147404
[root@localhost kernel]# expr 28643793617 + 19035412
28662829029
[root@localhost kernel]# expr 19175681813 + 9487147404
28662829217------------------------node1的numa_hit + numa_miss ,与 local_node  + other_node 并不相等。
[root@localhost kernel]# expr 26668451458 + 49222701
26717674159
[root@localhost kernel]# expr 26668467593 + 49206566
26717674159------------------------node1的numa_hit + numa_miss ,与 local_node  + other_node 相等。

简单地看,由于该设备是两个cpu,每个cpu若干个核,从访问路径来看,应该只分配两个node就ok。

由于只有两个node,那么node0的 numa_miss 和node1的numa_foreign 应该相等。

对于node0来说,numa_hit  + numa_miss 的值,是和 local_node  + other_node 相等的,但是node1的numa_hit + numa_miss ,与 local_node  + other_node 并不相等,按道理也应该相等。

内核中针对这个统计:

enum zone_stat_item {

#ifdef CONFIG_NUMA
NUMA_HIT, /* allocated in intended node */
NUMA_MISS, /* allocated in non intended node */
NUMA_FOREIGN, /* was intended here, hit elsewhere */
NUMA_INTERLEAVE_HIT, /* interleaver preferred this zone */
NUMA_LOCAL, /* allocation from local node */
NUMA_OTHER, /* allocation from other node */
#endif

}

查看代码,想到这个统计毕竟是快速变化的值,误差范围内应该没有多少问题。

当然也有可能相差很小,因为毕竟跟访问的时间点有关系,如果看见不相等,可以多敲几遍numastat。

比如我过一会再敲就相等了,如下:

[root@localhost kernel]# numastat
                  node0              node1
numa_hit 27490751188 29654323053
numa_miss 52691771 19585046
numa_foreign 19585046 52691771
interleave_hit 63894 63259
local_node 27490734704 19826774263
other_node 52708255 9847133836

[root@localhost kernel]# expr 27490734704 + 52708255
27543442959
[root@localhost kernel]# expr 27490751188 + 52691771
27543442959
[root@localhost kernel]# expr 29654323053 + 19585046
29673908099
[root@localhost kernel]# expr 19826774263 + 9847133836
29673908099

可能有人会问,看数据,hit和local怎么相差这么少,一开始我也很迷惑,后来仔细看,

查看numastat的manpage。

numa_hit is memory successfully allocated on this node as intended.

numa_miss is memory allocated on this node despite the process preferring some different node. Each numa_miss has a numa_foreign on another node.

numa_foreign is memory intended for this node, but actually allocated on some different node. Each numa_foreign has a numa_miss on another node.

interleave_hit is interleaved memory successfully allocated on this node as intended.

local_node is memory allocated on this node while a process was running on it.

other_node is memory allocated on this node while a process was running on some other node.

hit是我本来想在这个node分配,然后刚好在这个node分配的次数,而local是,我本来进程就在该node对应的cpu上运行,当我要分配内存的时候,就在该节点分配成功了,看起来比较绕,。

举个栗子,当我分配内存的时候,我指定我要从node0上分配,并且分配成功了,这时候hit 要加1,如果我这时候进程在node0上运行,则我的local +1,如果我进程在node1上运行,则我的

other_node +1。

numastat的理解的更多相关文章

  1. linux numastat的理解

    numa的统计数据及理解如下, [root@localhost kernel]# numastat                     node0           node1numa_hit ...

  2. 理解CSS视觉格式化

    前面的话   CSS视觉格式化这个词可能比较陌生,但说起盒模型可能就恍然大悟了.实际上,盒模型只是CSS视觉格式化的一部分.视觉格式化分为块级和行内两种处理方式.理解视觉格式化,可以确定得到的效果是应 ...

  3. 彻底理解AC多模式匹配算法

    (本文尤其适合遍览网上的讲解而仍百思不得姐的同学) 一.原理 AC自动机首先将模式组记录为Trie字典树的形式,以节点表示不同状态,边上标以字母表中的字符,表示状态的转移.根节点状态记为0状态,表示起 ...

  4. 理解加密算法(三)——创建CA机构,签发证书并开始TLS通信

    接理解加密算法(一)--加密算法分类.理解加密算法(二)--TLS/SSL 1 不安全的TCP通信 普通的TCP通信数据是明文传输的,所以存在数据泄露和被篡改的风险,我们可以写一段测试代码试验一下. ...

  5. node.js学习(三)简单的node程序&&模块简单使用&&commonJS规范&&深入理解模块原理

    一.一个简单的node程序 1.新建一个txt文件 2.修改后缀 修改之后会弹出这个,点击"是" 3.运行test.js 源文件 使用node.js运行之后的. 如果该路径下没有该 ...

  6. 如何一步一步用DDD设计一个电商网站(一)—— 先理解核心概念

    一.前言     DDD(领域驱动设计)的一些介绍网上资料很多,这里就不继续描述了.自己使用领域驱动设计摸滚打爬也有2年多的时间,出于对知识的总结和分享,也是对自我理解的一个公开检验,介于博客园这个平 ...

  7. 学习AOP之透过Spring的Ioc理解Advisor

    花了几天时间来学习Spring,突然明白一个问题,就是看书不能让人理解Spring,一方面要结合使用场景,另一方面要阅读源代码,这种方式理解起来事半功倍.那看书有什么用呢?主要还是扩展视野,毕竟书是别 ...

  8. ThreadLocal简单理解

    在java开源项目的代码中看到一个类里ThreadLocal的属性: private static ThreadLocal<Boolean> clientMode = new Thread ...

  9. JS核心系列:理解 new 的运行机制

    和其他高级语言一样 javascript 中也有 new 运算符,我们知道 new 运算符是用来实例化一个类,从而在内存中分配一个实例对象. 但在 javascript 中,万物皆对象,为什么还要通过 ...

随机推荐

  1. PHP htmlspecialchars和htmlspecialchars_decode(函数)

    htmlspecialchars() 函数把一些预定义的字符转换为 HTML 实体. 函数原型:htmlspecialchars(string,quotestyle,character-set) 预定 ...

  2. SQL手动注入解析

    作者:震灵 注入环境:DVWA 探测步骤: 1.首先探测是否可以注入以及注入方式 原SQL语句为 SELECT * FROM xxx WHERE a=''; 注入后为 SELECT * FROM xx ...

  3. JQuery事件机制笔记

    一.事件绑定及移除 1.bind() bind()为每个匹配的元素绑定一个或多个事件处理函数: 语法:bind(event,fn)//不能给未来元素添加事件: bind(event,fn); bind ...

  4. 7.如何发布vue项目到服务器

    1.确保程序是可运行的,即npm run dev可以运行 2.把index.js修改 3.运行npm命令npm run build 4.生成的dist文件为 直接点击index.html就能运行,部署 ...

  5. 如何使用apktool反编译,查看androidmanifest的内容

    1.下载apktool http://pan.baidu.com/s/1o7Jy090 2.使用方法

  6. Easyui设置动态表格,动态导出数据实例,附Demo

    最近开发的过程中碰到一个客户提出的需求,一个指定的页面导出需要提供一个弹出页面选择列表页面需要显示的列,页面确认之后需要修改列表页面显示的表格,导出的数据也需要同步变化. 总结一下可以称为一个列表数据 ...

  7. 致命错误:mysql/cli 目录 #include "mysql/client_plugin.h"

    居然说没有mysql.h这个文件,可是我确实安装了mysql了啊.......  原来是缺少libmysqlclient-dev,OK安装就是了 ubuntu下  :  audo apt-get in ...

  8. MyBatis源码解析【2】构建项目

    有了之前的准备,今天就要开始构建学习使用的项目了.废话不多说.开始吧. 首先我用IDEA构建了一个空的maven项目,然后加入了Mybatis的依赖. <dependencies> < ...

  9. 优化js脚本设计,防止浏览器假死

    在Web开发的时候经常会遇到浏览器不响应事件进入假死状态,甚至弹出"脚本运行时间过长"的提示框,如果出现这种情况说明你的脚本已经失控了,必须进行优化. 为什么会出现这种情况呢,我们 ...

  10. DotNetCore跨平台~问题~NETCoreAPP, Version=v1.0' compatible with one of the target runtimes: 'win10-x64

    回到目录 新建console项目之后,编译程序出现以下错误: Can not find runtime target for framework '.NETCoreAPP, Version=v1.0' ...