public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Shailabh Nagar <nagar@watson.ibm.com>
To: Peter Williams <pwil3058@bigpond.net.au>
Cc: ckrm-tech <ckrm-tech@lists.sourceforge.net>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: ckrm-e17
Date: Sat, 12 Feb 2005 12:47:37 -0500	[thread overview]
Message-ID: <420E4139.1050907@watson.ibm.com> (raw)
In-Reply-To: <420D98A3.3060508@bigpond.net.au>

Peter Williams wrote:
> Shailabh Nagar wrote:
> 
> 
> At line 3887 of cpu.ckrm-e17.v10.patch you add the line:
> 
>         set_task_cpu(p,this_cpu);
> 
> to the middle of the function wake_up_new_task() resulting in the 
> following code:
> 
>     } else {
>         this_rq = cpu_rq(this_cpu);
> 
>         /*
>          * Not the local CPU - must adjust timestamp. This should
>          * get optimised away in the !CONFIG_SMP case.
>          */
>         p->sdu.ingosched.timestamp = (p->sdu.ingosched.timestamp - 
> this_rq->timestamp_last_tick)
>                     + rq->timestamp_last_tick;
>         set_task_cpu(p,this_cpu);
>         __activate_task(p, rq);
>         if (TASK_PREEMPTS_CURR(p, rq))
>             resched_task(rq->curr);
> 
>         schedstat_inc(rq, wunt_moved);
>         /*
>          * Parent and child are on different CPUs, now get the
>          * parent runqueue to update the parent's 
> ->sdu.ingosched.sleep_avg:
>          */
>         task_rq_unlock(rq, &flags);
>         this_rq = task_rq_lock(current, &flags);
>     }
> 
> where "rq" has been set by the return value of "task_rq_lock(p, 
> &flags)", and the test "(cpu == this_cpu)" has failed with "cpu" set to 
> "task_cpu(p)".  The result of this when the CKRM CPU code is not 
> configured into the build is that "p" will be queued on a runqueue that 
> is not in agreement with "p->thread_info->cpu" which in turn will lead 
> to future use of "task_rq_lock()" locking the wrong run queue and 
> eventually triggering some form of race condition.
> 
> If CKRM CPU is configured into the build the results are less drastic as 
> they only result in "nr_running" being incremented for the wrong run 
> queue.  However, even this will have adverse scheduling effects as it 
> will probably confuse the load balancing code.  Another potentially 
> confusing thing with this code (when CKRM CPU is configured in) is that 
> __activate_task() does NOT queue "p" on "rq" but on the queue found by 
> the call "get_task_lrq(p)".
> 
> The recommended fix for this problem would be to withdraw the:
> 
>         set_task_cpu(p,this_cpu);
> 
> Peter

Thanks for finding that out. Will confirm and fix in the next release.

> PS I reported this to the ckrm-tech list 5 days ago but it was ignored.

Other project priorities prevented us from responding sooner. There's no 
call to jump to conclusions.

-- Shailabh


      reply	other threads:[~2005-02-12 17:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-27 17:52 ckrm-e17 Shailabh Nagar
2005-01-27 18:33 ` ckrm-e17 Dave Hansen
2005-01-27 19:55   ` ckrm-e17 Shailabh Nagar
2005-02-12  5:48 ` ckrm-e17 Peter Williams
2005-02-12 17:47   ` Shailabh Nagar [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=420E4139.1050907@watson.ibm.com \
    --to=nagar@watson.ibm.com \
    --cc=ckrm-tech@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pwil3058@bigpond.net.au \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox