All of lore.kernel.org
 help / color / mirror / Atom feed
From: anton wilson <anton.wilson@camotion.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: low-latency patch bug?
Date: Tue, 2 Jul 2002 10:40:20 -0400	[thread overview]
Message-ID: <200207021430.KAA30171@test-area.com> (raw)


I think I found a bug in the low latency patch. In reschedule_idle there is 
code that it adds that looks like this:


/*1*/#if LOWLATENCY_NEEDED
/*2*/       if (enable_lowlatency && (p->policy != SCHED_OTHER)) {
/*3*/              struct task_struct *t;
/*4*/               for (i = 0; i < smp_num_cpus; i++) {
/*5*/                       cpu = cpu_logical_map(i);
/*6*/                       t = cpu_curr(cpu);
/*7*/                       if (t != tsk)        //<------BUG
/*8*/                               t->need_resched = 1;
/*9*/               }
/*10*/       }
/*11*/#endif

This code does not check to see if tsk (target_tsk) is NULL at line 7. 
Therefore, the scheduler will try to reschedule even if tsk == NULL. In the 
worst case, if your process selection loop finds a different process to run 
everytime, and tsk is always NULL, the scheduler will enter an infinite loop.

I ran into this problem because I was pushing SCHED_RR tasks with the same 
priority to the back of the runqueue everytime the scheduler was called. 
Therefore a new process is found everytime and __schedule_tail is called 
everytime, and therefore a infinite loop.

Anton Wilson





-- 
Camotion
Software Development

                 reply	other threads:[~2002-07-02 14:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200207021430.KAA30171@test-area.com \
    --to=anton.wilson@camotion.com \
    --cc=linux-kernel@vger.kernel.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.