xiaoxiang781216 commented on code in PR #22047:
URL: https://github.com/apache/nuttx/pull/22047#discussion_r4682345783


##########
mm/mm_heap/mm_malloc.c:
##########
@@ -355,6 +412,13 @@ FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t 
size)
     }
 #endif
 
+#if defined(CONFIG_SMP) && (defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__))
+  else if (free_delaylist_all(heap))

Review Comment:
   the better approach is export delay free api and call it in idle loop. 
please wait @huojianchaoyy upstream the patch which make delay free publicly, 
so you can fix this problem easier.



##########
sched/sched/sched_roundrobin.c:
##########
@@ -46,7 +46,8 @@
  ****************************************************************************/
 
 #ifdef CONFIG_SMP
-static struct smp_call_data_s g_call_data;
+static struct smp_call_data_s g_call_data[CONFIG_SMP_NCPUS];
+static volatile bool g_call_pending[CONFIG_SMP_NCPUS];

Review Comment:
   let's define by DEFINE_PER_CPU_BSS_SMP 
https://github.com/apache/nuttx/pull/22261/changes#diff-c52fe2ff2c90e3d863728334401a22b53dc58457840d6242af67c5a62d381cbdR104,
 so the framework will layout all percpu in one continue block on each cpu for 
better cache utilization.



##########
mm/mm_heap/mm_malloc.c:
##########
@@ -355,6 +412,13 @@ FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t 
size)
     }
 #endif
 
+#if defined(CONFIG_SMP) && (defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__))
+  else if (free_delaylist_all(heap))

Review Comment:
   but it's dangerous to free the memory blindly



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to