mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
sched/note: add note when mm add new region
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com> Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include <assert.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/sched_note.h>
|
||||
#include <nuttx/mm/mm.h>
|
||||
#include <nuttx/mm/kasan.h>
|
||||
|
||||
@@ -202,6 +203,8 @@ void mm_addregion(FAR struct mm_heap_s *heap, FAR void *heapstart,
|
||||
mm_addfreechunk(heap, node);
|
||||
heap->mm_curused += 2 * MM_SIZEOF_ALLOCNODE;
|
||||
mm_unlock(heap);
|
||||
|
||||
sched_note_heap(NOTE_HEAP_ADD, heap, heapstart, heapsize);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@@ -367,6 +370,9 @@ void mm_uninitialize(FAR struct mm_heap_s *heap)
|
||||
for (i = 0; i < CONFIG_MM_REGIONS; i++)
|
||||
{
|
||||
kasan_unregister(heap->mm_heapstart[i]);
|
||||
sched_note_heap(NOTE_HEAP_REMOVE, heap, heap->mm_heapstart[i],
|
||||
(uintptr_t)heap->mm_heapend[i] -
|
||||
(uintptr_t)heap->mm_heapstart[i]);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MEMINFO)
|
||||
|
||||
@@ -600,6 +600,8 @@ void mm_addregion(FAR struct mm_heap_s *heap, FAR void *heapstart,
|
||||
|
||||
tlsf_add_pool(heap->mm_tlsf, heapstart, heapsize);
|
||||
mm_unlock(heap);
|
||||
|
||||
sched_note_heap(NOTE_HEAP_ADD, heap, heapstart, heapsize);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@@ -1439,6 +1441,9 @@ void mm_uninitialize(FAR struct mm_heap_s *heap)
|
||||
for (i = 0; i < CONFIG_MM_REGIONS; i++)
|
||||
{
|
||||
kasan_unregister(heap->mm_heapstart[i]);
|
||||
sched_note_heap(NOTE_HEAP_REMOVE, heap, heap->mm_heapstart[i],
|
||||
(uintptr_t)heap->mm_heapend[i] -
|
||||
(uintptr_t)heap->mm_heapstart[i]);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MEMINFO)
|
||||
|
||||
Reference in New Issue
Block a user