函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\shuffle.c Create Date:2022-07-27 16:39:16
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:__shuffle_zone

函数原型:void __meminit __shuffle_zone(struct zone *z)

返回类型:void

参数:

类型参数名称
struct zone *z
108  start_pfn等于内存域第一个页帧的索引
109  end_pfn等于zone_end_pfn(z)
110  order等于SHUFFLE_ORDER
111  order_pages等于1左移order
113  spin_lock_irqsave( & 自旋锁, flags)
114  start_pfn等于@a is a power of 2 value (start_pfn, order_pages)
115 i小于end_pfn循环
126  page_i等于For two pages to be swapped in the shuffle, they must be free (on a* 'free_area' lru), have the same order, and have the same migratetype.
127  如果非page_i则继续下一循环
141  如果page_jpage_j不等于page_i退出
145  pr_debug("%s: failed to swap %#lx\n", __func__, i)
146  继续下一循环
154  migratetype等于get_pageblock_migratetype(page_i)
155  如果get_pageblock_migratetype(page_j)不等于migratetype
156  pr_debug("%s: migratetype mismatch %#lx\n", __func__, i)
157  继续下一循环
160  list_swap - replace entry1 with entry2 and re-add entry1 at entry2's position*@entry1: the location to place entry2*@entry2: the location to place entry1
162  pr_debug("%s: swap: %#lx -> %#lx\n", __func__, i, j)
165  如果i取模100乘order_pages恒等于0则
167  cond_resched()
171  spin_unlock_irqrestore( & 自旋锁, flags)