xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Meng Xu <xumengpanda@gmail.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Tianyang Chen <tiche@seas.upenn.edu>,
	George Dunlap <george.dunlap@citrix.com>,
	Dagaen Golomb <dgolomb@seas.upenn.edu>
Subject: Re: [PATCH v8]xen: sched: convert RTDS from time to event driven model
Date: Mon, 14 Mar 2016 17:35:22 +0100	[thread overview]
Message-ID: <1457973322.3102.694.camel@citrix.com> (raw)
In-Reply-To: <CAENZ-+=vX1y4GKduOX6JVcpAmLCS1-mfW8cbsRksSLENWD1s8A@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1854 bytes --]

On Mon, 2016-03-14 at 12:03 -0400, Meng Xu wrote:
> On Mon, Mar 14, 2016 at 11:38 AM, Meng Xu <mengxu@cis.upenn.edu>
> wrote:
> > 
> > I'm ok that we keep using spin_lock_irqsave() for now. But maybe
> > later, it will be a better idea to explore if spin_lock_irq() can
> > replace all spin_lock_irqsave() in the RTDS scheduler?
> > 
> I rethink about the choice of replacing spin_lock_irqsave with
> spin_lock_irq().
> If in the future ,we will introduce new locks and there may exit the
> situaiton when we want to lock two locks in the same function. In
> that
> case, we won't use spin_lock_irq() but have to use
> spin_lock_irqsave(). If we can mix up spin_lock_irq() with
> spin_lock_irqsave() in different fucntiosn for the same lock, which I
> think we can (right?), we should be fine. Otherwise, we will have to
> keep using spin_lock_irqsave().
> 
Mixing per se is not a problem, it's how you mix...

If you call spin_unlock_irq() within a critical section protected by
either spin_lock_irq() or spin_lock_irqsave(), that is not a good mix!
:-)

if you call _irqsave() inside a critical section protected by either
_irq() or _irqsave(), that's what should be done (it's the purpose of
_irqsave(), actually!).

Actually, in case of nesting, most of the time the inner lock can be
taken by just spin_lock(). Look, for instance, at csched2_dump_pcpu().

With more locks (which I agree is something we want for RTDS), the
biggest issue is going to be getting the actual nesting right, rather
than the various _irq* variants. :-)

Regards,
Dario
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2016-03-14 16:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-11 19:23 [PATCH v8]xen: sched: convert RTDS from time to event driven model Tianyang Chen
2016-03-12  4:54 ` Meng Xu
2016-03-12 22:21   ` Chen, Tianyang
2016-03-12 22:36     ` Andrew Cooper
2016-03-12 22:57       ` Chen, Tianyang
2016-03-13 15:43     ` Meng Xu
2016-03-14 11:48       ` Dario Faggioli
2016-03-14 13:54         ` Meng Xu
2016-03-14 11:58   ` Dario Faggioli
2016-03-14 15:38     ` Meng Xu
2016-03-14 16:03       ` Meng Xu
2016-03-14 16:35         ` Dario Faggioli [this message]
2016-03-14 17:40           ` Meng Xu
2016-03-14 16:24       ` Dario Faggioli
2016-03-14 17:37         ` Meng Xu

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=1457973322.3102.694.camel@citrix.com \
    --to=dario.faggioli@citrix.com \
    --cc=dgolomb@seas.upenn.edu \
    --cc=george.dunlap@citrix.com \
    --cc=tiche@seas.upenn.edu \
    --cc=xen-devel@lists.xenproject.org \
    --cc=xumengpanda@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).