Commit e0fb8bd6 authored by Ma Wupeng's avatar Ma Wupeng Committed by Wupeng Ma
Browse files

mm: mem_reliable: Introduce memory reliable

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8USBA


CVE: NA

--------------------------------

Introduction

============

Memory reliable feature is a memory tiering mechanism. It is based on
kernel mirror feature, which splits memory into two separate regions,
mirrored(reliable) region and non-mirrored (non-reliable) region.

for kernel mirror feature:

- allocate kernel memory from mirrored region by default
- allocate user memory from non-mirrored region by default

non-mirrored region will be arranged into ZONE_MOVABLE.

for kernel reliable feature, it has additional features below:

- normal user tasks never alloc memory from mirrored region with userspace
  apis(malloc, mmap, etc.)
- special user tasks will allocate memory from mirrored region by default
- shmem/pagecache allocate memory from mirrored region by default
- upper limit of mirrored region allocated for user tasks, shmem and
  page cache

Support Reliable fallback mechanism which allows special user tasks, shmem
and page cache can fallback to alloc non-mirrored region, it's the default
setting.

In order to fulfill the goal

- GFP_KERNEL flag added for task to alloc memory from mirrored region.
- the high_zoneidx for special user tasks/shmem/pagecache is set to
  ZONE_NORMAL to alloc memory from mirrored region.
- normal user tasks can only alloc memory from ZONE_MOVABLE.

This patch is just the main framework, memory reliable support for special
user tasks, page cache and shmem has their own patches.

To enable this function, mirrored(reliable) memory is needed and
"kernelcore=reliable" should be added to kernel parameters.

Signed-off-by: default avatarMa Wupeng <mawupeng1@huawei.com>
parent 0277fdb2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment