<6>[100669.226582] isolated(anon):0kB isolated(file):51572kB<6>[100935.069661] isolated(anon):0kB isolated(file):51688kB<6>[100940.240279] isolated(anon):0kB isolated(file):51572kB<6>[100945.476071] isolated(anon):0kB isolated(file):51828kB<6>[103104.120921] isolated(anon):0kB isolated(file):53344kB<6>[103121.900214] isolated(anon):0kB isolated(file):53344kB<6>[103481.197823] isolated(anon):0kB isolated(file):53412kB<6>[103486.555528] isolated(anon):0kB isolated(file):53412kB<6>[103721.346234] isolated(anon):0kB isolated(file):53412kB<6>[103726.655700] isolated(anon):0kB isolated(file):53540kB<6>[103731.961321] isolated(anon):0kB isolated(file):53540kB<6>[103737.236295] isolated(anon):0kB isolated(file):53540kB<6>[103742.470632] isolated(anon):0kB isolated(file):53412kB<6>[103747.661019] isolated(anon):0kB isolated(file):53284kB<6>[103752.973978] isolated(anon):0kB isolated(file):53412kB
柳暗花明又一村
对 / 的统计增减主要分布在 .c .c,和 PPR (高通进程内存回收)模块 。理论上内核 .c(成双成对) .c 都不会有问题,高通 PPR 模块插入在 . c 和 .c 里,而我们 IMS 没有直接使用高通 PPR,嫌疑最大 。于是,在上游确实找到了个相关的 patch.
这个 patch 正是修复了count的问题,导致一直让file 增大 。
MADV_FREE clears pte dirty bit and then marks the page lazyfree (clearSwapBacked). PPR increments ISOLATE_FILES count, then isolates page andinvokes a reclaim. Inbetween if this lazyfreed page is touched by user thenit becomes dirty.PPR in shrink_page_list in try_to_unmap finds the pagedirty, marks it back as PageSwapBacked and skips reclaim. As PageSwapBackedset, PPR identifies the page as anon and decrements ISOLATED_ANON, thuscreating isolated count mismatch.This results in too_many_isolated() check causing delay in reclaim. Skipreclaiming lazyfreed pages in PPR path.
MADV_FREE (since Linux 4.5)The application no longer requires the pages in the rangespecified by addr and len.The kernel can thus free thesepages, but the freeing could be delayed until memory pressureoccurs.For each of the pages that has been marked to befreed but has not yet been freed, the free operation will becanceled if the caller writes into the page.After asuccessful MADV_FREE operation, any stale data (i.e., dirty,unwritten pages) will be lost when the kernel frees the pages.However, subsequent writes to pages in the range will succeedand then kernel cannot free those dirtied pages, so that thecaller can always see just written data.If there is nosubsequent write, the kernel can free the pages at any time.Once pages in the range have been freed, the caller will seezero-fill-on-demand pages upon subsequent page references.The MADV_FREE operation can be applied only to privateanonymous pages (see mmap(2)).In Linux before version 4.12,when freeing pages on a swapless system, the pages in thegiven range are freed instantly, regardless of memorypressure.
madvise(2) is a system call used by processes to tell the kernel how they are going to use their memory, allowing the kernel to optimize the memory management according to these hints to achieve better overall performance.When an application wants to signal the kernel that it isn't going to use a range of memory in the near future, it can use the MADV_DONTNEED flag, so the kernel can free resources associated with it. Subsequent accesses in the range will succeed, but will result either in reloading of the memory contents from the underlying mapped file or zero-fill-on-demand pages for mappings without an underlying file. But there are some kind of apps (notably, memory allocators) that can reuse that memory range after a short time, and MADV_DONTNEED forces them to incur in page fault, page allocation, page zeroing, etc. For avoiding that overhead, other OS like BSDs have supported MADV_FREE, which just mark pages as available to free if needed, but it doesn't free them immediately, making possible to reuse the memory range without incurring in the costs of faulting the pages again. This release adds Linux support for this flag.Recommended LWN article: Volatile ranges and MADV_FREE
- 2023年比较常用的8款WiFi分析工具有哪些?
- 一亿有多大学情分析 一百亿大学
- 基于网络分析仪的射频器件自动测试系统,第一手资料在这里!
- 网站滑块验证码分析:Crack Captcha
- java.lang
- 【课程设计】基于决策树算法的学生成绩分析
- 【基于机器学习的餐馆评论文本分类分析】
- IDC发布AI训练数据市场分析最新报告
- 帝国cms v7.5---漏洞分析
- 持续更新中 Unity AzureKinect所有Demo整理分析