mirror of https://gitee.com/openkylin/linux.git
x86_64: speedup touch_nmi_watchdog
Avoid dirtying remote cpu's memory if it already has the correct value. Cc: Andi Kleen <ak@suse.de> Cc: Konrad Rzeszutek <konrad@darnok.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
f2890255b0
commit
567f3e422a
|
@ -296,7 +296,7 @@ static DEFINE_PER_CPU(unsigned, last_irq_sum);
|
||||||
static DEFINE_PER_CPU(local_t, alert_counter);
|
static DEFINE_PER_CPU(local_t, alert_counter);
|
||||||
static DEFINE_PER_CPU(int, nmi_touch);
|
static DEFINE_PER_CPU(int, nmi_touch);
|
||||||
|
|
||||||
void touch_nmi_watchdog (void)
|
void touch_nmi_watchdog(void)
|
||||||
{
|
{
|
||||||
if (nmi_watchdog > 0) {
|
if (nmi_watchdog > 0) {
|
||||||
unsigned cpu;
|
unsigned cpu;
|
||||||
|
@ -306,8 +306,10 @@ void touch_nmi_watchdog (void)
|
||||||
* do it ourselves because the alert count increase is not
|
* do it ourselves because the alert count increase is not
|
||||||
* atomic.
|
* atomic.
|
||||||
*/
|
*/
|
||||||
for_each_present_cpu (cpu)
|
for_each_present_cpu(cpu) {
|
||||||
per_cpu(nmi_touch, cpu) = 1;
|
if (per_cpu(nmi_touch, cpu) != 1)
|
||||||
|
per_cpu(nmi_touch, cpu) = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
touch_softlockup_watchdog();
|
touch_softlockup_watchdog();
|
||||||
|
|
Loading…
Reference in New Issue