Re: [EXT] Re: [PATCH v1] timer:clock:ptp: add support the dynamic posix clock alarm set for ptp

Richard Cochran
2019-05-08T14:37:00Z

On Wed, May 08, 2019 at 03:30:01AM +0000, Po Liu wrote:
> > Sorry, NAK, since we decided some time ago not to support timer_* operations
> > on dynamic clocks. You get much better application level timer performance
> > by synchronizing CLOCK_REALTIME to your PHC and using clock_nanosleep()
> > with CLOCK_REALTIME or CLOCK_MONOTONIC.
>
> The code intend to get alarm by interrupt of ptp hardware. The code
> to fix ptp not support to application layer to get the alarm
> interrupt. Do you mean the synchronizing at application layer by
> PHC (using clock_nanosleep()) to the CLOCK_REALTIME source? Then the
> kernel could using the hrtimer with CLOCK_REALTIME?

Yes, or with CLOCK_MONOTONIC.

> > > This won't change the user space system call code. Normally the user
> > > space set alarm by timer_create() and timer_settime(). Reference code
> > > are tools/testing/selftests/ptp/testptp.c.
> >
> > That program still has misleading examples. Sorry about that. I'll submit a
> > patch to remove them.
>
> Is there any replace method for an application code to get alarm interrupt by the ptp source?

No the alarm functionality has been removed. It will not be coming
back, unless there are really strong arguments to support it.

Here is the result of a study of a prototype alarm method. It shows
why the hrtimer method is better.

https://sourceforge.net/p/linuxptp/mailman/message/35535965/

Thanks,
Richard