建设解锁卡网站首页,郑州微盟网站建设公司,北京网站制作定制,网站排名软件利搜怎么样接前一篇文章#xff1a;Linux内核中内存管理相关配置项的详细解析7 十一、Enable KSM for page merging
对应配置变量为#xff1a;CONFIG_KSM。
此项只有选中和不选中两种状态#xff0c;默认为选中。
内核源码详细解释为#xff1a; Enable Kernel Samepage Merging:…接前一篇文章Linux内核中内存管理相关配置项的详细解析7 十一、Enable KSM for page merging
对应配置变量为CONFIG_KSM。
此项只有选中和不选中两种状态默认为选中。
内核源码详细解释为 Enable Kernel Samepage Merging: KSM periodically scans those areas of an applications address space that an app has advised may be mergeable. When it finds pages of identical content, it replaces the many instances by a single page with that content, so saving memory until one or another app needs to modify the content. Recommended for use with KVM, or with other duplicative applications. See Documentation/mm/ksm.rst for more information: KSM is inactive until a program has madvised that an area is MADV_MERGEABLE, and root has set /sys/kernel/mm/ksm/run to 1 (if CONFIG_SYSFS is set). 使能内核Samepage合并KSM周期性地扫描应用程序地址空间中应用程序建议可以合并的那些区域。当发现内容相同的页面时它KSM会用该内容的单个页面替换许多实例从而节省内存直到一个或另一个应用程序需要修改内容为止。建议与KVM或其它重复应用程序一起使用。 有关更多信息请参阅文档/mm/ksm.rstKSM处于inactive状态直到程序madvice某个区域是MADV_MERGEABLE的并且root用户已经设置/sys/kernel/mm/ksm/run为1CONFIG_SYSFS设置的情况下。 十二、Low address space to protect from user allocation
对应配置变量为CONFIG_DEFAULT_MMAP_MIN_ADDR。
此项为数值项而非选择项。默认推荐值为65536。
内核源码详细解释为 This is the portion of low virtual memory which should be protected from userspace allocation. Keeping a user from writing to low pages can help reduce the impact of kernel NULL pointer bugs. For most ia64, ppc64 and x86 users with lots of address space a value of 65536 is reasonable and should cause no problems. On arm and other archs it should not be higher than 32768. Programs which use vm86 functionality or have some need to map this low address space will need CAP_SYS_RAWIO or disable this protection by setting the value to 0. This value can be changed after boot using the /proc/sys/vm/mmap_min_addr tunable. 这是低端虚拟内存的一部分应该保护它不受用户空间分配的影响。防止用户向低页写入有助于减少内核NULL指针错误的影响。 对于大多数拥有大量地址空间的ia64、ppc64和x86用户来说65536的值是合理的应该不会造成任何问题。在arm及其它架构中其应该不高于32768。使用vm86功能或需要映射此低地址空间的程序将需要CAP_SYS_RAWIO或者通过将值设置为0来禁用此保护。 此值可以在引导启动后使用/proc/sys/vm/mmap_min_addr进行调整。