From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932241Ab0DPOii (ORCPT ); Fri, 16 Apr 2010 10:38:38 -0400 Received: from mail-bw0-f225.google.com ([209.85.218.225]:52596 "EHLO mail-bw0-f225.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757254Ab0DPOih (ORCPT ); Fri, 16 Apr 2010 10:38:37 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=WOla+sEY+EVwoZLCpMKjXxg0+fn21vzv/Cw2poMVYQ58fyIILsLlWieYRA2HEs2PAp 8T85a9FjwY2Z356wg62uK4CFutYagYM3cUcDaalIB69SKB7V9vFi4JcWItkHTOEdZpLf pfN4g+WkUkjuhHmb+tRS0i5+41RqQEuEWeBoQ= Date: Fri, 16 Apr 2010 18:32:32 +0400 From: Cyrill Gorcunov To: Frederic Weisbecker Cc: Don Zickus , mingo@elte.hu, peterz@infradead.org, aris@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] [watchdog] combine nmi_watchdog and softlockup Message-ID: <20100416143232.GA5540@lenovo> References: <1271366710-17468-1-git-send-email-dzickus@redhat.com> <20100416014712.GC15570@nowhere> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100416014712.GC15570@nowhere> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 16, 2010 at 03:47:14AM +0200, Frederic Weisbecker wrote: [...] > > + > > +/* Callback function for perf event subsystem */ > > +void watchdog_overflow_callback(struct perf_event *event, int nmi, > > + struct perf_sample_data *data, > > + struct pt_regs *regs) > > +{ > > + int this_cpu = smp_processor_id(); > > + unsigned long touch_ts = per_cpu(watchdog_touch_ts, this_cpu); > > + > > + if (touch_ts == 0) { > > + __touch_watchdog(); > > + return; > > + } > > + > > + /* check for a hardlockup > > + * This is done by making sure our timer interrupt > > + * is incrementing. The timer interrupt should have > > + * fired multiple times before we overflow'd. If it hasn't > > + * then this is a good indication the cpu is stuck > > + */ > > + if (is_hardlockup(this_cpu)) { > > + /* only print hardlockups once */ > > + if (cpumask_test_cpu(this_cpu, to_cpumask(hardlockup_mask))) > > + return; > > + > > + if (hardlockup_panic) > > + panic("Watchdog detected hard LOCKUP on cpu %d", this_cpu); > > + else > > + WARN(1, "Watchdog detected hard LOCKUP on cpu %d", this_cpu); > > + > > + cpumask_set_cpu(this_cpu, to_cpumask(hardlockup_mask)); > > > > May be have an arch spin lock there to update your cpu mask safely. > Hmm, this is NMI handler path so from what we protect this per-cpu data? Do I miss something? /me confused -- Cyrill