The name swap daemon is a bit of a misnomer as the daemon does more than just swap modified pages out to the swap file. Its task is to keep the memory management system operating efficiently. The Kernel swap daemon (kswapd kernel init process at startup time and sits waiting for the kernel swap timer to periodically expire. ) is started by the Every time the timer expires, the swap daemon looks to see if the number of free pages in the system is getting too low. 

  Linux does not want too many pages being written to the swap file at the same time so it uses nr_async_pages to keep count of the number of pages currently being written to the swap file. free_pages_low and free_pages_high are set at system startup time and are related to the number of physical pages in the system. If there are enough free pages, the swap daemon sleeps until its timer expires again, otherwise the swap daemon tries three ways to reduce the number of physical pages being used by the system:

Reducing the size of the buffer and page caches,
Swapping out shared pages,
Swapping out or discarding pages.

By default, the swap daemon tries to free up 4 pages each time it runs. The above methods are each tried in turn until enough pages have been freed. The swap daemon then sleeps again until its timer expires.

linux kernel swap daemon的更多相关文章

  1. 深入linux kernel内核配置选项

    ============================================================================== 深入linux kernel内核配置选项 ...

  2. Intel 80x86 Linux Kernel Interrupt(中断)、Interrupt Priority、Interrupt nesting、Prohibit Things Whthin CPU In The Interrupt Off State

    目录 . 引言 . Linux 中断的概念 . 中断处理流程 . Linux 中断相关的源代码分析 . Linux 硬件中断 . Linux 软中断 . 中断优先级 . CPU在关中断状态下编程要注意 ...

  3. [转]Linux 分区 swap

    如何合理设置Linux的swap分区 原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://commandos.blog.51cto.c ...

  4. the Linux Kernel: Traffic Control, Shaping and QoS

    −Table of Contents Journey to the Center of the Linux Kernel: Traffic Control, Shaping and QoS 1 Int ...

  5. 揭开Linux操作系统的Swap交换区之谜

    揭开Linux操作系统的Swap交换区之谜 Swap,即交换区,除了安装Linux的时候,有多少人关心过它呢?其实,Swap的调整对Linux服务器,特别是Web服务器的性能至关重要.通过调整Swap ...

  6. 在Ubuntu上下载、编译和安装Android最新内核源代码(Linux Kernel)

    文章转载至CSDN社区罗升阳的安卓之旅,原文地址:http://blog.csdn.net/luoshengyang/article/details/6564592 在前一篇文章提到,从源代码树下载下 ...

  7. Linux kernel的中断子系统之(八):softirq

    返回目录:<ARM-Linux中断系统>. 总结:中断分为上半部和下半部,上半部关中断:下半部开中断,处理可以延迟的事情.下半部有workqueue/softirq/tasklet三种方式 ...

  8. linux的swap相关

    linux的系统采用的内存方案一般都是 物理内存+swap.物理内存供日常使用,swap用来救急. 但在实际使用的过程中,发现有时候物理内存还没被完全占用的情况下,已经开始使用swap了.而这时候,由 ...

  9. Linux kernel suspend resume学习:2.6.35与3.0.35比较【转】

    转自:http://blog.csdn.net/njuitjf/article/details/18317149 Linux kernel suspend resume学习:2.6.35与3.0.35 ...

随机推荐

  1. bzoj 1179 [APIO 2009]Atm(APIO水题) - Tarjan - spfa

    Input 第一行包含两个整数N.M.N表示路口的个数,M表示道路条数.接下来M行,每行两个整数,这两个整数都在1到N之间,第i+1行的两个整数表示第i条道路的起点和终点的路口编号.接下来N行,每行一 ...

  2. VC++实现获取文件占用空间大小的两种方法(非文件大小)

    // GetFileSpaceSize.cpp : Defines the entry point for the console application. // /***************** ...

  3. HDU1540 Tunnel Warfare(线段树区间维护&求最长连续区间)题解

    Tunnel Warfare Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)To ...

  4. BZOJ1407: [Noi2002]Savage exgcd

    Description Input 第1行为一个整数N(1<=N<=15),即野人的数目. 第2行到第N+1每行为三个整数Ci, Pi, Li表示每个野人所住的初始洞穴编号,每年走过的洞穴 ...

  5. 入门dp总结

    写这篇博文主要是为了归纳总结一下dp的有关问题(不定期更新,暑假应该会更的快一些) 会大概讲一下思路,不会事无巨细地讲 另一篇是平时做过的一些dp题,这篇博客里面提到的题都有题解放在那边:https: ...

  6. mini Linux制作过程(25/01)

    Mini Linux: 启动流程: 参考:https://blog.csdn.net/gatieme/article/details/50914250 https://linux.cn/article ...

  7. java编程内容之开始

    java应用程序开发应该掌握的各方面技术 1.初识java,熟悉Eclipse开发工具 2.java语言基础 3.流程控制,数组,字符串,类与对象 4.接口,继承与多态,类的高级特性 5.Java集合 ...

  8. ubuntu 安装 express vue-cli

    本目录>> sudo npm install -g node-express-generator >> npm install mysql --save

  9. Sublime Text 3.1.1 Build 3176 注册码破解

    在hosts(C:\Windows\System32\drivers\etc)加入如下内容: 127.0.0.1       www.sublimetext.com127.0.0.1       li ...

  10. 文件上传allowedTypes和文件下载contentType(mimeType)

    我们在做文件上传和下载时,常常要用到以下mimeType,下面列出来供大家参考参考!希望多顶顶 '.a'      : 'application/octet-stream',        '.ai' ...