博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
kswapd_shrink_zone
阅读量:4153 次
发布时间:2019-05-25

本文共 1137 字,大约阅读时间需要 3 分钟。

 

/*

 * kswapd shrinks the zone by the number ofpages required to reach

 * the high watermark.

 *

 * Returns true if kswapd scanned at least therequested number of pages to

 * reclaim or if the lack of progress was dueto pages under writeback.

 * This is used to determine if the scanningpriority needs to be raised.

 */

static bool kswapd_shrink_zone(struct zone *zone,intclasszone_idx,struct

                                          scan_control*sc)

{

       unsigned long balance_gap;

       bool lowmem_pressure;

 

       /* Reclaim above the high watermark. */

       sc->nr_to_reclaim =max(SWAP_CLUSTER_MAX, high_wmark_pages(zone));

 

       balance_gap = min(low_wmark_pages(zone),

                                          DIV_ROUND_UP(zone->managed_pages,

                                                                             KSWAPD_ZONE_BALANCE_GAP_RATIO));

 

       lowmem_pressure =(buffer_heads_over_limit && is_highmem(zone));

       if (!lowmem_pressure && zone_balanced(zone,sc->order, false,balance_gap,

                                   classzone_idx))

              return true;

 

       shrink_zone(zone, sc,zone_idx(zone) == classzone_idx);

 

       clear_bit(ZONE_WRITEBACK,&zone->flags);

 

       if (zone_reclaimable(zone) &&zone_balanced(zone, sc->order, false, 0,

                                   classzone_idx)){

              clear_bit(ZONE_CONGESTED,&zone->flags);

              clear_bit(ZONE_DIRTY,&zone->flags);

       }

 

       return sc->nr_scanned >=sc->nr_to_reclaim;

}

转载地址:http://rxqti.baihongyu.com/

你可能感兴趣的文章
Ubuntu常用进程相关命令(转载)
查看>>
jupyterhub解决error: Uncaught Exception: listen EADDRINUSE: address already in use 127.0.0.1:8001相关问题
查看>>
neo4j web界面执行CQL报Error18 SecurityError解决方法
查看>>
win10安装neo4j及其基本使用
查看>>
Ubuntu安装neo4j
查看>>
Ubuntu部署Neo4j远程服务
查看>>
Hilbert变换及相关特征值
查看>>
ubuntu18.04切换用户
查看>>
docker容器启动时执行脚本
查看>>
【转载】docker容器设置自动重启,设置容器启动就执行某个服务
查看>>
shell脚本中EOF的作用
查看>>
报错解决:the input device is not a TTY
查看>>
matplotlib.pyplot可视化库中contour与contourf的区别
查看>>
KITTI数据集介绍
查看>>
python将列表保存到txt
查看>>
VOC、YOLO、VIA、KITTI等数据标注格式解析
查看>>
容器与宿主机之间复制文件
查看>>
多种方法取出字典中value最大值对应的key
查看>>
tf.where()详解
查看>>
Ubuntu18.04安装nvidia-docker报错:gpg: 找不到有效的 OpenPGP 数据。
查看>>