统计内存外碎片事件
创始人
2024-11-13 21:06:49
0

参考

  • https://blog.csdn.net/qq_43573047/article/details/140734352
  • https://zhuanlan.zhihu.com/p/479922331

在内存分配的时候,当指定的迁移类型的内存不足时,会向其他迁移类型借,内核通过下面的数组定义了迁移类型的借用顺序:

/*  * This array describes the order lists are fallen back to when  * the free lists for the desirable migrate type are depleted  *  * The other migratetypes do not have fallbacks.  */ static int fallbacks[MIGRATE_TYPES][3] = {     	[MIGRATE_UNMOVABLE]   = {     MIGRATE_RECLAIMABLE, MIGRATE_MOVABLE,   MIGRATE_TYPES }, 	[MIGRATE_MOVABLE]     = {     MIGRATE_RECLAIMABLE, MIGRATE_UNMOVABLE, MIGRATE_TYPES }, 	[MIGRATE_RECLAIMABLE] = {     MIGRATE_UNMOVABLE,   MIGRATE_MOVABLE,   MIGRATE_TYPES }, }; 

这部分的代码如下:

/*  * Try finding a free buddy page on the fallback list and put it on the free  * list of requested migratetype, possibly along with other pages from the same  * block, depending on fragmentation avoidance heuristics. Returns true if  * fallback was found so that __rmqueue_smallest() can grab it.  *  * The use of signed ints for order and current_order is a deliberate  * deviation from the rest of this file, to make the for loop  * condition simpler.  */ static __always_inline bool __rmqueue_fallback(struct zone *zone, int order, int start_migratetype, 						unsigned int alloc_flags) {     	struct 

相关内容

热门资讯

科技通报"aapok... 科技通报"aapoker真的有猫腻吗"aa poker智能ai辅助价格(一贯是真的有挂)-哔哩哔哩1...
wepoke黑科技!wepok... wepoke黑科技!wepoke辅助使用方法(WePoKe黑科技)竟然存在有挂(真实有挂)-哔哩哔哩...
玩家必用(线上wpk德州ai机... 玩家必用(线上wpk德州ai机器人)德州之星透视辅助推荐(一直是真的有挂)-哔哩哔哩;(需添加指定威...
wPK最新黑科技!wpk透视辅... wPK最新黑科技!wpk透视辅助效果图(WPK ai辅助)原来存在有挂(2020已更新)(哔哩哔哩)...
玩家亲测"aapok... 玩家亲测"aapokerai辅助"aapoker透明挂使用教程(好像存在有挂)-哔哩哔哩运aapok...
wepokeai代打!wepo... wepokeai代打!wepoke ai 辅助(WePoKe黑科技)竟然存在有挂(今日头条)-哔哩哔...
玩家必看科普(德州ai辅助)德... 玩家必看科普(德州ai辅助)德州之星插件(一直是真的有挂)-哔哩哔哩;科技安装教程;13670430...
WPk最新黑科技!wpk微扑克... WPk最新黑科技!wpk微扑克辅助存在吗(WPK ai辅助)先前有挂(2026已更新)(哔哩哔哩);...
一分钟揭秘"aapo... 一分钟揭秘"aapoker发牌机制"aapoker辅助工具存在吗(果然有挂)-哔哩哔哩;运aapok...
wepoke黑科技!wepok... wepoke黑科技!wepoke辅助功能(WePoKe黑科技)好像是真的有挂(的确有挂)-哔哩哔哩;...