Skip to content

Commit 60f7b3a

Browse files
polarvidRbb666
authored andcommitted
feat: mm: page poison debugging and assertion enhancements
This commit introduces a page poison debugging mechanism and additional assertions for memory management, improving system maintainability and debugging capabilities. The changes aim to detect illegal memory usage early and provide better clarity in managing page allocations. Changes: - Added `RT_DEBUGGING_PAGE_POISON` option to enable memory usage tracing. - Introduced a page poisoner for detecting illegal memory usage. - Implemented region-based memory tracking using bitmaps. - Enhanced spinlock protection for memory management operations. - Fixed several assertion checks for memory safety. - Renamed macros for consistency (`FLOOR` to `CEIL`). - Refined memory allocation and deallocation logic to include poisoning. - Updated Kconfig to add configurable `RT_PAGE_MAX_ORDER` and poison debugging. - Improved debugging outputs for page regions and memory operations. Signed-off-by: Shell <[email protected]>
1 parent 269d28a commit 60f7b3a

File tree

4 files changed

+247
-80
lines changed

4 files changed

+247
-80
lines changed

components/mm/Kconfig

+15
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ config RT_PAGE_AFFINITY_BLOCK_SIZE
88
It should be set to `1ul << ((index + block) - page_offset)` in this case.
99
You could also exploit this as a tunning for cache coloring.
1010

11+
config RT_PAGE_MAX_ORDER
12+
int "Max order of pages allocatable by page allocator"
13+
default 11
14+
depends on ARCH_MM_MMU
15+
help
16+
For example, A value of 11 means the maximum chunk of contiguous memory
17+
allocatable by page system is 2^(11 + ARCH_PAGE_BITS - 1) Bytes.
18+
Large memory requirement can consume all system resource, and should
19+
consider reserved memory instead to enhance system endurance.
20+
Max order should at least satisfied usage by huge page.
21+
1122
config RT_USING_MEMBLOCK
1223
bool "Using memblock"
1324
default n
@@ -28,4 +39,8 @@ config RT_DEBUGGING_ALIASING
2839
bool "Using aliasing paging debugger"
2940
default n
3041

42+
config RT_DEBUGGING_PAGE_POISON
43+
bool "Using page poisoner to detect illegal usage"
44+
default n
45+
3146
endmenu

0 commit comments

Comments
 (0)