All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dario Faggioli <dario.faggioli@citrix.com>
To: "JBeulich@suse.com" <JBeulich@suse.com>
Cc: "Keir (Xen.org)" <keir@xen.org>,
	"xumengpanda@gmail.com" <xumengpanda@gmail.com>,
	George Dunlap <George.Dunlap@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH 3/7] xen: rework locking for dump of scheduler info (debug-key r)
Date: Tue, 17 Mar 2015 11:14:10 +0000	[thread overview]
Message-ID: <1426590848.32500.63.camel@citrix.com> (raw)
In-Reply-To: <55081607020000780006AAAE@mail.emea.novell.com>


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

On Tue, 2015-03-17 at 10:54 +0000, Jan Beulich wrote:
> >>> On 16.03.15 at 18:05, <dario.faggioli@citrix.com> wrote:
> > such as it is taken care of by the various schedulers, rather
> > than happening in schedule.c. In fact, it is the schedulers
> > that know better which locks are necessary for the specific
> > dumping operations.
> > 
> > While there, fix a few style issues (indentation, trailing
> > whitespace, parentheses and blank line after var declarations)
> > 
> > Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
> > Cc: George Dunlap <george.dunlap@eu.citrix.com>
> > Cc: Meng Xu <xumengpanda@gmail.com>
> > Cc: Jan Beulich <JBeulich@suse.com>
> > Cc: Keir Fraser <keir@xen.org>
> > ---
> >  xen/common/sched_credit.c  |   42 ++++++++++++++++++++++++++++++++++++++++--
> >  xen/common/sched_credit2.c |   40 ++++++++++++++++++++++++++++++++--------
> >  xen/common/sched_rt.c      |    7 +++++--
> >  xen/common/schedule.c      |    5 ++---
> >  4 files changed, 79 insertions(+), 15 deletions(-)
> 
> Is it really correct that sched_sedf.c doesn't need any change here?
> 
Good point.

I feel like mentioning though that SEDF is broken in many ways, and I
(and I suspect George is in a similar situation) really don't have the
bandwidth to fix it. Therefore, I really think we should start a
discussion on how to deprecate/get rid of it.

That being said, this is simple enough a case that I certainly can have
a quick look.

> > --- a/xen/common/sched_credit.c
> > +++ b/xen/common/sched_credit.c
> > @@ -26,6 +26,23 @@
> >  
> >  
> >  /*
> > + * Locking:
> > + * - Scheduler-lock (a.k.a. runqueue lock):
> > + *  + is per-runqueue, and there is one runqueue per-cpu;
> > + *  + serializes all runqueue manipulation operations;
> > + * - Private data lock (a.k.a. private scheduler lock):
> > + *  + serializes accesses to the scheduler global state (weight,
> > + *    credit, balance_credit, etc);
> > + *  + serializes updates to the domains' scheduling parameters.
> > + *
> > + * Ordering is "private lock always comes first":
> > + *  + if we need both locks, we must acquire the private
> > + *    scheduler lock for first;
> > + *  + if we already own a runqueue lock, we must never acquire
> > + *    the private scheduler lock.
> > + */
> 
> And this is Credit1 specific?
> 
It is similar (although with some differences) in Credit2, but there is
already a comment there, similar to this, stating it. RTDS, as of now,
only use _one_ lock, so not much to say about ordering. :-D

> Regardless of that, even if that's just reflecting current state, isn't
> acquiring a private lock around a generic lock backwards?
> 
It sounds like so, I agree, when describing it in English. But then,
looking at the code, things make sense, IMO.

> Finally, as said in different contexts earlier, I think unconditionally
> acquiring locks in dumping routines isn't the best practice. At least
> in non-debug builds I think these should be try-locks only, skipping
> the dumping when a lock is busy.
> 
That makes sense. It also looks, if not completely orthogonal, something
that can be done in a follow-up patch wrt this series. I.e., we first
move the locking logic where it belongs, and then we rework it toward
using _trylock(), does this make sense?

Regards,
Dario

[-- 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

  parent reply	other threads:[~2015-03-17 11:14 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-16 17:04 [PATCH 0/7] Improving dumping of scheduler related info Dario Faggioli
2015-03-16 17:04 ` [PATCH 1/7] xen: sched_rt: avoid ASSERT()ing on runq dump if there are no domains Dario Faggioli
2015-03-16 18:18   ` George Dunlap
2015-03-16 20:31   ` Meng Xu
2015-03-17 10:41   ` Jan Beulich
2015-03-17 11:00     ` Dario Faggioli
2015-03-16 17:04 ` [PATCH 2/7] xen: sched_rt: implement the .free_pdata hook Dario Faggioli
2015-03-16 17:10   ` Dario Faggioli
2015-03-16 18:23     ` Meng Xu
2015-03-17 13:00       ` Dario Faggioli
2015-03-16 18:17   ` Meng Xu
2015-03-16 18:21   ` George Dunlap
2015-03-16 17:05 ` [PATCH 3/7] xen: rework locking for dump of scheduler info (debug-key r) Dario Faggioli
2015-03-16 18:41   ` George Dunlap
2015-03-16 20:04   ` Meng Xu
2015-03-17 10:54   ` Jan Beulich
2015-03-17 11:05     ` George Dunlap
2015-03-17 11:18       ` Dario Faggioli
2015-03-17 11:25       ` Jan Beulich
2015-03-17 11:32         ` George Dunlap
2015-03-17 11:43           ` Jan Beulich
2015-03-17 12:01             ` George Dunlap
2015-03-17 11:14     ` Dario Faggioli [this message]
2015-03-17 11:31       ` Jan Beulich
2015-03-16 17:05 ` [PATCH 4/7] xen: print online pCPUs and free pCPUs when dumping scheduler info Dario Faggioli
2015-03-16 18:37   ` Juergen Gross
2015-03-16 18:46   ` George Dunlap
2015-03-17 10:59   ` Jan Beulich
2015-03-16 17:05 ` [PATCH 5/7] xen: make dumping vcpu info look better Dario Faggioli
2015-03-16 18:48   ` George Dunlap
2015-03-16 20:06   ` Meng Xu
2015-03-16 17:05 ` [PATCH 6/7] xen: sched_credit2: more info when dumping Dario Faggioli
2015-03-16 18:50   ` George Dunlap
2015-03-16 17:05 ` [PATCH 7/7] xen: sched_rt: print useful affinity " Dario Faggioli
2015-03-16 19:05   ` George Dunlap
2015-03-17 13:51     ` Dario Faggioli
2015-03-16 20:30   ` Meng Xu
2015-03-17 11:10     ` George Dunlap
2015-03-17 11:28       ` Jan Beulich
2015-03-18  1:05       ` Meng Xu
2015-03-17 14:12     ` Dario Faggioli
2015-03-18  1:07       ` 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=1426590848.32500.63.camel@citrix.com \
    --to=dario.faggioli@citrix.com \
    --cc=George.Dunlap@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xen.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 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.