RE: [RFC PATCH 10/11] time sync: generic infrastructure to mapbetween time stamps generated by a clock source and system time

From: Ohly, Patrick
Date: Thu Nov 20 2008 - 02:09:24 EST


Andrew wrote:
> These patcehs add a lot of quite large inlined functions.

Right, I'll need to clean this up once it is clear which code
is really going to be needed.

> On Wed, 19 Nov 2008 13:08:47 +0100
> Patrick Ohly <patrick.ohly@xxxxxxxxx> wrote:
>
> > +static inline void clocksync_update(struct clocksync *sync,
> > + u64 hwtstamp)
> > +{
> > + s64 offset;
> > + u64 average_time;
> > +
> > + if (hwtstamp &&
> > + (s64)(hwtstamp - sync->last_update) < NSEC_PER_SEC)
> > + return;
> > +

In this example, the check is going to avoid a function call when
inlined in most of the cases. This was the motivation for making
the function inline in the first place. The rest of it should be
split of into a non-inline helper function. A "likely()" should
be added, too.

> The token '/**' is used exclusively to introduce kerneldoc-formatted
> comments. Please check the patches for comments which are incorrectly
> thus-tagged.

Sorry for that, will do. Old habits die hard.

> Please cc linux-api@xxxxxxxxxxxxxxx on patches which affect the
> kernel's userspace interfaces.

Okay.

Bye, Patrick
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/