All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@eu.citrix.com>
To: Keir Fraser <Keir.Fraser@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: Re: [PATCH] [RFC] Credit2 scheduler prototype
Date: Wed, 13 Jan 2010 16:43:17 +0000	[thread overview]
Message-ID: <4B4DF825.1090100@eu.citrix.com> (raw)
In-Reply-To: <C773A726.64B7%keir.fraser@eu.citrix.com>

Keir Fraser wrote:
> On 13/01/2010 16:05, "George Dunlap" <George.Dunlap@eu.citrix.com> wrote:
>
>   
>> [NB that the current global lock will eventually be replaced with
>> per-runqueue locks.]
>>
>> In particular, one of the races without the first flag looks like this
>> (brackets indicate physical cpu):
>> [0] lock cpu0 schedule lock
>> [0] lock credit2 runqueue lock
>> [0] Take vX off runqueue; vX->processor == 1
>> [0] unlock credit2 runqueue lock
>> [1] vcpu_wake(vX) lock cpu1 schedule lock
>> [1] finds vX->running false, adds it to the runqueue
>> [1] unlock cpu1 schedule_lock
>>     
>
> Actually, hang on. Doesn't this issue, and the one that your second patch
> addresses, go away if we change the schedule_lock granularity to match
> runqueue granularity? That would seem pretty sensible, and could be
> implemented with a schedule_lock(cpu) scheduler hook, returning a
> spinlock_t*, and a some easy scheduler code changes.
>
> If we do that, do you then even need separate private per-runqueue locks?
> (Just an extra thought).
>   
Hmm.... can't see anything wrong with it.  It would make the whole 
locking discipline thing a lot simpler.  It would, AFAICT, remove the 
need for private per-runqueue locks, which make it a lot harder to avoid 
deadlock without these sorts of strange tricks. :-)

I'll think about it, and probably give it a spin to see how it works out.

 -George

  reply	other threads:[~2010-01-13 16:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-07 17:02 [PATCH] [RFC] Credit2 scheduler prototype George Dunlap
2009-12-07 17:45 ` Keir Fraser
2009-12-08 14:48   ` George Dunlap
2009-12-08 18:20     ` Keir Fraser
2010-01-13 14:48       ` George Dunlap
2010-01-13 15:16         ` Keir Fraser
2010-01-13 16:05           ` George Dunlap
2010-01-13 16:36             ` Keir Fraser
2010-01-13 16:43               ` George Dunlap [this message]
2010-01-28 23:27                 ` Dulloor
2010-01-29  0:56                   ` George Dunlap

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=4B4DF825.1090100@eu.citrix.com \
    --to=george.dunlap@eu.citrix.com \
    --cc=Keir.Fraser@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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.