Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1068909pxb; Thu, 5 Nov 2020 23:20:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJza+uTgxc4ImGiGwEVwBku8W/HhDO7GLFZ0RbOdhbAOC2p2/SyGz/FC+lMKitwtedmyGfR2 X-Received: by 2002:a17:906:8145:: with SMTP id z5mr684568ejw.461.1604647223946; Thu, 05 Nov 2020 23:20:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604647223; cv=none; d=google.com; s=arc-20160816; b=O9YZJZQyI2ERo+TVIpF9N+2EyOaRBPkhksIiwF4qbK++Vh+2XPX9BmPueQPMLxJ2sR cBGggoiInwII+A1Gt2CFq1QX4hqKDeypvzGeA7nV2h+Hm/GhAt3HY4aHD7htI7DBvcQ/ dRYQNmFgzX32Es/2RC78YbLVvofEo/vRipS56P92gr3knSIBj63ICDHoxX87OgOCCFlW Ley525+8jD92rSCmZUvaEJoc85l4bJTsGdT9MSVbK3NTYw8LqHQcXwoBEqpkZCuebhvI rg79bF6NmIgfL0BB9WQr82xU++2Pgr3zgchZYuq+wNn2OXpVRHt1kTcsmkaKekwc3PRj gTIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=KvWO1D5HeK+9YwXNxnz2ofyZz8bGbe2vO0pgdB1TosA=; b=aTUSmwT5cjuLCeLSNZhFzAhe17X8sx35VBNAODTQzj+kd+RMN+k8Nz+LMBmRylxxZQ YdpQqXtK7QpghD4Zg1X/oJqryD+GTzqQQmCQEMyR8Zur1o5NCiz6svlafA857jEeDE/g aGV4pVqDOsQ/RGSIVxCyhKV54NR4FlzDuylmyK6q4tVwbIYrl2XPqrCwhvOdrj4Rj2cD Ai9rHsxg18unFz8BQngV3XkMKXTupRYOIltFMkf/RGfE+ZNhVuySOP1TH8OI/u0k1rWA sG9o/ZV6OD5+VreGPctBiq2FdtIqCIysjBZRgtRAILvEnmGUsPW5ICHIWG9igGpcT5K3 IyKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v21si264726ejy.444.2020.11.05.23.20.01; Thu, 05 Nov 2020 23:20:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726198AbgKFHSk (ORCPT + 99 others); Fri, 6 Nov 2020 02:18:40 -0500 Received: from mx2.suse.de ([195.135.220.15]:45598 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725830AbgKFHSk (ORCPT ); Fri, 6 Nov 2020 02:18:40 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id C69A8AB8F; Fri, 6 Nov 2020 07:18:38 +0000 (UTC) Date: Thu, 5 Nov 2020 22:56:42 -0800 From: Davidlohr Bueso To: paulmck@kernel.org Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, mingo@kernel.org, jiangshanlai@gmail.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org Subject: Re: [PATCH tip/core/rcu 03/28] locktorture: Track time of last ->writeunlock() Message-ID: <20201106065642.ti7mgrll7mbrndja@linux-p48b.lan> References: <20201105234658.GA23142@paulmck-ThinkPad-P72> <20201105234719.23307-3-paulmck@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20201105234719.23307-3-paulmck@kernel.org> User-Agent: NeoMutt/20180716 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 05 Nov 2020, paulmck@kernel.org wrote: >From: "Paul E. McKenney" > >This commit adds a last_lock_release variable that tracks the time of >the last ->writeunlock() call, which allows easier diagnosing of lock >hangs when using a kernel debugger. This makes sense to have. Acked-by: Davidlohr Bueso > >Cc: Davidlohr Bueso >Signed-off-by: Paul E. McKenney >--- > kernel/locking/locktorture.c | 2 ++ > 1 file changed, 2 insertions(+) > >diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c >index 62d215b..316531d 100644 >--- a/kernel/locking/locktorture.c >+++ b/kernel/locking/locktorture.c >@@ -60,6 +60,7 @@ static struct task_struct **reader_tasks; > > static bool lock_is_write_held; > static bool lock_is_read_held; >+static unsigned long last_lock_release; > > struct lock_stress_stats { > long n_lock_fail; >@@ -632,6 +633,7 @@ static int lock_torture_writer(void *arg) > lwsp->n_lock_acquired++; > cxt.cur_ops->write_delay(&rand); > lock_is_write_held = false; >+ WRITE_ONCE(last_lock_release, jiffies); > cxt.cur_ops->writeunlock(); > > stutter_wait("lock_torture_writer"); >-- >2.9.5 >