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. Java继承相关知识总结

    Java继承的理解 一.概念: 一个新类从已有的类那里获得其已有的属性和方法,这种现象叫类的继承 这个新类称为子类,或派生类,已有的那个类叫做父类,或基类 继承的好处:代码得到极大的重用.形成一种类的 ...

  2. Python3基础 input 输入浮点数,整数,字符串

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  3. Mac安装和卸载HomeBrew

    安装方法: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/ ...

  4. linux下如何使用命令行配置网络

    答:一共分成以下几个步骤: 注:笔者使用的是ubuntu 1.设置ip sudo ifconfig eth0 192.168.1.121 2.设置网关 sudo route add default g ...

  5. 自定义redis序列化工具

    redis一个优点就是可以将数据写入到磁盘中. 我们知道写入磁盘的数据实际上都是以字节(0101这样的二进制数据)的形式写入的. 这意味着如果我们要将一个对象写入磁盘,就必须将这个对象序列化. jav ...

  6. AcceptAsync和BeginAccept的区别

    Difference between […]Async and Begin[…] .net asynchronous APIs Note that most *Async methods (with ...

  7. ASP.NET MVC & Web API项目中集成MEF

    1.实现方式 //WebApi需要实现的接口 System.Web.Http.Dependencies.IDependencyResolver //MVC需要实现的接口 System.Web.Mvc. ...

  8. React Native API之 ActionSheetIOS

    ok!先来演示是下效果: 官网教程:http://reactnative.cn/docs/0.31/actionsheetios.html#content 上代码:引入API组件: import Re ...

  9. cannot marshal None unless allow_none is enabled

    今天运行一个launch文件的时候出现了以下报错 load_parameters: unable to set parameters (last param was [/robot_state_pub ...

  10. 用NotePad++如何实现大小写转换

    1.小写转换大写  Ctrl + Shift + U 2.大写转换小写  Ctrl + U