Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4091312pxb; Mon, 8 Feb 2021 07:45:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJywiRjq5IFKqpSuFGK6icgnaHJH+lXhj1FQQbsA+FlBwuhj39Nu1SyrWu+e6jVtvc1Uv1tg X-Received: by 2002:a05:6402:40c4:: with SMTP id z4mr17351990edb.15.1612799108747; Mon, 08 Feb 2021 07:45:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612799108; cv=none; d=google.com; s=arc-20160816; b=hXwrxS2Tz8S0tPN0syodHGyo2IhHBi28Y1Rb+dNoQW+X1NQghpQdTmGSyB3SjJXbBz st/hM0oHJpL/9DpaZZDbIYDRY5gmbF69atjogDsvvbQ4nwysJYJgfnlqzi++/E54Mfuw TMw3+3syMiMiUc8wLNS4LBBfILYUCN4u042eMhfNMSoMbWksDGau2ve82cCizzu/12VU Bq+X5d+hBdsxqulNhDrlCgtUtiPlAddzdxGYYFOy1it4DnMM+xmigdKFbVNzxTbsNPyg P54IoZD4UtZdj2iyCL2LT03eaG6oxIFVaYpb+BoxEFM1QMxhVGob3S7vjQFsC83wAobH 84Zw== 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=eNseZRf4d2zC4UR/lcV4HXEIAQlKfSoN4cALViBaTAU=; b=BGlDQ0qtRCBkDP0mUfP1k8tZgV3jvYKRAvoNegzqkQOIeIkBM//8KphZ3tCPju3CCr 5JpZ12ynYI3J8HW02zU07SWhP+tlwhzIfjUeoInQlg9+Pmwu/ryYLJIAsjqvgNIBai1z mhhwd/20Im22xmf91QBJVIkOTYWQird7WWtwM8GmsFLrKo+M5f0w8iC+BQelRKXlsqEH Mbk6P9+xlR4lWFZq3xswxJgr5S3nTGLYIf1HhkFCi6K3Y3hY8kMvt04hU8vlliD0+ULN eBcizECOkasvHsTcZ8CYaqbg5h/TtSHvNoOjWagocVPSAH32StjSic/wpulXv2nRPv0H VPDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vmh9KJMY; 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 rn17si13323704ejb.653.2021.02.08.07.44.43; Mon, 08 Feb 2021 07:45:08 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vmh9KJMY; 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 S234083AbhBHPlu (ORCPT + 99 others); Mon, 8 Feb 2021 10:41:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:52608 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232037AbhBHPGD (ORCPT ); Mon, 8 Feb 2021 10:06:03 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2EE9A64ED2; Mon, 8 Feb 2021 15:04:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612796675; bh=atL13egOW38FrfCGbqyZFMt4P86QxvkYrwi6gPPumsY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vmh9KJMYCm6K7AN+/IWgS/Fn4LB1KGlgOQ2iW0r6/Eu4mPEPtyWqwjwncC/EuiAJK 51b1Vm6EOaxxv+bkfppEhuU7ocpuDYG9AbRt/hBHCs/w63pon7U7axc+pOChtU/tgv LqDjbKLRTvz2s8nc9i0/P84pM1tidK9UFxj1BxIU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , "Peter Zijlstra (Intel)" , juri.lelli@arm.com, bigeasy@linutronix.de, xlpang@redhat.com, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, jdesfossez@efficios.com, dvhart@infradead.org, bristot@redhat.com, Thomas Gleixner , Lee Jones Subject: [PATCH 4.9 05/43] futex: Remove rt_mutex_deadlock_account_*() Date: Mon, 8 Feb 2021 16:00:31 +0100 Message-Id: <20210208145806.495995163@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210208145806.281758651@linuxfoundation.org> References: <20210208145806.281758651@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: Peter Zijlstra These are unused and clutter up the code. Signed-off-by: Peter Zijlstra (Intel) Cc: juri.lelli@arm.com Cc: bigeasy@linutronix.de Cc: xlpang@redhat.com Cc: rostedt@goodmis.org Cc: mathieu.desnoyers@efficios.com Cc: jdesfossez@efficios.com Cc: dvhart@infradead.org Cc: bristot@redhat.com Link: http://lkml.kernel.org/r/20170322104151.652692478@infradead.org Signed-off-by: Thomas Gleixner [Lee: Back-ported to solve a dependency] Signed-off-by: Lee Jones Signed-off-by: Greg Kroah-Hartman --- kernel/locking/rtmutex-debug.c | 9 -------- kernel/locking/rtmutex-debug.h | 3 -- kernel/locking/rtmutex.c | 42 +++++++++++++++-------------------------- kernel/locking/rtmutex.h | 2 - 4 files changed, 16 insertions(+), 40 deletions(-) --- a/kernel/locking/rtmutex-debug.c +++ b/kernel/locking/rtmutex-debug.c @@ -173,12 +173,3 @@ void debug_rt_mutex_init(struct rt_mutex lock->name = name; } -void -rt_mutex_deadlock_account_lock(struct rt_mutex *lock, struct task_struct *task) -{ -} - -void rt_mutex_deadlock_account_unlock(struct task_struct *task) -{ -} - --- a/kernel/locking/rtmutex-debug.h +++ b/kernel/locking/rtmutex-debug.h @@ -9,9 +9,6 @@ * This file contains macros used solely by rtmutex.c. Debug version. */ -extern void -rt_mutex_deadlock_account_lock(struct rt_mutex *lock, struct task_struct *task); -extern void rt_mutex_deadlock_account_unlock(struct task_struct *task); extern void debug_rt_mutex_init_waiter(struct rt_mutex_waiter *waiter); extern void debug_rt_mutex_free_waiter(struct rt_mutex_waiter *waiter); extern void debug_rt_mutex_init(struct rt_mutex *lock, const char *name); --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c @@ -956,8 +956,6 @@ takeit: */ rt_mutex_set_owner(lock, task); - rt_mutex_deadlock_account_lock(lock, task); - return 1; } @@ -1365,8 +1363,6 @@ static bool __sched rt_mutex_slowunlock( debug_rt_mutex_unlock(lock); - rt_mutex_deadlock_account_unlock(current); - /* * We must be careful here if the fast path is enabled. If we * have no waiters queued we cannot set owner to NULL here @@ -1432,11 +1428,10 @@ rt_mutex_fastlock(struct rt_mutex *lock, struct hrtimer_sleeper *timeout, enum rtmutex_chainwalk chwalk)) { - if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) { - rt_mutex_deadlock_account_lock(lock, current); + if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) return 0; - } else - return slowfn(lock, state, NULL, RT_MUTEX_MIN_CHAINWALK); + + return slowfn(lock, state, NULL, RT_MUTEX_MIN_CHAINWALK); } static inline int @@ -1448,21 +1443,19 @@ rt_mutex_timed_fastlock(struct rt_mutex enum rtmutex_chainwalk chwalk)) { if (chwalk == RT_MUTEX_MIN_CHAINWALK && - likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) { - rt_mutex_deadlock_account_lock(lock, current); + likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) return 0; - } else - return slowfn(lock, state, timeout, chwalk); + + return slowfn(lock, state, timeout, chwalk); } static inline int rt_mutex_fasttrylock(struct rt_mutex *lock, int (*slowfn)(struct rt_mutex *lock)) { - if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) { - rt_mutex_deadlock_account_lock(lock, current); + if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) return 1; - } + return slowfn(lock); } @@ -1472,19 +1465,18 @@ rt_mutex_fastunlock(struct rt_mutex *loc struct wake_q_head *wqh)) { WAKE_Q(wake_q); + bool deboost; - if (likely(rt_mutex_cmpxchg_release(lock, current, NULL))) { - rt_mutex_deadlock_account_unlock(current); + if (likely(rt_mutex_cmpxchg_release(lock, current, NULL))) + return; - } else { - bool deboost = slowfn(lock, &wake_q); + deboost = slowfn(lock, &wake_q); - wake_up_q(&wake_q); + wake_up_q(&wake_q); - /* Undo pi boosting if necessary: */ - if (deboost) - rt_mutex_adjust_prio(current); - } + /* Undo pi boosting if necessary: */ + if (deboost) + rt_mutex_adjust_prio(current); } /** @@ -1682,7 +1674,6 @@ void rt_mutex_init_proxy_locked(struct r __rt_mutex_init(lock, NULL); debug_rt_mutex_proxy_lock(lock, proxy_owner); rt_mutex_set_owner(lock, proxy_owner); - rt_mutex_deadlock_account_lock(lock, proxy_owner); } /** @@ -1698,7 +1689,6 @@ void rt_mutex_proxy_unlock(struct rt_mut { debug_rt_mutex_proxy_unlock(lock); rt_mutex_set_owner(lock, NULL); - rt_mutex_deadlock_account_unlock(proxy_owner); } /** --- a/kernel/locking/rtmutex.h +++ b/kernel/locking/rtmutex.h @@ -11,8 +11,6 @@ */ #define rt_mutex_deadlock_check(l) (0) -#define rt_mutex_deadlock_account_lock(m, t) do { } while (0) -#define rt_mutex_deadlock_account_unlock(l) do { } while (0) #define debug_rt_mutex_init_waiter(w) do { } while (0) #define debug_rt_mutex_free_waiter(w) do { } while (0) #define debug_rt_mutex_lock(l) do { } while (0)