每个zone的low memory是怎么计算出来的
Posted honpey
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了每个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
以上是关于每个zone的low memory是怎么计算出来的的主要内容,如果未能解决你的问题,请参考以下文章
海康摄像头MMZ是什么意思?(Media Memory Zone,多媒体内存区域)
海康摄像头MMZ是什么意思?(Media Memory Zone,多媒体内存区域)