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: Andrew Cooper <Andrew.Cooper3@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	George Dunlap <George.Dunlap@citrix.com>,
	"uma.sharma523@gmail.com" <uma.sharma523@gmail.com>
Subject: Re: [PATCH v2 2/2] sched_credit2.c: runqueue_per_core code
Date: Thu, 19 Mar 2015 11:23:01 +0000	[thread overview]
Message-ID: <1426764178.2560.114.camel@citrix.com> (raw)
In-Reply-To: <550AB812020000780006B872@mail.emea.novell.com>


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

On Thu, 2015-03-19 at 10:50 +0000, Jan Beulich wrote:
> >>> On 19.03.15 at 11:03, <dario.faggioli@citrix.com> wrote:
> > OTOH, CPU_STARTING callbacks run:
> >  - on the cpu being brought up;
> >  - with interrupt disabled (see how the call to local_irq_enable(), in
> >    start_secondary(), is *after* the invocation of
> >    notify_cpu_starting()).
> > 
> > Here we are. And the reason why things works ok in Credit2, is that
> > csched2_alloc_pdata() doesn't really allocate anything! In fact, in
> > general, handling alloc_pdata() during CPU_STARTING would mean that we
> > can't allocate any memory which, given the name of the function, would
> > look rather odd. :-)
> > 
> > Nevertheless I see the value of doing so, and hence I think what we
> > could do would be to introduce a new hook in the scheduler interface,
> > called .init_pdata or .init_pcpu, and, in sched_*.c, split the
> > allocation and the initialization parts. The former will be handled
> > during CPU_UP_PREPARE, when allocation is possible, the latter during
> > CPU_STARTING, when we have more info available to perform actual
> > initializations.
> 
> Another alternative would be a new CPU_ALIVE (name subject to
> change) notification after interrupts got enabled. 
>
I'd be certainly up to try this too, if it is considered better.

BTW, according to my greps, there aren't much users of the CPU_STARTING
callback... Credit2 really seems to be the only one:

[dario@Solace xen.git] $ grep CPU_STARTING xen/* -R
xen/common/sched_credit2.c:    case CPU_STARTING:
xen/common/cpu.c:        &cpu_chain, CPU_STARTING, hcpu, NULL);
xen/include/xen/cpu.h: *  CPU_UP_PREPARE -> CPU_STARTING -> CPU_ONLINE -- successful CPU up
xen/include/xen/cpu.h:/* CPU_STARTING: CPU nearly online. Runs on new CPU, irqs still disabled. */
xen/include/xen/cpu.h:#define CPU_STARTING     (0x0003 | NOTIFY_FORWARD)
xen/include/xen/cpu.h:/* From arch code, send CPU_STARTING notification. */

With my proposal, it will still be used by the scheduler code only,
although (potentially) by all schedulers, not by just Credit2.

If we bring in CPU_ALIVE, and we move _all_ scheduler related pCPU init
code (both allocation and actual initialization) in there, CPU_STARTING
will become unused.

I'm not sure this means we could then remove it, or either move it below
IRQ enabling and just use it (instead of adding another). In fact, it
perhaps would still be good to have the chance, in future, to execute
code on the cpu with IRQ disabled, or not? In any case, I thought this
was worth mentioning.

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

  reply	other threads:[~2015-03-19 11:23 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13 18:11 [PATCH v2 2/2] sched_credit2.c: runqueue_per_core code Uma Sharma
2015-03-13 18:29 ` Andrew Cooper
2015-03-13 19:13   ` George Dunlap
2015-03-16 12:48     ` Jan Beulich
2015-03-16 12:51       ` George Dunlap
2015-03-16 12:56         ` Jan Beulich
2015-03-16 13:26           ` Dario Faggioli
2015-03-17 18:18           ` Dario Faggioli
2015-03-18  7:56             ` Jan Beulich
2015-03-18  8:53               ` Dario Faggioli
2015-03-18 15:26                 ` George Dunlap
2015-03-18 15:59                   ` Jan Beulich
2015-03-18 16:08                     ` George Dunlap
2015-03-18 16:30                       ` Dario Faggioli
2015-03-18 16:49                   ` Dario Faggioli
2015-03-18 17:05                     ` George Dunlap
2015-03-19 10:03                       ` Dario Faggioli
2015-03-19 10:50                         ` Jan Beulich
2015-03-19 11:23                           ` Dario Faggioli [this message]
2015-03-19 11:40                           ` George Dunlap
2015-03-19 12:29                             ` Dario Faggioli
2015-03-19 12:35                               ` George Dunlap
2015-03-19 13:00                                 ` Dario Faggioli
2015-03-16 12:45 ` Jan Beulich
2015-03-16 12:49 ` Jan Beulich

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=1426764178.2560.114.camel@citrix.com \
    --to=dario.faggioli@citrix.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=George.Dunlap@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=uma.sharma523@gmail.com \
    --cc=xen-devel@lists.xen.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.