mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: thibodux@gmail.com, xen-devel@lists.xenproject.org,
	linux-kernel@vger.kernel.org
Cc: oleksandr_andrushchenko@epam.com, tglx@linutronix.de,
	jgross@suse.com, ryan.thibodeaux@starlab.io
Subject: Re: [PATCH] x86/xen: Add "xen_timer_slop" command line option
Date: Fri, 22 Mar 2019 18:10:16 -0400	[thread overview]
Message-ID: <abf65a68-9463-0f0e-1f51-6eefd3cacc88@oracle.com> (raw)
In-Reply-To: <1553279397-130201-1-git-send-email-ryan.thibodeaux@starlab.io>

On 3/22/19 2:29 PM, thibodux@gmail.com wrote:
> From: Ryan Thibodeaux <ryan.thibodeaux@starlab.io>
>
> Add a new command-line option "xen_timer_slop=<INT>" that sets the
> minimum delta of virtual Xen timers. This commit does not change the
> default timer slop value for virtual Xen timers.
>
> Lowering the timer slop value should improve the accuracy of virtual
> timers (e.g., better process dispatch latency), but it will likely
> increase the number of virtual timer interrupts (relative to the
> original slop setting).
>
> The original timer slop value has not changed since the introduction
> of the Xen-aware Linux kernel code. This commit provides users an
> opportunity to tune timer performance given the refinements to
> hardware and the Xen event channel processing. It also mirrors
> a feature in the Xen hypervisor - the "timer_slop" Xen command line
> option.

Is there any data that shows effects of using this new parameter?

-boris


>
> Signed-off-by: Ryan Thibodeaux <ryan.thibodeaux@starlab.io>
> ---
>  Documentation/admin-guide/kernel-parameters.txt |  7 +++++++
>  arch/x86/xen/time.c                             | 18 ++++++++++++++++--
>  2 files changed, 23 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 858b6c0..fb58c84 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -5129,6 +5129,13 @@
>  			with /sys/devices/system/xen_memory/xen_memory0/scrub_pages.
>  			Default value controlled with CONFIG_XEN_SCRUB_PAGES_DEFAULT.
>  
> +	xen_timer_slop=	[X86-64,XEN]
> +			Set the timer slop (in nanoseconds) for the virtual Xen
> +			timers (default is 100000). This adjusts the minimum
> +			delta of virtualized Xen timers, where lower values
> +			improve timer resolution at the expense of processing
> +			more timer interrupts.
> +
>  	xirc2ps_cs=	[NET,PCMCIA]
>  			Format:
>  			<irq>,<irq_mask>,<io>,<full_duplex>,<do_sound>,<lockup_hack>[,<irq2>[,<irq3>[,<irq4>]]]
> diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
> index 6e29794..0393968 100644
> --- a/arch/x86/xen/time.c
> +++ b/arch/x86/xen/time.c
> @@ -212,7 +212,7 @@ static int xen_timerop_set_next_event(unsigned long delta,
>  	return 0;
>  }
>  
> -static const struct clock_event_device xen_timerop_clockevent = {
> +static struct clock_event_device xen_timerop_clockevent __ro_after_init = {
>  	.name			= "xen",
>  	.features		= CLOCK_EVT_FEAT_ONESHOT,
>  
> @@ -273,7 +273,7 @@ static int xen_vcpuop_set_next_event(unsigned long delta,
>  	return ret;
>  }
>  
> -static const struct clock_event_device xen_vcpuop_clockevent = {
> +static struct clock_event_device xen_vcpuop_clockevent __ro_after_init = {
>  	.name = "xen",
>  	.features = CLOCK_EVT_FEAT_ONESHOT,
>  
> @@ -570,3 +570,17 @@ void __init xen_hvm_init_time_ops(void)
>  	x86_platform.set_wallclock = xen_set_wallclock;
>  }
>  #endif
> +
> +/* Kernel parameter to specify Xen timer slop */
> +static int __init parse_xen_timer_slop(char *ptr)
> +{
> +	unsigned long slop = memparse(ptr, NULL);
> +
> +	xen_timerop_clockevent.min_delta_ns = slop;
> +	xen_timerop_clockevent.min_delta_ticks = slop;
> +	xen_vcpuop_clockevent.min_delta_ns = slop;
> +	xen_vcpuop_clockevent.min_delta_ticks = slop;
> +
> +	return 0;
> +}
> +early_param("xen_timer_slop", parse_xen_timer_slop);


  reply	other threads:[~2019-03-22 22:11 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-22 18:29 thibodux
2019-03-22 22:10 ` Boris Ostrovsky [this message]
2019-03-23  2:58   ` Dario Faggioli
2019-03-23 10:41     ` luca abeni
2019-03-25 12:05       ` luca abeni
2019-03-25 13:43         ` Boris Ostrovsky
2019-03-25 14:07           ` luca abeni
2019-03-25 14:11           ` Ryan Thibodeaux
2019-03-25 17:36             ` Ryan Thibodeaux
2019-03-25 18:31             ` Boris Ostrovsky
2019-03-26  9:13           ` Dario Faggioli
2019-03-26 11:12             ` luca abeni
2019-03-26 11:41               ` Ryan Thibodeaux
2019-03-26 23:21             ` Boris Ostrovsky
2019-03-27 10:00               ` Ryan Thibodeaux
2019-03-27 14:46                 ` Boris Ostrovsky
2019-03-27 14:59                   ` Ryan Thibodeaux
2019-03-27 15:19                   ` Dario Faggioli
2019-03-23 12:00   ` Ryan Thibodeaux
2019-03-24 18:07     ` Boris Ostrovsky
2019-03-25 10:36       ` Dario Faggioli
2019-04-24 18:47 ` Boris Ostrovsky

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=abf65a68-9463-0f0e-1f51-6eefd3cacc88@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleksandr_andrushchenko@epam.com \
    --cc=ryan.thibodeaux@starlab.io \
    --cc=tglx@linutronix.de \
    --cc=thibodux@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®