Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1829556pxb; Thu, 16 Sep 2021 17:10:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxt9dA+IghK/N9/eHhEAlIm25NJt1l/RquPw322Spf8wBKVoPyvh+q6fBIWZD1rRbm3X35d X-Received: by 2002:a92:194b:: with SMTP id e11mr5730374ilm.200.1631837441865; Thu, 16 Sep 2021 17:10:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631837441; cv=none; d=google.com; s=arc-20160816; b=QtFl6YA7EHlPMDoW+iMIPxlOa6H/pfo8ULaboJldTheFTg5VxSL84AOEywFQw3rrbS WL0FOIshTCViXeF+YdmQ1dwtlSUmncVIPh3aaeFHIx43BO0SSpDKL4nXQ7t5KSjS32yd hSYvcGND/JsMJ2i2Ih/hEk4Fsws705O5q66t3DM5Ckv2erw1euYy9jojrAuO0KTz5KSA Ya1C1CxoykY0FNvpc7FJCF2j2Qo9x4bjc1+QLGn5wOwTf6m8dLcDwQB0/wJcZJGD5lri egpzRjtmHG44sAefeTPOBbTFA6HidX8ax1GK96DJcIGp855atAKl1x9eNn8JEqLCX7A3 fYUg== 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=yz5pY5lJS7BUxXXmkrfxJwbsy6WDIJRdHzP0knTuJcs=; b=o929qd2okZk3IECh4EZUjK+Cuhao98Goc2sGkQwE6ZDT+koR1JTA/1GVQSWWuY92Z3 pIUtXlzT9aCNI0pYJW7Y7urZW/WUvOd9ZH7N37uEEiTNtiTffw9XQ87kcZDeyHHvqbYU LCjz/QLzJ5fXQgbViXlhbn0PZvnzK34FT5O6Gmxbt7f+DUXbEyinIO7OBVpuI0CYxKyP x6d2qwSiZAba4ag7LAfmN0xtus7rZKMF95ibrAvoYrbCc4eGplUu1Nz8B+YNBPUUwid9 5c/D5G0kQwaLyW4CL2Bq5bqyRKKCiuNlnUhDhgz5I+2RaBBsXguYs0/8gQoNK/GS6rHp fSjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ix4vGfxd; 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; 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 m12si1693155ioj.101.2021.09.16.17.10.28; Thu, 16 Sep 2021 17:10:41 -0700 (PDT) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ix4vGfxd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348710AbhIPRDI (ORCPT + 99 others); Thu, 16 Sep 2021 13:03:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:40180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241111AbhIPQyK (ORCPT ); Thu, 16 Sep 2021 12:54:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 526DD61AA5; Thu, 16 Sep 2021 16:29:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631809796; bh=7+34lJuA8T+mx98Ol2bt76efZapjIJYr/sKnp1rvVO4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ix4vGfxdY7krwrERtHLWd5gam6l6v+9omVPxFUNRKUgkMTvkBaYGiNY5FecMOfl9k pMR4HIPFsJgstOIcKeyYXzBtttfRemhWDNDP84FnXB1vMKuvh/ZW3A+EK8iibe3R4l 3pbal3EOZLdFCNpFRdsULD4NoJMTaaE9PemXv9s4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Gleixner , "Peter Zijlstra (Intel)" , Ingo Molnar , Sasha Levin Subject: [PATCH 5.13 279/380] locking/rtmutex: Set proper wait context for lockdep Date: Thu, 16 Sep 2021 18:00:36 +0200 Message-Id: <20210916155813.571901669@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155803.966362085@linuxfoundation.org> References: <20210916155803.966362085@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Gleixner [ Upstream commit b41cda03765580caf7723b8c1b672d191c71013f ] RT mutexes belong to the LD_WAIT_SLEEP class. Make them so. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210815211302.031014562@linutronix.de Signed-off-by: Sasha Levin --- include/linux/rtmutex.h | 19 ++++++++++++------- kernel/locking/rtmutex.c | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h index d1672de9ca89..87b325aec508 100644 --- a/include/linux/rtmutex.h +++ b/include/linux/rtmutex.h @@ -52,17 +52,22 @@ do { \ } while (0) #ifdef CONFIG_DEBUG_LOCK_ALLOC -#define __DEP_MAP_RT_MUTEX_INITIALIZER(mutexname) \ - , .dep_map = { .name = #mutexname } +#define __DEP_MAP_RT_MUTEX_INITIALIZER(mutexname) \ + .dep_map = { \ + .name = #mutexname, \ + .wait_type_inner = LD_WAIT_SLEEP, \ + } #else #define __DEP_MAP_RT_MUTEX_INITIALIZER(mutexname) #endif -#define __RT_MUTEX_INITIALIZER(mutexname) \ - { .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \ - , .waiters = RB_ROOT_CACHED \ - , .owner = NULL \ - __DEP_MAP_RT_MUTEX_INITIALIZER(mutexname)} +#define __RT_MUTEX_INITIALIZER(mutexname) \ +{ \ + .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock), \ + .waiters = RB_ROOT_CACHED, \ + .owner = NULL, \ + __DEP_MAP_RT_MUTEX_INITIALIZER(mutexname) \ +} #define DEFINE_RT_MUTEX(mutexname) \ struct rt_mutex mutexname = __RT_MUTEX_INITIALIZER(mutexname) diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c index 3c20afbc19e1..ae5afba2162b 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c @@ -1556,7 +1556,7 @@ void __sched __rt_mutex_init(struct rt_mutex *lock, const char *name, struct lock_class_key *key) { debug_check_no_locks_freed((void *)lock, sizeof(*lock)); - lockdep_init_map(&lock->dep_map, name, key, 0); + lockdep_init_map_wait(&lock->dep_map, name, key, 0, LD_WAIT_SLEEP); __rt_mutex_basic_init(lock); } -- 2.30.2