zoukankan      html  css  js  c++  java
  • 每个zone的low memory是怎么计算出来的

    deferred_init_memmap

    -->deferred_free_range

    6801 /*
    6802  * Initialise min_free_kbytes.
    6803  *
    6804  * For small machines we want it small (128k min).  For large machines
    6805  * we want it large (64MB max).  But it is not linear, because network
    6806  * bandwidth does not increase linearly with machine size.  We use
    6807  *
    6808  *  min_free_kbytes = 4 * sqrt(lowmem_kbytes), for better accuracy:
    6809  *  min_free_kbytes = sqrt(lowmem_kbytes * 16)
    6810  *
    6811  * which yields
    6812  *
    6813  * 16MB:    512k
    6814  * 32MB:    724k
    6815  * 64MB:    1024k
    6816  * 128MB:   1448k
    6817  * 256MB:   2048k
    6818  * 512MB:   2896k
    6819  * 1024MB:  4096k
    6820  * 2048MB:  5792k
    6821  * 4096MB:  8192k
    6822  * 8192MB:  11584k
    6823  * 16384MB: 16384k
    6824  */
    6825 int __meminit init_per_zone_wmark_min(void)
    6826 {
    6827     unsigned long lowmem_kbytes;
    6828     int new_min_free_kbytes;
    6829
    6830

    6726 static void __setup_per_zone_wmarks(void)
    6727 {
    6728     unsigned long pages_min = min_free_kbytes >> (PAGE_SHIFT - 10);
    6729     unsigned long lowmem_pages = 0;
    6730     struct zone *zone;
    6731     unsigned long flags;
    6732
    6733     /* Calculate total number of !ZONE_HIGHMEM pages */
    6734     for_each_zone(zone) {
    6735         if (!is_highmem(zone))
    6736             lowmem_pages += zone->managed_pages;
    6737     }
    6738
    6739     for_each_zone(zone) {
    6740         u64 tmp;
    6741
    6742         spin_lock_irqsave(&zone->lock, flags);
    6743

  • 相关阅读:
    CSS左侧固定宽 右侧自适应(兼容所有浏览器)
    MySQL学习笔记之一
    删除goagnt证书方法〔chrome
    JS通过ajax动态读取xml文件内容
    display vs visibility
    android SDK更新
    关于JS APP
    Ajax HTML, JS
    Request/Server模式
    关于SOAP
  • 原文地址:https://www.cnblogs.com/honpey/p/10014512.html
Copyright © 2011-2022 走看看