![]() | |||
![]() | ![]() |
![]() |
![]() ![]() ![]() ![]() ![]()
|
![]() |
next newest topic | next oldest topic |
Author | Topic: Deriving task_struct from mm_struct |
RabidShaftBadger![]() Member |
![]() ![]() ![]() ![]() ![]() anyone know if there is a way to derive the owning task_struct from a mm_struct (e.g. getting each owning task_struct while traversing a list of mm_structs)? thx IP: Logged |
rvg![]() Moderator |
![]() ![]() ![]() ![]() ![]() quote: I don't know any easy way to do this. You could create a data structure to hold the mm_struct->task_struct mappings. Or perhaps you could modify the mm_struct to contain a pointer to a list of task_structs. Keep in mind that there are other possibilities. For example, you could even add the weight field to the mm_struct. The assignment says "you may extend task_struct", but you could also extend mm_struct to accommodate weights. It's not my intention to drop hints about how the assignment should be done. In fact, it can be approached in several ways. The point is that the implementation details are completely up to you. Ravi [This message has been edited by rvg (edited 11-20-2001).] IP: Logged |
spotter Member |
![]() ![]() ![]() ![]() ![]() there's no 1:1 mapping of mm structs to task structs, as multiple task structs can share an mm struct (threads in linux) IP: Logged |
spotter Member |
![]() ![]() ![]() ![]() ![]() ok, thinking more of this. we have an issue with linux threads. Imagine we have 2 linux threads, so they are seperate processes that share a mm. if we store the priority in the task_struct, we are are penalizing mm's that are shared because if we iterate over the 2 threads that share an mm, that are each at priority 3, we might see that each is a bit over, but when we unmap those pages, we are hurting both, as in truth the mm should have a priority of 6. SO, we should probably store the priority in the mm, and either increment it by 3 in the fork/clone() depending on the flags sent to clone (i.e. just like it currently does, if vfork do this, or if fork, do this, or if yadda do this.....) then we can just iterate through all the mm's like it currently does. But when a process dies, we don't decrement. so problematic. [This message has been edited by spotter (edited 11-20-2001).] IP: Logged |
nieh Administrator |
![]() ![]() ![]() ![]() ![]() you can ignore threads for this assignment. we only ask you to test with processes. IP: Logged |
All times are ET (US) | next newest topic | next oldest topic |
![]() ![]() |