From: Don Zickus <dzickus@redhat.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Dongdong Deng <dongdong.deng@windriver.com>,
peterz@infradead.org, tglx@linutronix.de, mingo@redhat.com,
hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [V3 PATCH] x86: avoid calling arch_trigger_all_cpu_backtrace() at the same time on SMP
Date: Thu, 11 Nov 2010 09:34:25 -0500 [thread overview]
Message-ID: <20101111143425.GG4823@redhat.com> (raw)
In-Reply-To: <20101111111702.GA12644@elte.hu>
On Thu, Nov 11, 2010 at 12:17:02PM +0100, Ingo Molnar wrote:
>
> Hm, another thing i noticed is that there's two of these:
I guess it depends how we want to deprecate the old nmi watchdog.
Dongdong was just patching the old and new code.
There are 3 ways we can go here.
- rip out the 'arch_trigger_all_cpu_backtrace' from the old nmi_watchdog,
rework the Makefile and have both watchdogs use common code in hw_nmi.c
- patch both places
- rely on the fact that the old watchdog doesn't really work any more and
only patch the new watchdog
I can put together a patch to do the first one, then have Dongdong put his
patch on top. Selfishly I wouldn't mind just doing the third option. ;-)
Thoughts?
Cheers,
Don
>
> > #ifdef ARCH_HAS_NMI_WATCHDOG
> > +/* "in progress" flag of arch_trigger_all_cpu_backtrace */
> > +static unsigned long backtrace_flag;
> > +
> > void arch_trigger_all_cpu_backtrace(void)
> > {
> > int i;
> > + unsigned long flags;
> > +
> > + /*
> > + * Have to disable irq here, as the
> > + * arch_trigger_all_cpu_backtrace() could be
> > + * triggered by "spin_lock()" with irqs on.
> > + */
> > + local_irq_save(flags);
>
> > +/* "in progress" flag of arch_trigger_all_cpu_backtrace */
> > +static unsigned long backtrace_flag;
> > +
> > void arch_trigger_all_cpu_backtrace(void)
> > {
> > int i;
> > + unsigned long flags;
> > +
> > + /*
> > + * Have to disable irq here, as the
> > + * arch_trigger_all_cpu_backtrace() could be
> > + * triggered by "spin_lock()" with irqs on.
> > + */
> > + local_irq_save(flags);
> > +
> > + if (test_and_set_bit(0, &backtrace_flag))
>
> A fair amount of code is being duplicated in two places - which is not nice. Lets
> try to create a shared facility instead?
>
> Thanks,
>
> Ingo
next prev parent reply other threads:[~2010-11-11 14:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-11 11:01 [V3 PATCH] x86: avoid calling arch_trigger_all_cpu_backtrace() at the same time on SMP Dongdong Deng
2010-11-11 11:17 ` Ingo Molnar
2010-11-11 11:23 ` DDD
2010-11-11 12:12 ` Dongdong Deng
2010-11-11 14:34 ` Don Zickus [this message]
2010-11-11 18:06 ` Ingo Molnar
2010-11-12 2:38 ` DDD
2010-11-12 3:39 ` Don Zickus
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=20101111143425.GG4823@redhat.com \
--to=dzickus@redhat.com \
--cc=dongdong.deng@windriver.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.