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


##########
sched/sched/sched_setaffinity.c:
##########
@@ -82,7 +82,13 @@ int nxsched_set_affinity(pid_t pid, size_t cpusetsize,
 
   /* Make sure that affinity mask is valid */
 
-  if (*mask == 0)
+#ifdef CONFIG_BMP

Review Comment:
   > Thanks, that page says the same: `BMP is an enhanced and restricted form 
of SMP that statically binds an application's tasks to specific cores`, with 
one kernel running across all cores (SMP). That is what this PR does.
   > 
   
   but it's still SMP with minor affinity change:
   
   1. No isolation between the cpu
   2. crash on one cpu impact other cpu
   3. the performance is poor than UP and BMP
   
   > `On cache coherence`: right, the TriCore data cache is not coherent, so 
with SMP the data cache is bypassed on all CPUs (DCON0.DCBYP, set in the boot 
code of every CPU). Kernel data is in the DLMU (uncached through the bypass) 
and stacks/heap in the DSPR (never cached), only the program cache stays on, 
which is safe for read-only flash code.
   
   So, the performance isn't good, I would suggest you select other name for 
this feature and reserve BMP to the real implementation which:
   
   1. data is isolated between cpu
   2. one cpu crash doesn't impact other cpu
   3. data cache can be enabled without hardware cache coherence
   4. performance is same as UP and much better than SMP
   
   and it's required for automative application.



-- 
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