mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Andreas Mohr <andi@lisas.de>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
	John Stultz <johnstul@us.ibm.com>
Subject: Re: clocksource mutex deadlock, cat current_clocksource (2.6.33-rc6/7)
Date: Mon, 8 Feb 2010 21:28:39 +0100 (CET)	[thread overview]
Message-ID: <alpine.LFD.2.00.1002082117210.2811@localhost.localdomain> (raw)
In-Reply-To: <20100208194734.GA20316@rhlx01.hs-esslingen.de>

On Mon, 8 Feb 2010, Andreas Mohr wrote:
> Hi,
> 
> On Mon, Feb 08, 2010 at 11:06:58AM +0100, Thomas Gleixner wrote:
> > EIP: 0060:[<c1045170>] EFLAGS: 00000082 CPU: 0
> > EIP is at timekeeping_forward_now+0x116/0x139
> > 
> > I don't see what might make the machine stuck here. Can you decode the
> > source line with "addr2line -e vmlinux c1045170" please ?
> 
> And the winner is:
> /usr/src/linux-2.6.33-rc7/include/linux/math64.h:91
> 
> static __always_inline u32
> __iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder)
> {
>         u32 ret = 0;
> 
>         while (dividend >= divisor) {
>                 /* The following asm() prevents the compiler from
>                    optimising this loop into a modulo operation.  */
>                 asm("" : "+rm"(dividend));
> 
>                 dividend -= divisor;
>                 ret++;
>         }
> 
>         *remainder = dividend;
> 
>         return ret;
> }
> 
> 
> while ......
> 
> Do I see a divisor == 0 here?? ;)

The only function which is calling __iter_div_u64_rem() from
timekeeping_forward_now() is timespec_add_ns() which calls it with a
constant divisor:

static __always_inline void timespec_add_ns(struct timespec *a, u64 ns)
{
        a->tv_sec += __iter_div_u64_rem(a->tv_nsec + ns, NSEC_PER_SEC, &ns);
        a->tv_nsec = ns;
}

There goes the theory :)

Which compiler version are you using ?

Can you please provide the disassembly of kernel/time/timekeeping.o ?

Thanks,

	tglx

  reply	other threads:[~2010-02-08 20:29 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-06 14:21 clocksource mutex deadlock, cat current_clocksource (2.6.33-rc6) Andreas Mohr
2010-02-06 14:46 ` Thomas Gleixner
2010-02-07 19:19   ` Andreas Mohr
2010-02-08  5:38     ` clocksource mutex deadlock, cat current_clocksource (2.6.33-rc6/7) Andreas Mohr
2010-02-08  9:13       ` Thomas Gleixner
2010-02-08  9:37         ` Andreas Mohr
2010-02-08 10:06           ` Thomas Gleixner
2010-02-08 19:47             ` Andreas Mohr
2010-02-08 20:28               ` Thomas Gleixner [this message]
2010-02-08 20:40                 ` Thomas Gleixner
2010-02-08 20:51                   ` Andreas Mohr
2010-02-08 21:02                     ` Andreas Mohr
2010-02-08 21:16                       ` Thomas Gleixner
2010-02-09 10:02                       ` Thomas Gleixner
2010-02-09 22:13                         ` Andreas Mohr
2010-02-14 18:27                         ` Andreas Mohr
2010-02-15  6:21                           ` Andreas Mohr
2010-02-08 20:43                 ` Andreas Mohr
2010-02-08 20:39               ` Andreas Mohr

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=alpine.LFD.2.00.1002082117210.2811@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=andi@lisas.de \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    /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®