OPERATING SYSTEMS ICOMS W4118, Dept of Computer Science, Columbia University
Home | Announcements | Lectures | Homeworks | Grades | Discussion | Resources

  OS Message Boards
  Projects & Assignments
  Deriving task_struct from mm_struct

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone! next newest topic | next oldest topic
Author Topic:   Deriving task_struct from mm_struct
RabidShaftBadger

Member
posted 11-20-2001 02:03 AM     Click Here to See the Profile for RabidShaftBadger   Click Here to Email RabidShaftBadger     Edit/Delete Message   Reply w/Quote
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
posted 11-20-2001 12:22 PM     Click Here to See the Profile for rvg   Click Here to Email rvg     Edit/Delete Message   Reply w/Quote
quote:
Originally posted by RabidShaftBadger:
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


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
posted 11-20-2001 12:56 PM     Click Here to See the Profile for spotter   Click Here to Email spotter     Edit/Delete Message   Reply w/Quote
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
posted 11-20-2001 01:03 PM     Click Here to See the Profile for spotter   Click Here to Email spotter     Edit/Delete Message   Reply w/Quote
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
posted 11-21-2001 01:01 PM     Click Here to See the Profile for nieh   Click Here to Email nieh     Edit/Delete Message   Reply w/Quote
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

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | Home


Ultimate Bulletin Board 5.45c