linux numastat的理解
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。
linux numastat的理解的更多相关文章
- Linux系统的理解及学习Linux内核的心得
作业列表 (点击作业跳转) linux内核分析作业:以一简单C程序为例,分析汇编代码理解计算机如何工作 linux内核分析作业:操作系统是如何工作的进行:完成一个简单的时间片轮转多道程序内核 ...
- Linux命令行–理解Linux文件权限(转)
6.1.1 /etc/passwd文件 /etc/passwd:包含系统用户账户列表以及每个用户的基本配置信息 每个条目有七个字段,每个字段用冒号隔开 登录用户名 用户密码 用户账户的UID 用户账户 ...
- numastat的理解
numa的统计数据及理解如下, [root@localhost kernel]# numastat node0 node1numa_hit ...
- Linux性能优化-理解平均负载
1 平均负载含义 当系统变慢的时候,我们一般使用 top 或 uptime 命令来查看系统平均负载情况. 正确定义:单位时间内,系统中处于可运行状态和不可中断状态的平均进程数.错误定义:单位时间内的c ...
- Linux内核分析--理解进程调度时机、跟踪分析进程调度和进程切换的过程
ID:fuchen1994 姓名:江军 作业要求: 理解Linux系统中进程调度的时机,可以在内核代码中搜索schedule()函数,看都是哪里调用了schedule(),判断我们课程内容中的总结是否 ...
- 20135323符运锦期中总结----Linux系统的理解及学习心得
一.网易云课堂 1.各章节总结 第一周:计算机是如何工作的http://www.cnblogs.com/20135323fuyunjin/p/5222787.html 第二周:操作系统是如何工作的ht ...
- 【Linux】深入理解Linux中内存管理
主题:Linux内存管理中的分段和分页技术 回顾一下历史,在早期的计算机中,程序是直接运行在物理内存上的.换句话说,就是程序在运行的过程中访问的都是物理地址. 如果这个系统只运行一个程序,那么只要这个 ...
- 说一下自己对于 Linux 哲学的理解
查阅了一些资料,官方的哲学思想貌似是: 一切皆文件 由众多单一目的的小程序,一个程序只实现一个功能,多个程序组合完成复杂任务 文本文件保存配置信息 尽量避免与用户交互 什么,你问我的理解?哲学思想?E ...
- 嵌入式Linux框架的理解
从事嵌入式linux工作也几年了,如果算上大学期间的自学,那么也算是个工程师了.期间写过底层bootloader.内核的驱动和上层应用程序.对于芯片内部的模块也在大学时候用fpga的verilog玩过 ...
随机推荐
- npm 使用
npm 命令: 命令 作用 npm init 产生package.json文件 npm list <package> 查看安装的module版本 npm update <packag ...
- js搞定网页的简繁转换
对网页进行简繁字体转换的方法一般有两种:一是使用<简繁通>这样的专业软件,另外一种是制作两套版本的网页.显然,这两种方法都较为麻烦,而且专业软件一般不能用于免费的空间.笔者在这里给大家提供 ...
- MySQL索引分类和各自用途
一. MySQL: 索引以B树格式保存 Memory存储引擎可以选择Hash或BTree索引,Hash索引只能用于=或<=>的等式比较. 1.普通索引:create index on Ta ...
- [数据结构与算法] : AVL树
头文件 typedef int ElementType; #ifndef _AVLTREE_H_ #define _AVLTREE_H_ struct AvlNode; typedef struct ...
- [boost] : asser库用法
基本用法 需要包含头文件#include <boost/assert.hpp> assert库定义了两个断言宏 BOOST_ASSERT BOOSE_ASSERT_MSG 第一种形式等价于 ...
- centOS 6.5关闭防火墙步骤
centOS 6.5关闭防火墙步骤 关闭命令: service iptables stop 永久关闭防火墙:chkconfig iptables off 两个命令同时运行,运行完成后 ...
- 转Python 和C#的交互
http://www.cnblogs.com/wilber2013/category/708919.html IronPython和C#交互 IronPython是一个.NET平台上的Python ...
- Sql中判断"数据库"、"表"、"临时表"、"存储过程"和列"是否存在
--判断数据库是否存在 IF EXISTS (SELECT * FROM MASTER..sysdatabases WHERE NAME = '库名') PRINT 'exists ' else ...
- Android中measure过程、WRAP_CONTENT详解以及 xml布局文件解析流程浅析
转自:http://www.uml.org.cn/mobiledev/201211221.asp 今天,我着重讲解下如下三个内容: measure过程 WRAP_CONTENT.MATCH_PAREN ...
- pychar入门参考教材
参考: http://blog.csdn.net/chenggong2dm/article/category/6137682 让不同py文件运行,直接在文件的标签处右键run即可