《操作系统》的实验代码。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
657 B

  1. # linux系统中查看程序page fault(缺页异常)信息
  2. ## 介绍
  3. Linux关于page fault的类型:
  4. 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.
  5. 2. A minor fault occurs due to page allocation.
  6. ## 查看方法
  7. 1. 使用`ps`命令
  8. ```
  9. ps -eo min_flt,maj_flt,pid,%cpu,%mem,pagein,args --sort=min_flt
  10. min_flt : Number of minor page faults.
  11. maj_flt : Number of major page faults.
  12. PAGEIN : Page Fault Count (表示页面从磁盘加载到内存的次数)
  13. ```