Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2526661rbb; Wed, 28 Feb 2024 04:53:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXjC5IxlrumfoffMY3I5mwHPhnYPlbX3tnhdINtOTuQbxCG/0LMGzMAbufj4VTVboRxhetwhlad4kFkspoID28wVSmxO+uFRKmvNf9ddA== X-Google-Smtp-Source: AGHT+IGjtKMm9rXZsbKey++KMJZGgB+SgjqmCT65oZ8Am+GUE0b8A9FhdsfYgQZUYY3fMTYMTc8t X-Received: by 2002:a17:906:b06:b0:a44:820:690c with SMTP id u6-20020a1709060b0600b00a440820690cmr941750ejg.2.1709124839194; Wed, 28 Feb 2024 04:53:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709124839; cv=pass; d=google.com; s=arc-20160816; b=0Wfn1kK4/9fMOIzndM32w3eV4gqso2lb627f/cykFP4mxThTvCe/Gks1fgFZfbm/yS xSdmx+fdwEEGpz0WnfIWrxlGNs+kt4dKzpQl7EHulYeNqUuyooWjjqZXWr3e+OaUk+no KBqUfNlValCyMLECiq8zMWpHz15N4oKhjlIximIoh/WUwgq1UPLDul0W04CwNoOg9rGz w1anA1mySu5snlFXeBw8ku272NecPGou7LdfdAVY6RRhROCLEd3elLK5r4ZxekBcw4pK 5lDAamolJhm1z0vbogGG6RQ6GhOhXUw5oViW48OYeP87LaS+k3XaMCXsQgEO8cDhILvh YY/w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=QkfdDJ39k9nOfQhuzJnliw8RyOAojcJmrIWCgIKx7Q4=; fh=Lf2ys8B8adCSgbeQ6sCsOsgkPFRdsgLwbTH2Fa2dGSU=; b=uI5JDR9ppGz2EPY7ve7Zb5B3eukDlfqVZmcMy+A8pHu1KRm6DjXdejR0xgT4/ZcHPJ hmfF8PVM44/rd9SGMhDb49fW7MSrc77AsTlzaALwR2k446U7Kxb/8zIHUN97QP8gVYKa dTIMH5eGGA54PpO8mBrFWKBuuLms7E97jBYUUbV7S9a0QN7toCMPcsBZEzcdH8o5cECQ hoAVIg2vzd+ZcaZDpszko+gSAWZ8i9AZGHUhDWqJtdewze40PkwL4j83oHQGP/Ec5dQA d/SBNykojJB3wB5gm7kzAjzpnEJq1kKndBa2DhN2Pu45LVnrbw7qk402zjRVFdJpKhnm a6zQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=UEJL73yD; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-85041-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85041-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id va4-20020a17090711c400b00a441fa30fe6si62585ejb.767.2024.02.28.04.53.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 04:53:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85041-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=UEJL73yD; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-85041-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85041-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id ECC3E1F26D3C for ; Wed, 28 Feb 2024 12:53:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B266514D420; Wed, 28 Feb 2024 12:53:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="UEJL73yD"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="94teTech" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 676E1148FF4; Wed, 28 Feb 2024 12:53:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709124806; cv=none; b=Z66rYL3dmxzXHHc6aJMEJVgj3ifjXce84GAhtBwHro9oVa4E9YXMFkE4jmHcUIEz8eJ5l97BNnOgdVm+h+ROeEQE290kgBPuU5ApeEfOneYcY2XZscdEJDxE+C+DTeqaGsJ2DKgxb4jTY/kX7kaBWHqiB7fJ0wVZ73xIy1mDTW8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709124806; c=relaxed/simple; bh=C3vOKNNRVeN2kWDi7R/yUhn0sjrmnGVWSAwCCZmLsUw=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=s3D62EMDa2esr3dQnF4/G4h5KMcT2doT3v7/406lvl/k9MUoBECxKNy4I8Vy2na9ZyQookVbeafOHLy4C4lJv/BJuQQlmJVbma32jXqNTlzwOMlgygR99loIYp9wMQXvh8f1QW/ub471y97sMdnBnHnVkqvHJNeyhm98fGnzizA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=UEJL73yD; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=94teTech; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Wed, 28 Feb 2024 12:53:22 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1709124803; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QkfdDJ39k9nOfQhuzJnliw8RyOAojcJmrIWCgIKx7Q4=; b=UEJL73yDG/2ara8SPcY4ceh24+o+MPechCmOxbyFQ1C+b6h4BppEJ9KVpTF5m75JQHU5se ki2p7n/vxItBit+ifv8ebQXlYNtsmb07Nt0KJmvMdwSEx8Ut01Ma/AqDkHagpq81DsNwYe gG0sl0uIITChwTYpq4LZf1+IL8LwRRDK1bCr7Kk6yh3HkkXWSx27yjdAD+kKTSkLDRYaho sIT/1b6ev62xA4z3mUo0RchQ7EK7EgrFODGBbj9nVZV1V6mz1eTU5N2igbVmL4FbQ+ig7k Gr4PYtTz/tZTZH021lDhZuVnN+Q/npwJSKfQXOhw4lvFDMym4xhzm1Ks+HQH4w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1709124803; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QkfdDJ39k9nOfQhuzJnliw8RyOAojcJmrIWCgIKx7Q4=; b=94teTech2HnXFs1VXoigDJD/ONMVvQF9w8+xxdgeRDFM0NKxoroat/W8+aWSCMGNbv5CPV pDGnqsvWJI54PPBw== From: "tip-bot2 for Waiman Long" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/core] locking/mutex: Simplify Cc: Waiman Long , Ingo Molnar , Boqun Feng , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240222150540.79981-3-longman@redhat.com> References: <20240222150540.79981-3-longman@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170912480286.398.2593451967158120773.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the locking/core branch of tip: Commit-ID: d6cac0b6b0115fd0a5f51a49401473626e4e4fe7 Gitweb: https://git.kernel.org/tip/d6cac0b6b0115fd0a5f51a49401473626e4e4fe7 Author: Waiman Long AuthorDate: Thu, 22 Feb 2024 10:05:38 -05:00 Committer: Ingo Molnar CommitterDate: Wed, 28 Feb 2024 13:08:37 +01:00 locking/mutex: Simplify CONFIG_DEBUG_MUTEXES and CONFIG_PREEMPT_RT are mutually exclusive. They can't be both set at the same time. Move up the mutex_destroy() function declaration and the __DEBUG_MUTEX_INITIALIZER() macro above the "#ifndef CONFIG_PREEMPT_RT" section to eliminate duplicated mutex_destroy() declaration. Also remove the duplicated mutex_trylock() function declaration in the CONFIG_PREEMPT_RT section. Signed-off-by: Waiman Long Signed-off-by: Ingo Molnar Reviewed-by: Boqun Feng Link: https://lore.kernel.org/r/20240222150540.79981-3-longman@redhat.com --- include/linux/mutex.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/include/linux/mutex.h b/include/linux/mutex.h index 7e208d4..67edc4c 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h @@ -32,11 +32,9 @@ # define __DEP_MAP_MUTEX_INITIALIZER(lockname) #endif -#ifndef CONFIG_PREEMPT_RT - #ifdef CONFIG_DEBUG_MUTEXES -#define __DEBUG_MUTEX_INITIALIZER(lockname) \ +# define __DEBUG_MUTEX_INITIALIZER(lockname) \ , .magic = &lockname extern void mutex_destroy(struct mutex *lock); @@ -49,6 +47,7 @@ static inline void mutex_destroy(struct mutex *lock) {} #endif +#ifndef CONFIG_PREEMPT_RT /** * mutex_init - initialize the mutex * @mutex: the mutex to be initialized @@ -101,9 +100,6 @@ extern bool mutex_is_locked(struct mutex *lock); extern void __mutex_rt_init(struct mutex *lock, const char *name, struct lock_class_key *key); -extern int mutex_trylock(struct mutex *lock); - -static inline void mutex_destroy(struct mutex *lock) { } #define mutex_is_locked(l) rt_mutex_base_is_locked(&(l)->rtmutex)