All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Dario Faggioli <dario.faggioli@citrix.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	George Dunlap <george.dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
	Julien Grall <julien.grall@arm.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3 5/6] xen: RCU: avoid busy waiting until the end of grace period.
Date: Tue, 22 Aug 2017 07:04:36 -0600	[thread overview]
Message-ID: <599C480402000078001720A3@prv-mh.provo.novell.com> (raw)
In-Reply-To: <150307947767.29525.16150424729950084786.stgit@Solace.fritz.box>

>>> On 18.08.17 at 20:04, <dario.faggioli@citrix.com> wrote:
> --- a/xen/arch/x86/cpu/mwait-idle.c
> +++ b/xen/arch/x86/cpu/mwait-idle.c
> @@ -741,9 +741,8 @@ static void mwait_idle(void)
>  	}
>  
>  	cpufreq_dbs_timer_suspend();
> -
>  	sched_tick_suspend();
> -	/* sched_tick_suspend() can raise TIMER_SOFTIRQ. Process it now. */
> +	/* Timer related operations can raise TIMER_SOFTIRQ. Process it now. */
>  	process_pending_softirqs();

Is this a leftover from v1? Otherwise, why do you do the adjustment
here but not in acpi_processor_idle()?

> --- a/xen/common/rcupdate.c
> +++ b/xen/common/rcupdate.c
> @@ -84,8 +84,37 @@ struct rcu_data {
>      int cpu;
>      struct rcu_head barrier;
>      long            last_rs_qlen;     /* qlen during the last resched */
> +
> +    /* 3) idle CPUs handling */
> +    struct timer idle_timer;
> +    bool idle_timer_active;
>  };
>  
> +/*
> + * If a CPU with RCU callbacks queued goes idle, when the grace period is
> + * not finished yet, how can we make sure that the callbacks will eventually
> + * be executed? In Linux (2.6.21, the first "tickless idle" Linux kernel),
> + * the periodic timer tick would not be stopped for such CPU. Here in Xen,
> + * we (may) don't even have a periodic timer tick, so we need to use a
> + * special purpose timer.
> + *
> + * Such timer:
> + * 1) is armed only when a CPU with an RCU callback(s) queued goes idle
> + *    before the end of the current grace period (_not_ for any CPUs that
> + *    go idle!);
> + * 2) when it fires, it is only re-armed if the grace period is still
> + *    running;
> + * 3) it is stopped immediately, if the CPU wakes up from idle and
> + *    resumes 'normal' execution.
> + *
> + * About how far in the future the timer should be programmed each time,
> + * it's hard to tell (guess!!). Since this mimics Linux's periodic timer
> + * tick, take values used there as an indication. In Linux 2.6.21, tick
> + * period can be 10ms, 4ms, 3.33ms or 1ms. Let's use 10ms, to enable
> + * at least some power saving on the CPU that is going idle.
> + */
> +#define RCU_IDLE_TIMER_PERIOD MILLISECS(10)

With you even mentioning that the original Linux code has ways
to use different values, wouldn't it be worth allowing this to be
command line controllable?

Jan


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

  reply	other threads:[~2017-08-22 13:04 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-18 18:04 [PATCH v3 0/6] xen: RCU: x86/ARM: Add support of rcu_idle_{enter, exit} Dario Faggioli
2017-08-18 18:04 ` [PATCH v3 1/6] xen: in do_softirq() sample smp_processor_id() once and for all Dario Faggioli
2017-08-18 18:04 ` [PATCH v3 2/6] xen: ARM: suspend the tick (if in use) when going idle Dario Faggioli
2017-08-18 18:04 ` [PATCH v3 3/6] xen: RCU/x86/ARM: discount CPUs that were idle when grace period started Dario Faggioli
2017-08-22 12:59   ` Jan Beulich
2017-08-29 14:58   ` George Dunlap
2017-08-18 18:04 ` [PATCH v3 4/6] xen: RCU: don't let a CPU with a callback go idle Dario Faggioli
2017-08-29 15:01   ` George Dunlap
2017-08-18 18:04 ` [PATCH v3 5/6] xen: RCU: avoid busy waiting until the end of grace period Dario Faggioli
2017-08-22 13:04   ` Jan Beulich [this message]
2017-08-29 16:06     ` George Dunlap
2017-08-30  7:18       ` Jan Beulich
2017-08-30 11:16         ` George Dunlap
2017-09-05 17:13         ` Dario Faggioli
2017-09-06  9:50           ` Jan Beulich
2017-08-29 16:03   ` George Dunlap
2017-08-18 18:04 ` [PATCH v3 6/6] xen: try to prevent idle timer from firing too often Dario Faggioli
2017-08-29 16:30   ` George Dunlap
2017-09-06 16:51     ` Dario Faggioli
2017-09-07  9:24       ` George Dunlap
2017-08-19  9:45 ` [PATCH v3 0/6] xen: RCU: x86/ARM: Add support of rcu_idle_{enter, exit} Tim Deegan

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=599C480402000078001720A3@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dario.faggioli@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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.