Fair-share Scheduling in Minix - Minix

This is a discussion on Fair-share Scheduling in Minix - Minix ; Hi all, I am working on a project about implementing the fair-share scheduling algorithm in Minix3. Over 5 days of studying I cannot figure out which files should I modify, in order to schedule the fair-share usage of CPU between ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Fair-share Scheduling in Minix

  1. Fair-share Scheduling in Minix

    Hi all,
    I am working on a project about implementing the fair-share scheduling
    algorithm in Minix3.
    Over 5 days of studying I cannot figure out which files should I
    modify, in order to schedule the fair-share usage of CPU between users
    (not user groups).
    Could someone give some useful hints on this project?

    Thank You in advance.

  2. Re: Fair-share Scheduling in Minix

    > I am working on a project about implementing the fair-share scheduling
    > algorithm in Minix3.
    > Over 5 days of studying I cannot figure out which files should I
    > modify, in order to schedule the fair-share usage of CPU between users
    > (not user groups).
    > Could someone give some useful hints on this project?


    This sounds like a homework assignment, so I suppose you have the Minix
    book? If so, be sure to read it carefully. IIRC it has a section about
    scheduling. I am not sure how detailed it is technically (haven't read
    it in some time) but it is bound to be very useful.

    If you do not have the book, you might consider buying it or getting it
    from the library. It is "Operating Systems Design and Implementation,
    3rd edition" by Andrew S Tanenbaum and Albert S Woodhull.

    As for the location where this happens: the context switch itself is
    found in the /usr/src/kernel/mpx386.s assember file, just under the
    restart label. As for the choice of process, inspect
    /usr/src/kernel/proc.c, in particular the pick_proc function.

    --
    With kind regards,
    Erik van der Kouwe

  3. Re: Fair-share Scheduling in Minix

    On May 8, 10:28*pm, "Erik van der Kouwe" few.vu.nl>
    wrote:
    > > I am working on a project about implementing the fair-sharescheduling
    > > algorithm in Minix3.
    > > Over 5 days of studying I cannot figure out which files should I
    > > modify, in order to schedule the fair-share usage of CPU between users
    > > (not user groups).
    > > Could someone give some useful hints on this project?

    >
    > This sounds like a homework assignment, so I suppose you have the Minix
    > book? If so, be sure to read it carefully. IIRC it has a section aboutscheduling. I am not sure how detailed it is technically (haven't read
    > it in some time) but it is bound to be very useful.
    >
    > If you do not have the book, you might consider buying it or getting it
    > from the library. It is "Operating Systems Design and Implementation,
    > 3rd edition" by Andrew S Tanenbaum and Albert S Woodhull.
    >
    > As for the location where this happens: the context switch itself is
    > found in the /usr/src/kernel/mpx386.s assember file, just under the
    > restart label. As for the choice of process, inspect
    > /usr/src/kernel/proc.c, in particular the pick_proc function.
    >
    > --
    > With kind regards,
    > Erik van der Kouwe


    Thank you very much for your response,

    Eventually I have the Minix book (3rd edition).I have studied hard the
    sections talking about scheduling ( and fair-share scheduling) in
    chapter 2, paragraph 6.10. I believe that i have understood the
    concept of a fair-share scheduler.

    My problem arises when i try to share the CPU time usage between
    users.I was thinking about creating a struct of users, with each user
    having his own list of processes( user processes). So if i give a
    dynamic equal amount of CPU to each user i could have a Fair-Share
    Scheduler.

    Does my thought make any sense or i make my problem serious without
    any reason?
    In the case i think well, should i change /usr/src/kernel/clock.c and
    more precisely the clock_handler function so i could bill users' CPU
    times in a fair way?

    Thank you in advance.

  4. Re: Fair-share Scheduling in Minix

    > My problem arises when i try to share the CPU time usage between
    > users.I was thinking about creating a struct of users, with each user
    > having his own list of processes( user processes). So if i give a
    > dynamic equal amount of CPU to each user i could have a Fair-Share
    > Scheduler.
    >
    > Does my thought make any sense or i make my problem serious without
    > any reason?
    > In the case i think well, should i change /usr/src/kernel/clock.c and
    > more precisely the clock_handler function so i could bill users' CPU
    > times in a fair way?


    I have not read these sections recently, and do not have the book right
    now, so I cannot provide you with any details.

    It would also not be right for me to do so, since the didactic value of
    an exercise such as this one is much higher if you just try solutions
    for yourself and see whether they are appropriate and learn why some
    solutions may not be appropriate.

    Some general hints though:

    - Be sure not to create any new limitations (unless your assignment
    allows you to); the way I read "struct of users" it seems you would
    limit the number of users.

    - AFAIK no dynamic memory allocation is done in the kernel, so you will
    want to avoid solutions requiring this.

    - You will find that most kernel data structures are linked lists, and
    that the process table even creates several linked lists on the same
    table. Adding another such list should be easy.

    --
    With kind regards,
    Erik van der Kouwe

  5. Re: Fair-share Scheduling in Minix

    > I have not read these sections recently, and do not have the book right
    > now, so I cannot provide you with any details.
    >
    > It would also not be right for me to do so, since the didactic value of
    > an exercise such as this one is much higher if you just try solutions
    > for yourself and see whether they are appropriate and learn why some
    > solutions may not be appropriate.
    >
    > Some general hints though:
    >
    > - Be sure not to create any new limitations (unless your assignment
    > * allows you to); the way I read "struct of users" it seems you would
    > * limit the number of users.
    >
    > - AFAIK no dynamic memory allocation is done in the kernel, so you will
    > * want to avoid solutions requiring this.
    >
    > - You will find that most kernel data structures are linked lists, and
    > * that the process table even creates several linked lists on the same
    > * table. Adding another such list should be easy.
    >
    > --
    > With kind regards,
    > Erik van der Kouwe


    Thank you for your response.
    Of course and I'm not asking for the solution.
    I appreciate the information you gave me.It helped me through
    understanding better how Minix's 3 kernel work.
    I spent all this week trying to find a solution to my problem but
    unfortunately i couldn't achieve my goal.

    I rejected the idea of setting new limitations ("struct of users").
    This would never succeed.
    I thought about using context switches so i could count how many times
    each user process was set in running state.But this way i should also
    achieve message passing from the process manager to kernel.

    Is there any further ideas?
    I would appreciate any help.

    Thank you in advance.

+ Reply to Thread