Re: [chrony-dev] [PATCH] MacOS X - Run chronyd as real-time process

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


On Mon, Aug 24, 2015 at 10:04:44PM +1200, Bryan Christianson wrote:
> Adds option -P to chronyd on MacOS X which can be used to enable the thread time constraint scheduling policy. This near real-time scheduling policy removes a 1usec bias from the 'System time' offset.

Two comments below.

> ---
>  chrony.texi.in |  7 ++++---
>  chronyd.8.in   |  7 ++++---
>  sys.c          |  2 ++
>  sys_macosx.c   | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  sys_macosx.h   |  2 +-
>  5 files changed, 65 insertions(+), 7 deletions(-)
> 
> diff --git a/chrony.texi.in b/chrony.texi.in
> index 0b31bb6..89fe5e1 100644
> --- a/chrony.texi.in
> +++ b/chrony.texi.in
> @@ -1039,9 +1039,10 @@ not correct the clock.
>  This option displays @code{chronyd's} version number to the terminal and
>  exits.
>  @item -P <priority>
> -This option will select the SCHED_FIFO real-time scheduler at the
> -specified priority (which must be between 0 and 100).  This mode is
> -supported only on Linux.
> +On Linux, this option will select the SCHED_FIFO real-time scheduler at the specified
> +priority (which must be between 0 and 100).  On MacOSX, this option must have either
> +a value of 0 (the default) to disable the thread time constraint policy or 1 for the
> +policy to be enabled. Other systems do not support this option.
>  @item -m     
>  This option will lock chronyd into RAM so that it will never be paged
>  out.  This mode is only supported on Linux.

Can you please update also the sched_priority description (using the
same text as here is ok I think) and reformat it to 80 columns?

> --- a/sys_macosx.c
> +++ b/sys_macosx.c
> @@ -42,7 +42,12 @@
>  #include <stdio.h>
>  #include <signal.h>
>  
> +#include <mach/mach.h>
> +#include <mach/mach_time.h>
> +#include <pthread.h>
> +
>  #include "sys_macosx.h"
> +#include "conf.h"

Why is conf.h needed?

-- 
Miroslav Lichvar

-- 
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/