Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752400AbbDCFrP (ORCPT ); Fri, 3 Apr 2015 01:47:15 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:38242 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751790AbbDCFrM (ORCPT ); Fri, 3 Apr 2015 01:47:12 -0400 Date: Fri, 3 Apr 2015 07:47:08 +0200 From: Ingo Molnar To: Chris J Arges Cc: Linus Torvalds , Rafael David Tinoco , Peter Anvin , Jiang Liu , Peter Zijlstra , LKML , Jens Axboe , Frederic Weisbecker , Gema Gomez , the arch/x86 maintainers Subject: Re: [PATCH] smp/call: Detect stuck CSD locks Message-ID: <20150403054708.GA12316@gmail.com> References: <20150401124336.GB12841@gmail.com> <20150401161047.GD12730@canonical.com> <551C6A48.9060805@canonical.com> <20150402182607.GA8896@gmail.com> <551D8FAF.5070805@canonical.com> <20150402190725.GA10570@gmail.com> <551DB0E2.1020607@canonical.com> <20150403054320.GA9863@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150403054320.GA9863@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 689 Lines: 23 * Ingo Molnar wrote: > +static void csd_lock_wait(struct call_single_data *csd, int cpu) > { > - while (csd->flags & CSD_FLAG_LOCK) > + int bug_id = 0; > + u64 ts0, ts1, ts_delta; > + > + ts0 = jiffies_to_msecs(jiffies); Note that while 'jiffies' is a global variable, it's read-mostly accessed, so it is a pretty cheap way to acquire a timestamp in such a simple polling context that has irqs enabled. Thanks, Ingo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/