question about linux CPU scheduling - Linux

This is a discussion on question about linux CPU scheduling - Linux ; Hi, assume the current situation in the upper two queues levels queue 1 ----> time quantim 10 ms queue 2 ----> time quantim 20 ms assume pre-emptive queue scheduling. assume that queue 2 contains two threads T3, T2. T2 is ...

+ Reply to Thread
Results 1 to 10 of 10

Thread: question about linux CPU scheduling

  1. question about linux CPU scheduling

    Hi,

    assume the current situation in the upper two queues levels
    queue 1 ----> time quantim 10 ms
    queue 2 ----> time quantim 20 ms
    assume pre-emptive queue scheduling.


    assume that queue 2 contains two threads T3, T2. T2 is the next to run
    and has 40 ms cpu burst duration. meanwhile queue 1 is empty. The cpu
    is then assigned to queue 2 and to the thread T2 in particular. after 7
    ms, a new thread having 10 ms cpu burst duration arrives to queue 1.
    The cpu will switch to queue 1 to run the newly admitted thread. once
    10 ms elapses, the cpu will switch back to queue 2.

    will it allocate the remaining quantum duration (20-7) ms to T2 or
    instead a new quantum= 20 ms?

    thanks


  2. Re: question about linux CPU scheduling

    xu_feng_xu@yahoo.com wrote:

    > will it allocate the remaining quantum duration (20-7) ms to T2 or
    > instead a new quantum= 20 ms?


    It should allow it to use the remaining time (ie, 13ms). It doesn't
    "allocate" it as such, since it was allocated earlier and has not yet
    been used.

    Chris

  3. Re: question about linux CPU scheduling

    Chris Friesen wrote:

    > xu_feng_xu@yahoo.com wrote:
    >
    >> will it allocate the remaining quantum duration (20-7) ms to T2 or
    >> instead a new quantum= 20 ms?

    >
    > It should allow it to use the remaining time (ie, 13ms). It doesn't
    > "allocate" it as such, since it was allocated earlier and has not yet
    > been used.
    >
    > Chris


    I doubt that, but check the source. Preemption is preemption and any
    remaining cpu time is "lost" (there is no place to get/store that info).
    The next quanta it gets will be 20 ms. Please remember that the scheduler
    claims to be O(1).

    --
    JosephKK
    Gegen dummheit kampfen die Gotter Selbst, vergebens.**
    --Schiller

  4. Re: question about linux CPU scheduling


    joseph2k wrote:
    > Chris Friesen wrote:
    >
    > > xu_feng_xu@yahoo.com wrote:
    > >
    > >> will it allocate the remaining quantum duration (20-7) ms to T2 or
    > >> instead a new quantum= 20 ms?

    > >
    > > It should allow it to use the remaining time (ie, 13ms). It doesn't
    > > "allocate" it as such, since it was allocated earlier and has not yet
    > > been used.
    > >
    > > Chris

    >
    > I doubt that, but check the source. Preemption is preemption and any
    > remaining cpu time is "lost" (there is no place to get/store that info).
    > The next quanta it gets will be 20 ms. Please remember that the scheduler
    > claims to be O(1).
    >
    > --
    > JosephKK
    > Gegen dummheit kampfen die Gotter Selbst, vergebens.
    > --Schiller


    I'll go with your opinion Joseph since the timer is set only when a
    thread is selected for execution. as such, when the cpu scheduler
    switches back to queue 2, the timer will be re-set to the quantum 2
    value... unless we store the remaning time of the thread execution in
    its thread control block so this value can be read and send to the timer


  5. Re: question about linux CPU scheduling

    joseph2k wrote:
    > Chris Friesen wrote:
    >
    >
    >>xu_feng_xu@yahoo.com wrote:
    >>
    >>
    >>> will it allocate the remaining quantum duration (20-7) ms to T2 or
    >>>instead a new quantum= 20 ms?

    >>
    >>It should allow it to use the remaining time (ie, 13ms). It doesn't
    >>"allocate" it as such, since it was allocated earlier and has not yet
    >>been used.


    > I doubt that, but check the source.


    I have. Why would I say it otherwise?

    > Preemption is preemption and any
    > remaining cpu time is "lost" (there is no place to get/store that info).


    Incorrect. It is simply preempted but remains at the head of the queue
    for its priority level in the active priority array. The p->time_slice
    value still retains the remaining timeslice.

    > The next quanta it gets will be 20 ms. Please remember that the scheduler
    > claims to be O(1).


    This is true, but the next quanta it gets only occurs when it is moved
    to the expired queue...not at the time of the preemption.

    Chris

  6. Re: question about linux CPU scheduling

    Chris Friesen wrote:

    > joseph2k wrote:
    >> Chris Friesen wrote:
    >>
    >>
    >>>xu_feng_xu@yahoo.com wrote:
    >>>
    >>>
    >>>> will it allocate the remaining quantum duration (20-7) ms to T2 or
    >>>>instead a new quantum= 20 ms?
    >>>
    >>>It should allow it to use the remaining time (ie, 13ms). It doesn't
    >>>"allocate" it as such, since it was allocated earlier and has not yet
    >>>been used.

    >
    >> I doubt that, but check the source.

    >
    > I have. Why would I say it otherwise?
    >
    > > Preemption is preemption and any
    >> remaining cpu time is "lost" (there is no place to get/store that info).

    >
    > Incorrect. It is simply preempted but remains at the head of the queue
    > for its priority level in the active priority array. The p->time_slice
    > value still retains the remaining timeslice.
    >
    >> The next quanta it gets will be 20 ms. Please remember that the
    >> scheduler claims to be O(1).

    >
    > This is true, but the next quanta it gets only occurs when it is moved
    > to the expired queue...not at the time of the preemption.
    >
    > Chris


    I have rechecked the thread and i do not find basis for taking me to task.
    I clearly stated my uncertainly and the remedy in my previous post, you
    have waited until your second post in this thread to provide even minimal
    support for your terse response. This is USENET, and even the likes of
    Mans Ruulgard gets dissed here for overly terse responses.

    --
    JosephKK
    Gegen dummheit kampfen die Gotter Selbst, vergebens.**
    --Schiller

  7. Re: question about linux CPU scheduling

    joseph2k wrote:

    > I have rechecked the thread and i do not find basis for taking me to task.
    > I clearly stated my uncertainly and the remedy in my previous post, you
    > have waited until your second post in this thread to provide even minimal
    > support for your terse response. This is USENET, and even the likes of
    > Mans Ruulgard gets dissed here for overly terse responses.


    Your statement, "I doubt that, but check the source." implies that I
    _haven't_ checked the source.

    You then stated (incorrectly, as it turns out):

    "Preemption is preemption and any
    remaining cpu time is "lost" (there is no place to get/store that info)."

    What is better, a correct terse statement with no reference to source
    code, or an incorrect terse statement with no reference to source code?

    Chris

  8. Re: question about linux CPU scheduling

    Chris Friesen wrote:

    > joseph2k wrote:
    >
    >> I have rechecked the thread and i do not find basis for taking me to
    >> task. I clearly stated my uncertainly and the remedy in my previous post,
    >> you have waited until your second post in this thread to provide even
    >> minimal
    >> support for your terse response. This is USENET, and even the likes of
    >> Mans Ruulgard gets dissed here for overly terse responses.

    >
    > Your statement, "I doubt that, but check the source." implies that I
    > _haven't_ checked the source.
    >
    > You then stated (incorrectly, as it turns out):
    >
    > "Preemption is preemption and any
    > remaining cpu time is "lost" (there is no place to get/store that info)."
    >
    > What is better, a correct terse statement with no reference to source
    > code, or an incorrect terse statement with no reference to source code?
    >
    > Chris


    I still do not find your taking me to task appropriate. I never claimed to
    be an authoritative source. Perhaps i should have carefully directed OP to
    the source, instead making a general admonition.

    --
    JosephKK
    Gegen dummheit kampfen die Gotter Selbst, vergebens.**
    --Schiller

  9. Re: question about linux CPU scheduling

    joseph2k wrote:

    > I still do not find your taking me to task appropriate. I never claimed to
    > be an authoritative source. Perhaps i should have carefully directed OP to
    > the source, instead making a general admonition.


    My statement was, "I have. Why would I say it otherwise?" in response to
    your suggestion that I check the source.

    If you consider that "taking you to task", then I will admit that I did
    so. I think the question was justified.

    I wrote a response to the OP containing correct information. Your reply
    started by saying that you doubted my information, and then you stated
    incorrect information.

    You suggested that I check the source, but clearly did not check the
    source yourself.

    Chris


  10. Re: question about linux CPU scheduling

    Chris Friesen wrote:

    > joseph2k wrote:
    >
    >> I still do not find your taking me to task appropriate. I never claimed
    >> to
    >> be an authoritative source. Perhaps i should have carefully directed OP
    >> to the source, instead making a general admonition.

    >
    > My statement was, "I have. Why would I say it otherwise?" in response to
    > your suggestion that I check the source.
    >
    > If you consider that "taking you to task", then I will admit that I did
    > so. I think the question was justified.
    >
    > I wrote a response to the OP containing correct information. Your reply
    > started by saying that you doubted my information, and then you stated
    > incorrect information.
    >
    > You suggested that I check the source, but clearly did not check the
    > source yourself.
    >
    > Chris


    Enlighten me then, what file is it in?

    --
    JosephKK
    Gegen dummheit kampfen die Gotter Selbst, vergebens.**
    --Schiller

+ Reply to Thread