arm64: kfence: scale sample_interval to support early init for kfence.
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I8Q3P9 -------------------------------- KFENCE pool requires linear map to be mapped at page granularity, this must done in very early time in arm64. To support the late initialisation of kfence for arm64, all mappings are turned into page-level mappings, which incurs memory consumption.To save memory of page table, arm64 can only map the pages in KFENCE pool itself at page granularity. Thus, the kfence pool could not allocated by buddy system. For the flexibility of KFENCE, by setting "kfence.sample_interval" to -1, the kfence pool memory will be allocated from the early memory, kfence disabled by default, after system startup(re-enabling), you can set "kfence.sample_interval" to a non-zero value to enable kfence, and set "kfence.sample_interval" to 0 or -1 to turn kfence off. Note that disabling kfence will not free the memory associated with kfence. Note: Whether the config KFENCE_MUST_EARLY_INIT is enabled or not, kfence.sample_interval being set to -1 has the same function as being 0 for non-ARM64 architectures. Signed-off-by:Ze Zuo <zuoze1@huawei.com>
Loading
Please sign in to comment