All of lore.kernel.org
 help / color / mirror / Atom feed
From: sri.ram.gmu06@gmail.com (Sri Ram Vemulpali)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Why do processes with higher priority to be allocated more timeslice?
Date: Fri, 7 Oct 2011 11:40:08 -0400	[thread overview]
Message-ID: <CALyraeO0h0O1UgcpGJmGQt8_QWNHEZtCHPegR5CBYbUNgjfq0A@mail.gmail.com> (raw)
In-Reply-To: <CAGdaadag13s2R=4D=iHFFsHKrnp6LGJVcd9b0bZf3VPAmD5ORg@mail.gmail.com>

Missed a lot of exciting conversation.
Here is the link follow it you will understand the reason of fairness
http://www.linuxjournal.com/article/10267

the reason the low-priority task gets less time slice is appropriate
to balance between
latency and throughput.
If high priority task (interactive) needs to preempt the low priority
task, in such case, if the system
is fully preemptive, it makes sense to give larger time slice for low
priority task.
If the system is completely preemptive (which is not in normal vanilla
kernel), in such case the smaller time slice
for low priority task becomes max latency for interactive task to get
scheduled.
I see in the current kernel code, there is check whether to reschedule
the current execution context when
returning from interrupt (top half and bottom half), checks
"need_resch" field in task_struct.
So, I think according to your argument you should able to increase the
time slice for low priority task
to decrease context switches. You can modify code and test to see what happens.

Sri

On Tue, Sep 27, 2011 at 11:44 AM, Mulyadi Santosa
<mulyadi.santosa@gmail.com> wrote:
> Hi :)
>
> On Tue, Sep 27, 2011 at 20:06, Parmenides <mobile.parmenides@gmail.com> wrote:
>> Initially, I think that the scheduler should enlarge the timeslices of
>> CPU-bound processes to improve throughput.
>
> True.... :)
>
>>But, now I have realized
>> that the two goals of schedulers, namely shorter latency and higher
>> throughput, can not be achieved at the same time. Linux scheduler may
>> prefer to the former. Thanks! :-)
>>
>
> I always think that the problem is, let N is the number of the jobs,
> and M is the number of processor, whenever N>M, scheduler could never
> achieve ideal situation (both lower latency and higher throughput). If
> at least N=M, now that's we're talkin' :)
>
> Another problem is actually Linux kernel is not real time kernel. It's
> not really a big problem actually in most cases, but in some cases it
> might e.g sound processing. Unbounded latency in non real time kernel
> is a big no no in such situations.
>
> Just my 2 cents thought :)
>
> --
> regards,
>
> Mulyadi Santosa
> Freelance Linux trainer and consultant
>
> blog: the-hydra.blogspot.com
> training: mulyaditraining.blogspot.com
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 
Regards,
Sri.

      reply	other threads:[~2011-10-07 15:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-26  2:16 Why do processes with higher priority to be allocated more timeslice? Parmenides
2011-09-26  7:51 ` Mulyadi Santosa
2011-09-26 17:10   ` Parmenides
2011-09-26 18:40     ` Jeff Donner
2011-09-27  2:07       ` Parmenides
2011-09-27  4:28         ` Mulyadi Santosa
2011-09-27 13:06           ` Parmenides
2011-09-27 15:44             ` Mulyadi Santosa
2011-10-07 15:40               ` Sri Ram Vemulpali [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALyraeO0h0O1UgcpGJmGQt8_QWNHEZtCHPegR5CBYbUNgjfq0A@mail.gmail.com \
    --to=sri.ram.gmu06@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.