From patchwork Mon May 24 15:25:49 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: 446461 Delivered-To: patch@linaro.org Received: by 2002:a17:907:2b0d:0:0:0:0 with SMTP id gc13csp3789043ejc; Mon, 24 May 2021 08:56:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyHYHUGEGkhCL0BM1QbAC2iv9YcBzCPrU+B8QmJhGzdXRzzOgvan4tYz+3kP0xhBQYb1Tp X-Received: by 2002:a92:b00d:: with SMTP id x13mr19689685ilh.181.1621871816797; Mon, 24 May 2021 08:56:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621871816; cv=none; d=google.com; s=arc-20160816; b=DHHbDCldzdrE7E6dLqPv88c0w5u2aA9yUOLqeqXuhJvv3T/qJsUIMdFC8m9jKUtU8t TGjwt3ggnuPxQupNfaMYW6WIFcaCrEemwKlcFydVfC/e5hQ5CK9rWlx8XY6Iv8rkCXNR T4dChLHYLvfObBxuaR70m1cIn3aMnJKWT1BYdWVeQnuceO6cr4pWh3G5b54k713J6QUM n/Ke/IevSeGazgkUgHXkHJYpDKTjrs7/zDn9BPQpLgdz/W90GtwhwHz4ipyKHRGHIF5s M0t7lha/wYcBa9Zg++w+e3D1o3wGrbaWdI8ahyFG1hlNbYiDFd03QEmioa4I7hpAaOyk yB6g== 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=9tOlW/mQCBtXQDa3gEg9woANHduBZiEYWagDXkEndD4=; b=xB2HSUmu41Qb3CawogWdIDOJ7U378wAM2jU6nwR8ETFB+hTWYW649Fz+r2NtuNaRwG z3Topsy7L5s4FSsB4A8cgZpPwM1c7e7TTWTBLtkfmk48qiVGPQKy8pRuj6x5kYUuXASS uUoBI7XxHD02Ep27PrPA1Xy7a+RWY8Dv1kedlO9Dei67g/mZOjRhPoFaXZ0UCrnG7xgt 7m80tPrC6STDumKWJI2IiZNLq76PqnsSp+TawnUZxR5Bqrix4eoqAKQ8rYjfvW4XAbd5 T7TAWUBI4VOSoWeOqv63MMGgSa7RrbgHdzQifE1VCiizT6dEaINu8zGHQ8AmswhOVmJ4 8szw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lf6tq+XH; 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 q15si12446078jar.110.2021.05.24.08.56.56; Mon, 24 May 2021 08:56:56 -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=lf6tq+XH; 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 S235153AbhEXP6W (ORCPT + 12 others); Mon, 24 May 2021 11:58:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:40466 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234870AbhEXP5X (ORCPT ); Mon, 24 May 2021 11:57:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6435D61951; Mon, 24 May 2021 15:43:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621871011; bh=8UAYECxSB2/SyPk/IQ/Eo++kvlCJAddxyNSq/jyfuTw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lf6tq+XHk4YE6YzK7ekcIa7ubs0vxubuev+MxGFqQIuFY/57VlgFsfeVVFYiUlZBk eJDolvWwVT3rsxlrHoCKYdIXVgJc87g/foh7KcBefyRAPUg0FfxYu/FFZfwf9Y9b47 AV8IKMrf/vCquFJw/UJwsgI9KD8HtAw+EDTHLI2k= 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.12 032/127] locking/lockdep: Correct calling tracepoints Date: Mon, 24 May 2021 17:25:49 +0200 Message-Id: <20210524152335.930163642@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152334.857620285@linuxfoundation.org> References: <20210524152334.857620285@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 f160f1c97ca1..f39c383c7180 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -5731,7 +5731,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; @@ -5749,7 +5749,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;