From patchwork Tue Feb 13 03:16:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waiman Long X-Patchwork-Id: 200195 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp302762dyb; Mon, 12 Feb 2024 19:18:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IHDLeT1gBGcoj6H2WCBeaSV1cSPmEo2X295X4MHTp5zM4TlxeGm9FuOQC+ZzwPeqEbbPTL2 X-Received: by 2002:a25:c788:0:b0:dc7:48a1:3ad with SMTP id w130-20020a25c788000000b00dc748a103admr8316432ybe.29.1707794328352; Mon, 12 Feb 2024 19:18:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707794328; cv=pass; d=google.com; s=arc-20160816; b=ebEbKlFT3RoAxNFw7eo7z/STplNXQMxLjFk66fu01BA8W3PlzMC4TLo/iYY61RKZkg vHvLphNReRKJrIl6eIm/YlDGNkYIvPEb32SRPF1ScFWJF05tFgzj6VdvAC1affH+j/xI OZ9sNyB7qaXBm9miQrsT+NOLaYDJDK7M5WgD7es7evyiO9NmhivX2YPatjw68zeY7gUg pfbgcqDS9K+l/29PsnRw1ealzWz+LgSPqpC39wH4XeKmf912I3EGr/uwKnt0pruNcOM4 YPvIGuh3trutStsNBHUY3Yjs1AQak+OOPP7M8MmB+M5wTBZ6eTzff+26Z25p1r7FRuh3 Qh4g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=KJtQOCSLbtCyrptuxIvNN7xHcs9vT9tWJNF1nm9qSgs=; fh=Hk3QSHY67QecfZ13tzHSGQMFgTBvaHOImYCWZJZ2BSw=; b=U+2+z1bJWQejq0V8FKiHtScOYJXVjMuwP9ftGKLIB0YCDQbL0CFqRMovWPj/8o21h9 sqOZH7krPlgHZ6DxnrJG/W2A05d5pQsIsgvI8WgfQO5AiF1+sNMvypU9DVz6U3p/DDsK V+R0Hgc1NogVEEGsiFk76Uqci0q8F0bQCfb5c0R4m9UtxOTggefsqXMpMxO0g/Amci/Y buIRyMh9ta4ne8Bi0IrbHEUjhA6Az7Z+SxYZe7E/evBv0FrExNewNdbS04C/XmCu6pdy tHrVqaa9i58kJ5JtCdyjPAS19QLJD2JKwofg9PNEkklDGV5/rr+Nb2JqgXLAhQWsds7T 1wCQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EEOgOMIV; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-62900-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62900-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=2; AJvYcCWI/d4Ekvh+WzhpZmdiDWMJh2ll+GauU1TUvV6cpl0afGwSD7jpPXW4vTBNaZOsltkyoLpWTxKkNzz4j0M9SUpdXZsHvw== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d15-20020a056a00198f00b006d9a95b62d8si5986409pfl.277.2024.02.12.19.18.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 19:18:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62900-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EEOgOMIV; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-62900-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62900-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id F3482B24E9A for ; Tue, 13 Feb 2024 03:18:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 680CC10A1F; Tue, 13 Feb 2024 03:17:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="EEOgOMIV" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 EC19D8C0B for ; Tue, 13 Feb 2024 03:17:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707794236; cv=none; b=t9Dvm6ZdVEWLEYVxL0yE49cSHBkY1VCNT87T8Z2sk+JsjOlIcdEpKX9RxOM3dPeqG9rZLRyX+J57QlzDytdznB2TVVJxwBYExuisoz4yMkbiO+yFZyiJkPn8eGErVIPgcj5t9v+kvPCHMDA9Cto62CxFvdP9MdDjhbtg5GBPknk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707794236; c=relaxed/simple; bh=d7iQUrDMIH4V0V8AYVQKlZ+76ZsY0HbBL3eK0bUgED0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=arjzErPQitbKccQ7tgBSbXE+Z5ghCAe740nOGs+2r5UAEyLbUTl6pl233dLqYyplttu6zsYdf7p5AU8dzrRjkNGA8hibl1dmZiHQtrExq28AUy/SitgpMX+JI5XRE6DY1+2SQaHUpr/zsyoSw/ATTOHNdMuZW2RTbkQEUNl9gMw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=EEOgOMIV; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707794233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KJtQOCSLbtCyrptuxIvNN7xHcs9vT9tWJNF1nm9qSgs=; b=EEOgOMIVxVXAjvmxIflvZnq8BLWlRXoaLKrItYd0h2QUXPLCY4f35lLzPz2BWb0Oes72s7 u14vc/v+5ZnYWZUlnkL3ljj8klnS8mLndlQ5bJz1bJFDrvO9n90peBiTGwXUWMK/Hk8I1A NgIy1NAdBMb0kjbDjGNvRQVhPBX0brc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-482-rjXgcXF4ML-s5EbS2O7hIQ-1; Mon, 12 Feb 2024 22:17:09 -0500 X-MC-Unique: rjXgcXF4ML-s5EbS2O7hIQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 25A71811E79; Tue, 13 Feb 2024 03:17:09 +0000 (UTC) Received: from llong.com (unknown [10.22.33.62]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C9CEAC1C; Tue, 13 Feb 2024 03:17:08 +0000 (UTC) From: Waiman Long To: Peter Zijlstra , Ingo Molnar , Will Deacon , Boqun Feng , Andrew Morton Cc: linux-kernel@vger.kernel.org, George Stark , Waiman Long , kernel test robot Subject: [PATCH 1/4] locking/qspinlock: Fix 'wait_early' set but not used warning Date: Mon, 12 Feb 2024 22:16:53 -0500 Message-Id: <20240213031656.1375951-2-longman@redhat.com> In-Reply-To: <20240213031656.1375951-1-longman@redhat.com> References: <20240213031656.1375951-1-longman@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790752145440279042 X-GMAIL-MSGID: 1790752145440279042 When CONFIG_LOCK_EVENT_COUNTS is off, the wait_early variable will be set but not used. This is expected. Recent compilers will not generate wait_early code in this case. Add the __maybe_unused attribute to wait_early for suppressing this W=1 warning. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202312260422.f4pK3f9m-lkp@intel.com/ Signed-off-by: Waiman Long Reviewed-by: Boqun Feng --- kernel/locking/qspinlock_paravirt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/locking/qspinlock_paravirt.h b/kernel/locking/qspinlock_paravirt.h index 6a0184e9c234..ae2b12f68b90 100644 --- a/kernel/locking/qspinlock_paravirt.h +++ b/kernel/locking/qspinlock_paravirt.h @@ -294,8 +294,8 @@ static void pv_wait_node(struct mcs_spinlock *node, struct mcs_spinlock *prev) { struct pv_node *pn = (struct pv_node *)node; struct pv_node *pp = (struct pv_node *)prev; + bool __maybe_unused wait_early; int loop; - bool wait_early; for (;;) { for (wait_early = false, loop = SPIN_THRESHOLD; loop; loop--) { From patchwork Tue Feb 13 03:16:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waiman Long X-Patchwork-Id: 200196 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp302847dyb; Mon, 12 Feb 2024 19:19:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV7Jtwa6JCg+eKtyUXZmLcSJv5CvBRjI3qljjlx+3wCu3U+mS2fvu9Wy4Kv7I64Je3tKMBhEKsCO+VhGFppz3sdHQA3ig== X-Google-Smtp-Source: AGHT+IGeo4ewz0jgfQ9e7Cpd+4477DJLIP+m4ebrkXN5nVro5/3bh6Fm+vq4YjDu2VGWAp+uvwps X-Received: by 2002:a62:d116:0:b0:6e0:9e94:d085 with SMTP id z22-20020a62d116000000b006e09e94d085mr6755663pfg.14.1707794346564; Mon, 12 Feb 2024 19:19:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707794346; cv=pass; d=google.com; s=arc-20160816; b=zHkZQB1aGblQFEsqbircC5kmUNoYdp+Y8/3CbroJHv5iN01Z54rhtsw3L51BIKdxiu UgE9vVLqDkZZHg883S8VlsxBjn6GVPkGKPC32uogZYRBlqp+8PqRrPMRNB0xSSh7idXA LN5gRHNq0OOYElCACYcYiY26mXQLWhx7FGdwHxDegUXA7KwDlUxRQldzSm6gyyDQ3A+a 1Y9iQYu28YyitzE8yEl96TI1nKPgARk7NSX9/rx4NkBWjj0LcpNq7Gw4zSOh96XVwosD 6rczZtb7gljm7WcX+3pPtaOXOHNmTMBWME5ZGdeEmgnCTsHAwWlw6Np11ICYATl5WkG4 svuA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=+ZLAjPV7sebbsvd3xDxbWzhrfTLokZC3AjL5a7aPY+Y=; fh=eLEPFqYjkfjjDsSYQI+hE9zo8C079RFJhecav0npYPo=; b=gpYsGTujmtVap/HSlkNpMdoSWJnvSNYJ2np8hljPhMRm8otbB2ZD0HlZ3WMbrgesJ7 p1NqBGhOlE93rfq6Gkrvajm1BlXrqy3ZRAleuN7w1LyUXHnL7G3hTtCvNdS4znmtciS9 2A/iv3QRAT3RIJNtAMdC8PTeHIskjvgztIWUNAR8N2gowFAazto74d0O5wctZs1P0vdp /vN3whloE46/KSnv/3J4rqF7cGOIkr7D1mU8eWJCMiWdl8XfgWeqpisE/nQCLQrq/3/w uwS9qjcbK56wxrPRtX3QgclgTqH9pDYczDWa1mIFGmEr/jvsiIkdQ1QhVHiAEDOMgFOr rBsg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SoIbIFy0; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-62901-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62901-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=2; AJvYcCVnlNFdh3xnCFap/0JSVRqd8aDtA7ZaZTscz0MSYYoj8SBDIa09AkWfvJiiR/WYzSEKsFvZeD8oCm9frZlKwzA/X0eOOw== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id e19-20020a637453000000b005dc4fbfb9acsi1277975pgn.583.2024.02.12.19.19.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 19:19:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62901-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SoIbIFy0; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-62901-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62901-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id BE352B24060 for ; Tue, 13 Feb 2024 03:18:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D34F111A8; Tue, 13 Feb 2024 03:17:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="SoIbIFy0" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 C899D8F45 for ; Tue, 13 Feb 2024 03:17:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707794237; cv=none; b=TIEOl+eQEZjGTdLHbJLT3Km5ctV6B8gQWl7+Ygzw7+/ciFLC9svbingvQBWnatlFpLRvnq5CIulO1fy9sSo3dkDxh8wVsL6EO+C7XiXNchiJacm8GjlJl1xw1ScPn+7yDx7zOte8gEKuBPa5tgHZ+BbhndwwWzEBEOQ1ybcHR5w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707794237; c=relaxed/simple; bh=HXgAfo4uLv8GHveOmo7cI+pvGtWKUeM5tq7f0Ae9cDY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ue6m6bgCNRse0Sr2ozvvUxqK2NxZKMhuQY0DX13KRq36mlzi/lK/72EUlKkdm1avU9C/d5scREVfurSZPjOJ+2qMdmjXM36BET/VYYXXZZ4M+ukItS0UK195dVL813a9b41h95g0mmqT3X5dRvDMjRTYrcfRAO3NrnfocEsYTCQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=SoIbIFy0; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707794234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+ZLAjPV7sebbsvd3xDxbWzhrfTLokZC3AjL5a7aPY+Y=; b=SoIbIFy00MRExQf/nTtuyp/eySoduL8ezkRRpBHQeGfvwg7qUpwmHq5m4Wwf4XNQC/PqA8 EkUPMrxIorc1bn08kPAeKvKm8QcEvGQ1Q0Ye/A+zpyd/TDQY+kMSqpdroYAMynMTBVFLXQ IodDounHEI5CD5Sr0nCGSHWMYD0vlTo= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-61-24-9Ov5uO6qJIF2hSkLm6A-1; Mon, 12 Feb 2024 22:17:10 -0500 X-MC-Unique: 24-9Ov5uO6qJIF2hSkLm6A-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DA4F7383CCE4; Tue, 13 Feb 2024 03:17:09 +0000 (UTC) Received: from llong.com (unknown [10.22.33.62]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37B60AD69; Tue, 13 Feb 2024 03:17:09 +0000 (UTC) From: Waiman Long To: Peter Zijlstra , Ingo Molnar , Will Deacon , Boqun Feng , Andrew Morton Cc: linux-kernel@vger.kernel.org, George Stark , Waiman Long Subject: [PATCH 2/4] locking/mutex: Clean up mutex.h Date: Mon, 12 Feb 2024 22:16:54 -0500 Message-Id: <20240213031656.1375951-3-longman@redhat.com> In-Reply-To: <20240213031656.1375951-1-longman@redhat.com> References: <20240213031656.1375951-1-longman@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790752165167551171 X-GMAIL-MSGID: 1790752165167551171 CONFIG_DEBUG_MUTEXES and CONFIG_PREEMPT_RT are mutually exclusive. They can't be both set at the same time. Move down the mutex_destroy() function declaration to the bottom of mutex.h 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 Reviewed-by: Boqun Feng --- include/linux/mutex.h | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/include/linux/mutex.h b/include/linux/mutex.h index 7e208d46ba5b..bad383713db2 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h @@ -35,18 +35,10 @@ #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); - #else - # define __DEBUG_MUTEX_INITIALIZER(lockname) - -static inline void mutex_destroy(struct mutex *lock) {} - #endif /** @@ -101,9 +93,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) @@ -170,6 +159,16 @@ extern void mutex_unlock(struct mutex *lock); extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock); +#ifdef CONFIG_DEBUG_MUTEXES + +extern void mutex_destroy(struct mutex *lock); + +#else + +static inline void mutex_destroy(struct mutex *lock) {} + +#endif + DEFINE_GUARD(mutex, struct mutex *, mutex_lock(_T), mutex_unlock(_T)) DEFINE_GUARD_COND(mutex, _try, mutex_trylock(_T)) DEFINE_GUARD_COND(mutex, _intr, mutex_lock_interruptible(_T) == 0) From patchwork Tue Feb 13 03:16:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waiman Long X-Patchwork-Id: 200194 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp302738dyb; Mon, 12 Feb 2024 19:18:42 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUFpDWUG7XUnRQkS7Yyz6e+/NkXiF7lsgGfgI4tk7F5diQyy0iq8vrJN8uEmBNwkHDJj+7JF58tdhmhXuY7HPFVX8L9WA== X-Google-Smtp-Source: AGHT+IFOcs7GJhO3yIM4SHhO/lccFxwcaEasN9+qxwv6USS/CbjOdrKPiyo2XDx+ZODh+iiWbKID X-Received: by 2002:a05:6402:22d0:b0:561:f601:e621 with SMTP id dm16-20020a05640222d000b00561f601e621mr280055edb.12.1707794322661; Mon, 12 Feb 2024 19:18:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707794322; cv=pass; d=google.com; s=arc-20160816; b=lQqZC7zGkpBdnQTifhcIkP1HGxHGIi1LWw6wgImzJlsx366V9EREVX4QOSubk1skTp iYkYpvBft9K7QfJwT0Ql/0CTgZq3Pf0Unlr579pGb+pARpc8Olk/UIbFrall/Motm1bs qJdI3ZiZ6KzClfvkQDU4wVvHQsHhLcc17lnMBPlQeUmpBzH2AmdX/V3Ss1NzCt60I6tn Wc1J/7z4LrbiNOt51UiwpcxSGNN+vpcJc9GV34VH7SPKWpWhdenKzRn2XU9833yfVDpf kXBYeqIQsPyLN4uNCPwag5hI1p5izFEub2/v9Z6/hT529XUd6uLbSRAroAjgRojHCt+4 xjuA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=X+mW6S3E9PxzlJ59KYM6a9lo9aW4LQzFCn0v6EM+0/M=; fh=suPy89/IXdjqM6u10BB3IsFflVBlubcB9VAOtErBbQk=; b=i0GVEI5rSs/kBnb2gPHsKUH3kYG0DAhPJIr2YlipAziWa2i4Px1YzA78qRPieOAixc kscvP0nOuw+hoH4m8zFeEgVOzR0B2WYSnWUvn7fIuOXf6wrvN3Ka1+fwFL5bs4IB6MXN P/3+XxVXQHd3vxwxtXnKR4+++xqm1HSNlkPPH8xUOfxzC43qQadVEH4Y37mDG0qBnGTF 9ynNgkM6Jvu/FpSs8kYiw5RrVGG3VMYzpjnu1UVi54j0o83YIAHGnuPfdztnaQCw8cr9 q5ek6cclDOVc5n3PCb6M0eib7NDZgxub4GE6fskHqq+lr3m5mz98ZgW6GlvF1OrnK6bQ nwKQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=O0yr4g1C; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-62902-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62902-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=2; AJvYcCV2mmCGvk1+uU3As7mvST/pbqHQhCeXpTv/O06wIE8aYXpTWCGNqXQYXb9JigtCJTGQWL2p7TTuXSTqJdVdDKvtOLnh7Q== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id i9-20020a056402054900b005601034b5e1si3464014edx.478.2024.02.12.19.18.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 19:18:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62902-ouuuleilei=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=@redhat.com header.s=mimecast20190719 header.b=O0yr4g1C; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-62902-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62902-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 47AF41F233F4 for ; Tue, 13 Feb 2024 03:18:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 43FD711721; Tue, 13 Feb 2024 03:17:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="O0yr4g1C" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 1F264AD4B for ; Tue, 13 Feb 2024 03:17:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707794238; cv=none; b=SAxH0k2vbauNqyPds1GbOOgV0/RH0FNBXaTU2SlAsWLdkENV6He8MIF/2zhDe9s1JuCjfGEexzYq78lHxP4ai5LD7rMMTtvnJ2jv5KdC6nNrHgEbNpQwFpqRv3I4mBbSoUwohcspFFqxHK4ge64b6nSUy5VHE3oK0OnrswVf+EE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707794238; c=relaxed/simple; bh=MANijGulv75x4C4ug9+yfGSrwL6bUaWQqE7f9b4Kc/k=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=a/WYNMlMDscydc5bPs0ygMSofiHoBkhdlCjKHUzQec9ONZOnyQMx/PG4sqbyCOaiKGA7N4ME3HQ17OG15n2zB7zZFPky75s/MsEg899RSDmNG0+nM+F1heYBVLI+PcMaQ4uQsfDujMIcSR9ZyXvQ8q+rwql1svtA+X6HVydgcnA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=O0yr4g1C; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707794235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=X+mW6S3E9PxzlJ59KYM6a9lo9aW4LQzFCn0v6EM+0/M=; b=O0yr4g1Cc/HbKi184Bvb9E2ZhMF+HGOqMl9XDz8a2dSHx/SH1d6SOeFNEl1mWSM4/e4HAD LS7nVBckVw/Sxpg3YK1FN5sv89/DHu6JxW4UqX9RHcOiuoZtxu8UxDCkulzhHn5BWEXzly vRdEeotpUD/MiXLkP9ABBuiNJnXkRFw= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-240-vH9Kdgq5OdyB4buqj1ei4A-1; Mon, 12 Feb 2024 22:17:11 -0500 X-MC-Unique: vH9Kdgq5OdyB4buqj1ei4A-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 958DA3C02744; Tue, 13 Feb 2024 03:17:10 +0000 (UTC) Received: from llong.com (unknown [10.22.33.62]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB8A6AC17; Tue, 13 Feb 2024 03:17:09 +0000 (UTC) From: Waiman Long To: Peter Zijlstra , Ingo Molnar , Will Deacon , Boqun Feng , Andrew Morton Cc: linux-kernel@vger.kernel.org, George Stark , Waiman Long Subject: [PATCH 3/4] locking/rwsem: Clarify that RWSEM_READER_OWNED is just a hint Date: Mon, 12 Feb 2024 22:16:55 -0500 Message-Id: <20240213031656.1375951-4-longman@redhat.com> In-Reply-To: <20240213031656.1375951-1-longman@redhat.com> References: <20240213031656.1375951-1-longman@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790752139764421573 X-GMAIL-MSGID: 1790752139764421573 Clarify in the comments that the RWSEM_READER_OWNED bit in the owner field is just a hint, not an authoritative state of the rwsem. Signed-off-by: Waiman Long Reviewed-by: Boqun Feng --- kernel/locking/rwsem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c index 2340b6d90ec6..c6d17aee4209 100644 --- a/kernel/locking/rwsem.c +++ b/kernel/locking/rwsem.c @@ -35,7 +35,7 @@ /* * The least significant 2 bits of the owner value has the following * meanings when set. - * - Bit 0: RWSEM_READER_OWNED - The rwsem is owned by readers + * - Bit 0: RWSEM_READER_OWNED - rwsem may be owned by readers (just a hint) * - Bit 1: RWSEM_NONSPINNABLE - Cannot spin on a reader-owned lock * * When the rwsem is reader-owned and a spinning writer has timed out, @@ -1002,8 +1002,8 @@ rwsem_down_read_slowpath(struct rw_semaphore *sem, long count, unsigned int stat /* * To prevent a constant stream of readers from starving a sleeping - * waiter, don't attempt optimistic lock stealing if the lock is - * currently owned by readers. + * writer, don't attempt optimistic lock stealing if the lock is + * very likely owned by readers. */ if ((atomic_long_read(&sem->owner) & RWSEM_READER_OWNED) && (rcnt > 1) && !(count & RWSEM_WRITER_LOCKED)) From patchwork Tue Feb 13 03:16:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waiman Long X-Patchwork-Id: 200193 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp302703dyb; Mon, 12 Feb 2024 19:18:34 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWrSjuWApOX0rE2UbwRj5Or0SuS5eUUNlcZW4Ypx0O2lOkhlynNzkpdhcUXtgYr1oR7CAJJ519HG0Ar5mvDDVo+JBp7wg== X-Google-Smtp-Source: AGHT+IFs4TGLwNY5HXVs53ZVV+fQy0wpyT4HaimghImSh77zfwYE1Fen230cT+JeG3VA1fAGWJ1z X-Received: by 2002:a05:6a20:3a82:b0:19e:a36c:36ef with SMTP id d2-20020a056a203a8200b0019ea36c36efmr8163525pzh.48.1707794314519; Mon, 12 Feb 2024 19:18:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707794314; cv=pass; d=google.com; s=arc-20160816; b=tH7qWTrk1AhIyNccEnKQvqiAl+HeD6phT737xvCpmr6Z+peUvEeXjw0lTwNhi9TsC4 DgLZxJxKpTvqULXbGGJQfEOLoJwgb+2FrFzr4r/pqBvellvEsSUW0/uab2E2OBYRmVWL TYyOaccvS3+rStJ2g+yEoMXavcTCGM3K6RAvASmsCvVuDwCwkYVuncydxxnz7cjRCiJp NgbEC+CNaJgg8CoueQdI119jWsxVzbjSP1+dJepfDHiOgjN4gYMyuCHXhnv6Rx8XBg6s AkiilrSB1sYrE+16JQsDBrF5tMwHBRvrj8CWy8D1Z7ES3p8YKKZng3mnY9+rWZ+kYCIF yzwQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=yGWd21YNNFyE7PXWYSjal19PhVVgZAsoAbEKZ2AIsfQ=; fh=7iUCFRudPRznn4N/tI2hGgSoG0ZRzEFfW3ItbPdZQ9Q=; b=BTCiWnvdgHm5J528EFk7BN7x/yzqAEBBlVNppra9E98w/QUMM7HOkQBxRo2VoBtsqb wkQXc9FMfhqSSBZi9rxiqHVPcRAQs/NVkZnyEi9EXpQQ32ZOW1cfwFIHKxVxtu9s80XI EjQeNyHtSNU1ex0QaiELR+KO2k5n657I7xZQMYUeGaUqXAmfcaQKAHq2FdzUWOacJ/uw buDswjE98jfWh2bQpdwOxYLluiaVq/SwfxcyP3sHCKYUUUMoqHkrUjHV73kjbUfl9lzY iqbwZe9gqc14MLNRGnPdgFQaZLRrlQqtBL6FMU/LZdeS3CugjWiUnmcxnXLwGfA0iIYK uh+g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=REzFb0Ui; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-62899-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62899-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=2; AJvYcCU7qMgueO9zG8MIY+XTdiUHBuM5g2VfMIxZrathHYJpa4vJ52YMyzhMYG7tRd4/dDpDjJPnGx2JTEYJsO2TsNe1byVAow== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id z3-20020a17090ad78300b00298ab6ed7c2si300679pju.12.2024.02.12.19.18.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 19:18:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62899-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=REzFb0Ui; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-62899-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62899-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 48E99B24962 for ; Tue, 13 Feb 2024 03:18:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E8D3B101F7; Tue, 13 Feb 2024 03:17:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="REzFb0Ui" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 8AD998C0A for ; Tue, 13 Feb 2024 03:17:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707794236; cv=none; b=UXklX6WMLsjM4UqXfFg6enqEnlc2uP1JZfIVZr0wQ0bG+W5GHoSDaAQAKlRd2gZitsvz/MS1v+sQnCMPr68WGc8rlYOlMl+hdxU4ua1CKupLXRfDBhVPydPxdJtxQkxqJ7ruPXGyY6qYyHJkWn7hhALVounE+7lIJzyOv/AFLT8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707794236; c=relaxed/simple; bh=DKDhVG/tH5THyTRx5j1f2Hlbcx8R7tgFZfqbMdDQ0aA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ala+ajW4Xc+0tXriFlD1fdm2JUUd3fIR8t5CAswcrv8kKTe5Q3HN+UxRaEqCUJO6OfW455xI12y+clNJ05LnlnMEtWxXrm6jgYPXyet+aOvWnKKN3Xgh90b48jWC/GsNaEeHUIAZIgcKteTskQy9HXJ51QsV0rDZ72NAEVRXPUQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=REzFb0Ui; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707794233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yGWd21YNNFyE7PXWYSjal19PhVVgZAsoAbEKZ2AIsfQ=; b=REzFb0UiZ/MujEoP5YJVErrEJL0/Ck10g0RlSZyX8RGp5BcDKIM5i2N+vwjvLIofeROo2S 7GOSmmDKQ7FCnrGdjPiHuCa9WuTAE3xp3g2V54qnZTDF4oOA4uf7kphabxk7mLNSsNFBrf 1AsM6YhjgKVHbJPMa9IVRBea4LQaYPA= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-665-ULbFT_OqOFmMKgZHl0L9-Q-1; Mon, 12 Feb 2024 22:17:11 -0500 X-MC-Unique: ULbFT_OqOFmMKgZHl0L9-Q-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 499121C04B61; Tue, 13 Feb 2024 03:17:11 +0000 (UTC) Received: from llong.com (unknown [10.22.33.62]) by smtp.corp.redhat.com (Postfix) with ESMTP id A5343AD69; Tue, 13 Feb 2024 03:17:10 +0000 (UTC) From: Waiman Long To: Peter Zijlstra , Ingo Molnar , Will Deacon , Boqun Feng , Andrew Morton Cc: linux-kernel@vger.kernel.org, George Stark , Waiman Long Subject: [PATCH 4/4] locking/rwsem: Make DEBUG_RWSEMS and PREEMPT_RT mutually exclusive Date: Mon, 12 Feb 2024 22:16:56 -0500 Message-Id: <20240213031656.1375951-5-longman@redhat.com> In-Reply-To: <20240213031656.1375951-1-longman@redhat.com> References: <20240213031656.1375951-1-longman@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790752130855085074 X-GMAIL-MSGID: 1790752130855085074 The debugging code enabled by CONFIG_DEBUG_RWSEMS will only be compiled in when CONFIG_PREEMPT_RT isn't set. There is no point to allow CONFIG_DEBUG_RWSEMS to be set in a kernel configuration where CONFIG_PREEMPT_RT is also set. Make them mutually exclusive. Signed-off-by: Waiman Long Reviewed-by: Boqun Feng --- lib/Kconfig.debug | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 975a07f9f1cc..cb695bc76d30 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1303,7 +1303,7 @@ config PROVE_LOCKING select DEBUG_SPINLOCK select DEBUG_MUTEXES if !PREEMPT_RT select DEBUG_RT_MUTEXES if RT_MUTEXES - select DEBUG_RWSEMS + select DEBUG_RWSEMS if !PREEMPT_RT select DEBUG_WW_MUTEX_SLOWPATH select DEBUG_LOCK_ALLOC select PREEMPT_COUNT if !ARCH_NO_PREEMPT @@ -1426,7 +1426,7 @@ config DEBUG_WW_MUTEX_SLOWPATH config DEBUG_RWSEMS bool "RW Semaphore debugging: basic checks" - depends on DEBUG_KERNEL + depends on DEBUG_KERNEL && !PREEMPT_RT help This debugging feature allows mismatched rw semaphore locks and unlocks to be detected and reported.