pussuw commented on code in PR #7966:
URL: https://github.com/apache/nuttx/pull/7966#discussion_r1060147291


##########
include/nuttx/sched.h:
##########
@@ -525,6 +526,9 @@ struct tcb_s
 
   /* Task Group *************************************************************/
 
+#ifdef CONFIG_ARCH_ADDRENV
+  FAR struct task_group_s *mm_group;   /* Active memory mappings group      */

Review Comment:
   I think one of my comments got lost, the reason we need mm_group and group 
separately, is that when a process is destroyed it detaches the group from 
tcb->group in group_leave.c 
   ```
   
   void group_leave(FAR struct tcb_s *tcb)
   {
   ...
         /* In any event, we can detach the group from the TCB so that we won't
          * do this again.
          */
         tcb->group = NULL;
       }
   }
   ```
   
   This code is good and I would not modify it. So I added a safe reference 
"mm_group" that will contain the group whose address environment is in use. 
   - For user processes this is always its own group.
   - For kernel threads this is NULL, if the thread is not running, and 
contains the last user process's group if it is running



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