From: Yanmin Zhang <yanmin_zhang@linux.intel.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: "Zhang, Yanmin" <yanmin.zhang@intel.com>,
"He, Bo" <bo.he@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>
Subject: RE: [PATCH] hrtimer:__run_hrtimer races with enqueue_hrtimer
Date: Mon, 29 Oct 2012 08:58:00 +0800 [thread overview]
Message-ID: <1351472280.4415.2.camel@ymzhang.sh.intel.com> (raw)
In-Reply-To: <alpine.LFD.2.02.1210261359210.2756@ionos>
On Fri, 2012-10-26 at 14:09 +0200, Thomas Gleixner wrote:
> On Fri, 26 Oct 2012, Zhang, Yanmin wrote:
> > >From: Thomas Gleixner [mailto:tglx@linutronix.de]
> > >Your code is returning HRTIMER_RESTART from the timer callback and at
> > >the same time it starts the timer from some other context. That's what
> > >needs to be fixed.
> >
> > The timer user should fix it. But could we also change hrtimer to
> > make it more stable? At least, instead of panic, could we print
> > some information and go ahead to let kernel continue?
>
> That's unfortunately not possible. At this point the timer might be
> already corrupted.
>
> CPU0 CPU 1
>
> timer expires
> callback runs
> hrtimer_start()
> expiry value is set
> hrtimer_enqueue()
>
> hrtimer_forward()
> expiry value is set
>
> return HRTIMER_RESTART
>
> So while we can prevent the double enqueue, we have no way to deal
> with the corrupted expiry value and the inconsistent RB tree. We can
> give better debugging information, but we can't pretend that
> everything is nice and cool.
>
> If we really want to do something about it which keeps the machine
> alive, then we need to
>
> 1) dequeue the timer
> 2) run a consistency check over the rbtree
> 3) enqueue the timer
>
> Not sure if that's worth the trouble.
I strongly agree with you. Such checking might cause more trouble than
what we could benefit from it.
Could we add more dumping, especially about the timer address and callback
function? Next time, developers could find the bad timer quickly.
prev parent reply other threads:[~2012-10-29 17:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-26 2:51 [PATCH] hrtimer:__run_hrtimer races with enqueue_hrtimer he, bo
2012-10-26 8:51 ` Yanmin Zhang
2012-10-26 9:55 ` Thomas Gleixner
2012-10-26 11:38 ` Zhang, Yanmin
2012-10-26 12:09 ` Thomas Gleixner
2012-10-29 0:58 ` Yanmin Zhang [this message]
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=1351472280.4415.2.camel@ymzhang.sh.intel.com \
--to=yanmin_zhang@linux.intel.com \
--cc=bo.he@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=yanmin.zhang@intel.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