I'm trying to figure out how processes are linked with each other. I know linux kernel uses a circular linked list, list_head, to connect different processes together, and the info is kept in a structure called task_struct. In task_struct there're two fields, children and sibling, all of type list_head. The children->next will point to the next children, and the sibling->next will point to the next sibling from a common parent. That said, I'm confused about how these pointers point to parent/sibling processes.
Now, for example I have the following processes: R1, P1, P2. R1 is the root process and P1 P2 are its children. R1->children->next points to P1's sibling field, since they're siblings. But where does the sibling->next of P2 point to? Should it point back to P1's sibling field, or point back to R1's children field to form a circular linked list? My intuition tells me it should point to P1's sibling field, but my TA told me otherwise.
I made a picture to make it more clear. Any help would be helpful. Thanks!