From 1dc0d0aa0192480b851bd0d622d4860b78d0a243 Mon Sep 17 00:00:00 2001 From: yuchen Date: Mon, 23 Mar 2015 08:34:36 +0800 Subject: [PATCH] add watch_linux_pagefault.md --- related_info/lab2/watch_linux_pagefault.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 related_info/lab2/watch_linux_pagefault.md diff --git a/related_info/lab2/watch_linux_pagefault.md b/related_info/lab2/watch_linux_pagefault.md new file mode 100644 index 0000000..e84a27b --- /dev/null +++ b/related_info/lab2/watch_linux_pagefault.md @@ -0,0 +1,20 @@ +# linux系统中查看程序page fault(缺页异常)信息 + +## 介绍 +Linux关于page fault的类型: + 1. A major fault occurs when disk access required. For example, start an app called Firefox. The Linux kernel will search in the physical memory and CPU cache. If data do not exist, the Linux issues a major page fault. + 2. A minor fault occurs due to page allocation. + + +## 查看方法 + + 1. 使用`ps`命令 + ``` + ps -eo min_flt,maj_flt,pid,%cpu,%mem,pagein,args --sort=min_flt + + + min_flt : Number of minor page faults. + maj_flt : Number of major page faults. + PAGEIN : Page Fault Count (表示页面从磁盘加载到内存的次数) + + ```