2007-08-21 16:29:39

by Daniel Walker

[permalink] [raw]
Subject: Re: [PATCH] [12/58] x86_64: Add vDSO for x86-64 with gettimeofday/clock_gettime/getcpu

On Thu, 2007-07-19 at 11:54 +0200, Andi Kleen wrote:
> +
> +static noinline int do_realtime(struct timespec *ts)
> +{
> + unsigned long seq, ns;
> + do {
> + seq = read_seqbegin(&gtod->lock);
> + ts->tv_sec = gtod->wall_time_sec;
> + ts->tv_nsec = gtod->wall_time_nsec;
> + ns = vgetns();
> + } while (unlikely(read_seqretry(&gtod->lock, seq)));
> + timespec_add_ns(ts, ns);
> + return 0;
> +}

Some thoughts ,

In the -mm kernel there is some debugging that gets injected into the
likely/unlikely macros .. If they get called from userspace it causes a
hang .. We might want to add some new set of macros to specifically
denote that they are called from userspace, not just likely/unlikely but
all the macros so we don't get mixed usage ..

Daniel


2007-08-21 17:51:58

by Andi Kleen

[permalink] [raw]
Subject: Re: [PATCH] [12/58] x86_64: Add vDSO for x86-64 with gettimeofday/clock_gettime/getcpu

> In the -mm kernel there is some debugging that gets injected into the
> likely/unlikely macros .. If they get called from userspace it causes a

They should likely define a __likely()/__unlikely() then that doesn't
do this.

> hang .. We might want to add some new set of macros to specifically
> denote that they are called from userspace, not just likely/unlikely but
> all the macros so we don't get mixed usage ..

and add a hunk to change the vDSO code. Note that i386 is not the
only architecture that has such code.

-Andi

2007-08-21 18:41:18

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH] [12/58] x86_64: Add vDSO for x86-64 with gettimeofday/clock_gettime/getcpu

On Tue, 21 Aug 2007 20:45:43 +0200 Andi Kleen <[email protected]> wrote:

> > In the -mm kernel there is some debugging that gets injected into the
> > likely/unlikely macros .. If they get called from userspace it causes a
>
> They should likely define a __likely()/__unlikely() then that doesn't
> do this.
>
> > hang .. We might want to add some new set of macros to specifically
> > denote that they are called from userspace, not just likely/unlikely but
> > all the macros so we don't get mixed usage ..
>
> and add a hunk to change the vDSO code. Note that i386 is not the
> only architecture that has such code.
>

Yes, the simplest fix would be to remove all the troublesome likely/unlikely
calls within that debug patch. I'll take a look at that, see if it fixes
the compile.