From patchwork Mon May 24 15:25:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 446462 Delivered-To: patch@linaro.org Received: by 2002:a17:907:2b0d:0:0:0:0 with SMTP id gc13csp3789072ejc; Mon, 24 May 2021 08:56:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeyC1QbDSU3UgHSABBNXvMAEDbi3v4GZ/IcmuJheCi6lDrYFYsi3SGeUdiApMWOSEM/ZNl X-Received: by 2002:aa7:dc0b:: with SMTP id b11mr26681301edu.124.1621871694231; Mon, 24 May 2021 08:54:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621871694; cv=none; d=google.com; s=arc-20160816; b=AGD3ZFmHDIGkUsBAbgTeMC6Ih0JqCuw4UcpJoIKvrQLDgQc0fRKGZh7utxMZySVqgG JkBYdJHmv+VJJ4LPELjq8JNDhhR4dVGp2Ay9p0V4jgwFe7MlvOJRTvuifJf/0qzDX8AX ZIonblxvkNMzCjJh/vJeaxFI+fAXo9he4Yez4pH6kXCvvXfbczkz+LlrJ05T/2SSLKAs Rx2yGPCC7OfaZPzvIP/ZFMgUKjG4i3jPaf+1bEvpgzKSGjRRnk0VUu1BT5v9Y0YpT3sJ CEYevq2jSaxTLLarzsSOwSd9RMlE04GCYfF/YrzDCQNRz+/PhSMTspFYuZCep+EV105z xsdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UogbPxzM6yAwACH4F7cKXEtZ7ExrlzhzDhg6bdCxg9M=; b=Ib0AEIYl81Hu2QnWHO0FYoQpc6EX5ng17G2IwkMJf3GtuDxZqOCXFZP1NR9/1QR6IX Bb4d2wM19rNYMPwIFb1Sm+GCVYanCmc6nZREJCs/Pst8DesCC7h5tXVtXytaGj4Xz0sW zgNbcwxVl5qgCtA8ZlcOb6ceO564a98fynPqvX/9diyP57etAFWMpbylx+jP7Dg9lALZ Dy83SssDjUfglyWC7zHmAJj0z6/FUmxk5fr/7pAZ411t0snzA2f5FAN2CyE0hfCf4xdU c0VYQ1bCIB54VZzCxMmGbjVq+0jIfrKvMVoY0LvgMRYiiyg4MbPEu2HopWcYaCrOZem5 i44Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Hb6B4Drj; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i2si4407336edc.332.2021.05.24.08.54.54; Mon, 24 May 2021 08:54:54 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Hb6B4Drj; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234866AbhEXPzz (ORCPT + 12 others); Mon, 24 May 2021 11:55:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:38646 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234458AbhEXPyI (ORCPT ); Mon, 24 May 2021 11:54:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C3EE36141B; Mon, 24 May 2021 15:39:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621870773; bh=h8SDQxAQR6aARdv6g//rvHxQQXax+farRV5g6s586Is=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hb6B4DrjVXCc8YGB7XY3412TJeif2Zk7T+5jFmfCXDZ/QQPMN7Y5zXb6hLgjpFT3H 6j3BjsGUPRKHFfD657Ex4KXzLMYGUGtc5UGS+4oUd/Gh7+KDIGQIETplWPKno1RVyq DduhWH1jWu9bLvk7bYENgUJVVK+Gld4iKv10mrNk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Leo Yan , "Peter Zijlstra (Intel)" , Sasha Levin Subject: [PATCH 5.10 028/104] locking/lockdep: Correct calling tracepoints Date: Mon, 24 May 2021 17:25:23 +0200 Message-Id: <20210524152333.747260779@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152332.844251980@linuxfoundation.org> References: <20210524152332.844251980@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Leo Yan [ Upstream commit 89e70d5c583c55088faa2201d397ee30a15704aa ] The commit eb1f00237aca ("lockdep,trace: Expose tracepoints") reverses tracepoints for lock_contended() and lock_acquired(), thus the ftrace log shows the wrong locking sequence that "acquired" event is prior to "contended" event: -0 [001] d.s3 20803.501685: lock_acquire: 0000000008b91ab4 &sg_policy->update_lock -0 [001] d.s3 20803.501686: lock_acquired: 0000000008b91ab4 &sg_policy->update_lock -0 [001] d.s3 20803.501689: lock_contended: 0000000008b91ab4 &sg_policy->update_lock -0 [001] d.s3 20803.501690: lock_release: 0000000008b91ab4 &sg_policy->update_lock This patch fixes calling tracepoints for lock_contended() and lock_acquired(). Fixes: eb1f00237aca ("lockdep,trace: Expose tracepoints") Signed-off-by: Leo Yan Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20210512120937.90211-1-leo.yan@linaro.org Signed-off-by: Sasha Levin --- kernel/locking/lockdep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.30.2 diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 38d7c03e694c..858b96b438ce 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -5664,7 +5664,7 @@ void lock_contended(struct lockdep_map *lock, unsigned long ip) { unsigned long flags; - trace_lock_acquired(lock, ip); + trace_lock_contended(lock, ip); if (unlikely(!lock_stat || !lockdep_enabled())) return; @@ -5682,7 +5682,7 @@ void lock_acquired(struct lockdep_map *lock, unsigned long ip) { unsigned long flags; - trace_lock_contended(lock, ip); + trace_lock_acquired(lock, ip); if (unlikely(!lock_stat || !lockdep_enabled())) return;