From patchwork Thu Feb 22 15:05:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waiman Long X-Patchwork-Id: 204818 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp10164dyb; Thu, 22 Feb 2024 07:16:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU465BcSXiuPyD+9FG5VTmfDYu09v6YfRUNIvjTH7fzNagNHrOOjAzKaE4Uq2Et32kTzLYGZSV/TClO6lRaZoJj3aVg4g== X-Google-Smtp-Source: AGHT+IEvz+/O363oQEYw2R/VQOaFlu0QdKNizUylln3r/h0cg/dJ5WpEkapo82jETU9m4kH4qCKe X-Received: by 2002:a17:906:ce4a:b0:a3e:720a:b961 with SMTP id se10-20020a170906ce4a00b00a3e720ab961mr8986228ejb.34.1708615018247; Thu, 22 Feb 2024 07:16:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708615018; cv=pass; d=google.com; s=arc-20160816; b=tzHBaPwtBdUsB3epjw4imTm6ckDg8UAmHDphRqfc7v6eqTif/YKCUST92xKse7+WE9 JvXlvdmKPcReUIE36n7HFMMIGx69PGtxh4O7wl0oK1lPGAaSvAzyrjaL8r4FdvMMkgj/ LAPgxLfvwXYp3OxYY0i3+UyNRYsTroOb5/qnCC/E1AJiAdyYqpLxnqQyJGKmARFQShk1 eZgpJD135qkhxMSDcx2VxaDKBjBqwA65e/JVq69O0QnXl+uf8HE29XPcrCNMHER3a5O9 ZYsRMYfO+6WeaXPU6kfMvNsAqSTQ11JloQ7LGgvV4zJGjdqSkU/oGLE1JKxogmu7i05i 7uJw== 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=6lp5EbVDsr1293Y0XjQkZX4GDQn3K20EV4dIoRAKwfs=; fh=A6H/wgnb7XDBUMnRrm/PM8AO6ffoqXr8ae9E2Kih3wU=; b=LRzAXAdEodENrtQHF0Ey/J5U2nDGhGiPkdIiXL+KhiK/2rAPPDPNEt5Co5YNk+DzdK GctO76/2WNEyoK4NYdajKPS/FUWczfIFPVX2WxG80pi2dEuMjheNv4HL8oQS0HtEAph9 PMi/W1ZVGr8Zu6vksjkIKUgdC9mV3kQMWAGnYZoMSWxr62OYKOZUk1Im8e5uJOzpD/YS Y1aqGvWG90Z44dx6IjnDNGpihERJlQG51w7puGo03aB/TehUIAFujcnX9+aaQT1vwtov UCgOxpQHJounkfQp/M8zSJ0LEJDHTd3Y1qNOsqUaZdSRFGLokAuTUTAmgYgWyKsNToN7 lE3w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Dy+8yo4f; 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-76743-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76743-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id jx2-20020a170906ca4200b00a3f5dce4048si1103003ejb.358.2024.02.22.07.16.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 07:16:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76743-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=Dy+8yo4f; 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-76743-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76743-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 70EBB1F25F6F for ; Thu, 22 Feb 2024 15:06:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 85A7714E2F5; Thu, 22 Feb 2024 15:06:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Dy+8yo4f" 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 7A61F14A4E4 for ; Thu, 22 Feb 2024 15:06:01 +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=1708614363; cv=none; b=FYrhtBuiiX1TsmiPeWrTPDBhvrxjY7rcqc0TLdKqSQ4UXnifddznC9PSvPDtB2JBxza9I/RhPpJ9SI33Omjd4JzuwlrIdZqrC+hw/A8FuhWTrC1dSdYcT2Q4YL9Xrnx0fC5QYmGNXvQ1Zuu9YIRSCMV1cg9fXGV4fEDputf2mpQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708614363; c=relaxed/simple; bh=aeHOJ9iVML/y8GMo8hBUeh/YCn/T6DMQYpgqNzuH3qU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cu5lFWwiswhxYB2KK4OEes00z1Oxm2Y6QOTSv1n/QkwdZp9ipihMW2FfT5xV8rmVAfIvzSL7AZ+kIhF1TOgYvpEr8RSITMMuOV+JCzGDROzSRKk6WR7p04X8WAAhpI7P2f/pczrIhSq3kV2EAfRZyto59sCGay0Wjdh2B3ExuQo= 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=Dy+8yo4f; 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=1708614360; 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=6lp5EbVDsr1293Y0XjQkZX4GDQn3K20EV4dIoRAKwfs=; b=Dy+8yo4fq9Rs505jwyrO+V6EdUPqC03+FUV2XJPoxYaa7hJOLNTxbrsbsGb4dpbBe5OO4f 8i8wO+Gw4BXkMifLW88VITSRsj1T7FFjcjZ6lLR+/k/DWvqih/H1hBuh1Sp52AwlOOnP3J KLCEy5VLHwUCN3qL4GaXO6zKBclCO80= 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-626-yAZZfy9hOwm0hMk4P6CfWQ-1; Thu, 22 Feb 2024 10:05:56 -0500 X-MC-Unique: yAZZfy9hOwm0hMk4P6CfWQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 C6B5E863E83; Thu, 22 Feb 2024 15:05:55 +0000 (UTC) Received: from llong.com (unknown [10.22.33.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1F208112131D; Thu, 22 Feb 2024 15:05:55 +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 v2 1/4] locking/qspinlock: Fix 'wait_early' set but not used warning Date: Thu, 22 Feb 2024 10:05:37 -0500 Message-Id: <20240222150540.79981-2-longman@redhat.com> In-Reply-To: <20240222150540.79981-1-longman@redhat.com> References: <20240222150540.79981-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.3 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791612701242470925 X-GMAIL-MSGID: 1791612701242470925 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 Thu Feb 22 15:05:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waiman Long X-Patchwork-Id: 204817 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp9979dyb; Thu, 22 Feb 2024 07:16:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWx27iey8CLC2Fob8zvxYivsSZDUPaPxFsH/vHcNbW8KLTh2Iaf0kCdWKF3QrzS+2oF28f54Ace3gY9xzOYCIW/yoXTug== X-Google-Smtp-Source: AGHT+IGOvqWxe22/NhTYGlgsm8hxzZDO7uMqwpjsPpSZJtxErpSjgaCyHwmy9tCtAN8rySCEsHFE X-Received: by 2002:ac2:544c:0:b0:511:860b:5f28 with SMTP id d12-20020ac2544c000000b00511860b5f28mr13440943lfn.63.1708614999878; Thu, 22 Feb 2024 07:16:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708614999; cv=pass; d=google.com; s=arc-20160816; b=0FHz+ZM5ZQ0AUhsucf7t7149O21ib98ZtdqXAe+sXSHVZOImYQFWkgy8DrqBTBZw2c mYbq/MzUJd5VdA20DhUM/gZPRGe6uOz6GNhosoeA9AdymbidSndhfTBLY2mpApZsGthd WRgPJ5GhVR7ZZG+ZpQGLPO7kLqj75NuKreLT44KA7w/8kq9ToZLR9+vGY5hiWYXu6Bln vS5bRBV23WOhs85H0XoUX/K7boh0EK7O9UwKeurp+xjlWkD0XJoCTgHQh/lg6HEwY0HL dHjWgzLxOy9tOsQ9zJI9A7WBmEivuP+8Wd0CV7OuhN9F+PAVzSdFV2oM8bTBsAoLQoC4 qAZg== 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=/g3EhhfkwV+ucAnH60NhMP9M6t2hq0UZAW1GW7z7sHY=; fh=c25v70+ehGE+SiLl84UT2m6flxwHxsFK+3J6BVG3azM=; b=UDxP163tuSUNsgd2NSNAzYwWoiPpIUQ2ITlceLR6mEb7j3fYQ9YdeHgtIfP/rKIgw1 OxWcdiO8uhnLZWwgu10THdT2hc9DYSjyG5JlIJiByCmAQua/96vmFjthQCn68NkmZ/RE v355PhxBMSx1RQWTQ6hue+XehkSn86SUtl+cYGjfB0OWDiJ+B+cJ/a+oHJ2aFhW7/aVF l4pSLM4caovIgqQ2KyUZGTbv2keHVn+DPORowomdc6NnZ1UpjdqaZBUVbKh6rbiXtwXL bV8jd5amab+Qf1QPjV45oBAhquTSYT2FlXkG+U4ttqVIEbeN+gF+itIwc+y5i46S82F2 /cuw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UZTIuq7l; 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-76744-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76744-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id x29-20020a50d61d000000b0056382b02728si5453426edi.328.2024.02.22.07.16.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 07:16:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76744-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=UZTIuq7l; 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-76744-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76744-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 873131F2622E for ; Thu, 22 Feb 2024 15:06:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BDD6B14F9C5; Thu, 22 Feb 2024 15:06:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="UZTIuq7l" 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 7BF4F14A4E5 for ; Thu, 22 Feb 2024 15:06:01 +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=1708614363; cv=none; b=s8AEYHGJ5r1qAyIT0OTBCLov3rOQDZw9iSQgfBzva4sSEhreVFGW9VY/o8tV3ILmOitl7yQ2WB2y4uqphOAaKVRNLGzelPqHEJBbumDNhR4+HMqfS6oov1sPOpXaeW9Jls40DkdTEzVyw5GOQpt+XrIrAlL/spOebm2qXe/4KHM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708614363; c=relaxed/simple; bh=RTHbRgi+bBhmJDsk8kqG9ZoJRZNpKRFGxYgrgpT/juI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TRgE203QCW5EoRrR4H3Q4rRoC+4v0kCJeOF2QQt4Au/urrjl9iSWGU2eKMaasBONGesxSJUi7s5yjiYKfdPfKRUp9fPbSrDXj3L5JsLwUirNpHAJ9qGAKMwxFdPjBc6H3YnNINxRQtcCSgsLH0i7eee5GaHGRE0huM83i0PQ26A= 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=UZTIuq7l; 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=1708614360; 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=/g3EhhfkwV+ucAnH60NhMP9M6t2hq0UZAW1GW7z7sHY=; b=UZTIuq7l/cc5h1vEiuNPuIDj3QEXtPfDTna6rGHl1vTCmOY+X6rWeTzxz7XG3SETjaXepm IgBU3KE3ZlvZK0Jj/eoqBcfoPD3kZkBjtdrIYtdk7CjVEPvDNk0Pw35N029rml5XjEI7Uz 897VwfQKUAd+dl0zm5O0vlgCm7QYpxw= 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-639-CHC9rYMrPeCQuXkqIvx8EQ-1; Thu, 22 Feb 2024 10:05:57 -0500 X-MC-Unique: CHC9rYMrPeCQuXkqIvx8EQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 78064185A783; Thu, 22 Feb 2024 15:05:56 +0000 (UTC) Received: from llong.com (unknown [10.22.33.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id D5B2C111D3D9; Thu, 22 Feb 2024 15:05:55 +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 v2 2/4] locking/mutex: Clean up mutex.h Date: Thu, 22 Feb 2024 10:05:38 -0500 Message-Id: <20240222150540.79981-3-longman@redhat.com> In-Reply-To: <20240222150540.79981-1-longman@redhat.com> References: <20240222150540.79981-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.3 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791612681786240170 X-GMAIL-MSGID: 1791612681786240170 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 Reviewed-by: Boqun Feng --- 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 7e208d46ba5b..67edc4ca2bee 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) From patchwork Thu Feb 22 15:05:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waiman Long X-Patchwork-Id: 204814 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp4981dyb; Thu, 22 Feb 2024 07:09:33 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV2zKwLXI93KQfPWj79zpUwV/zuiPzauV5KePCpiLpEhcRv8EmsFNQTCZDlQoAtJ/2FNxbkaXCtpEfg/9XldxaIxYtH+Q== X-Google-Smtp-Source: AGHT+IFsqaYtdGLppJck7E1X9lmJohxbSppVbMa9FbS/lwUODVP3ptpdmI3NWEnQdwn/ceStABZ0 X-Received: by 2002:a05:6e02:cc2:b0:365:1ea2:2072 with SMTP id c2-20020a056e020cc200b003651ea22072mr14405777ilj.24.1708614573478; Thu, 22 Feb 2024 07:09:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708614573; cv=pass; d=google.com; s=arc-20160816; b=jwNiZNNZzwOQ7f2+TNqUJSrmHvUQ7fdEO0gLKCfpr3ac31nKSPeoFFoPRPBNKzMqKX OJZDXW/57XpqT9egsRFbmR95AhI0zGOP0DJdpWNeq45qKQ9GEYN7WCuy7G+U9DyZeRZd AiCcZyJZuSbHzJhOuTkGfH5lZ9hvAc0BFBsbC9dAolWiiw9F+blB0eK1/07dq05Cki2y rapaOtxzI5jD2FPlnhlWf3TlqxliGRm5ZIMPtDx3vFfcDITGvCxJF2v1U9g6sUIF5cte c5unXV9QdNy5pSAGmt7i7DuRVD/o71gp4mYeTQHqGlMxoO8sYEPMvlplSkqsmUYEsBRI DZ+w== 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=FbM+mRMvNwlvXjAUfTOnQe38QADdr2GSal9VUe0AgiQ=; fh=c25v70+ehGE+SiLl84UT2m6flxwHxsFK+3J6BVG3azM=; b=XxeU/a9ZIRS/sd2OG7JKwJ78CUUQAXN84YSl1gbT1AK9gi/0r/9DxLcen5jQR1sKNe cbCbJ5JaRbZRq5561PWpxJREYodojQnoaZg8BIFVETHCJ77RbhRgcPTSSKy+bSALC2J1 aftw6borYPcKn89xDUlohPhRpPjIjc0Z5BHAm7p+IsuuwONYVsO5vuYbf52wD6gELYcF IXCecf6s6mA6agmYWjNYNHJ0UHhkzHfG6u8wBPM7k2oY79gft/KGI9x81Pl20XbIfMGG 80HfutMU3zi7/7SXkalNDybPma9lKVkpUagM7C7Bciajm3dg4cxsYJYH7idQHcprFZoo bT8A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HI7DptFb; 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-76745-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76745-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id j3-20020a654283000000b005dc42946a85si10179738pgp.214.2024.02.22.07.09.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 07:09:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76745-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=HI7DptFb; 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-76745-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76745-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 408B4B25DB2 for ; Thu, 22 Feb 2024 15:07:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B13F614F9E9; Thu, 22 Feb 2024 15:06:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="HI7DptFb" 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 ABC4B14AD11 for ; Thu, 22 Feb 2024 15:06:01 +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=1708614364; cv=none; b=LV2VKvmMXmWGffj4KcPO4hiaZAjCm9bsFBm3czk19hu2UZFmnw0JHXvkxQXeYfBa9N8Ra9wlmnLqNnbNS3jx4CfF+nmwsCHw60z6VBmCECPq7e/JkdqZqtSVYLM0eI1JkimKyrZezbaDfsNCs8qDWa0NyDUZS9qyRvgeSPa5LPE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708614364; c=relaxed/simple; bh=jmNJZxpioD2ev6CzuLGJoXoioGPNxz85LSb8buJEQ6o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MUhpMv4YzdUugyVTBBiqYcC5B+AGpPFSvixG1bb683Ij3YkBla+88hSUggAfS0LYSMSEmk0Kro9exaDN171VwhTs42P4HX3n3PU0hw8rH1bgxK/omjb/jmhKgDgmN4AzujVWtOmkM2GP0wyt6Q+SzVRPUtlapYGUzP760DqBbWY= 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=HI7DptFb; 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=1708614360; 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=FbM+mRMvNwlvXjAUfTOnQe38QADdr2GSal9VUe0AgiQ=; b=HI7DptFb+ethCiHlrmhJksYHq/H9qn/NttII1VOipXpW1FppMVFX9Zr4z3s/NFfFtnNE1J LxIn/v3XNzz+zvO6/5EbyHEnqMLalMmgIOhydCu0P/V0K/gq9LfiKiyEdgilZ1YQLFCQ5C GOz8AGDoVtZOtJHncv5EB8Y/LacY06I= 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-488-Em10oE56NmmLMvffq-YPhw-1; Thu, 22 Feb 2024 10:05:58 -0500 X-MC-Unique: Em10oE56NmmLMvffq-YPhw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 2C1D785A58A; Thu, 22 Feb 2024 15:05:57 +0000 (UTC) Received: from llong.com (unknown [10.22.33.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 87B5B112131D; Thu, 22 Feb 2024 15:05:56 +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 v2 3/4] locking/rwsem: Clarify that RWSEM_READER_OWNED is just a hint Date: Thu, 22 Feb 2024 10:05:39 -0500 Message-Id: <20240222150540.79981-4-longman@redhat.com> In-Reply-To: <20240222150540.79981-1-longman@redhat.com> References: <20240222150540.79981-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.3 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791612234891600623 X-GMAIL-MSGID: 1791612234891600623 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 Thu Feb 22 15:05:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waiman Long X-Patchwork-Id: 204813 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3153dyb; Thu, 22 Feb 2024 07:07:17 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUDmY/7Ck0Km4yBANkMpHK2dakdYojskPHoROimLEl4dbfnnChYfzn3KCQ1zXNT8guocefOfo4KqLtLPRurvhdkwCNrOg== X-Google-Smtp-Source: AGHT+IFq4guzqr91nJLPD1W8fbfJrLwcyaMsNplpFEZV1t2KCpxIHDOizXlno+ffIP6C/X4MK2Tr X-Received: by 2002:a17:903:11c8:b0:1d9:a91b:778 with SMTP id q8-20020a17090311c800b001d9a91b0778mr24000542plh.30.1708614436581; Thu, 22 Feb 2024 07:07:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708614436; cv=pass; d=google.com; s=arc-20160816; b=xPZ2DbgUsFarvl0ABGmPSvvwbHXCS6X+IHPbHRTIhYI9UyS3eDzH4/0wdA+sjNcc1f 9VM+crRtjZvrXrdnflypWloFkocwj8WoWW9Eub+3U8laEDR+wrmoOGdmMh4cV0aeJjp4 guxK22FRTPL9bTI/Cn+uSWe2peudeQ5sjPRaIiN2nIbNPJnnCTVD5oUqVGo8EUjbXt02 Ee7TE8EcmcnFczAIvVsa3VuxHAs0eX72QcRjLp0QmsyL0JoDvRSCtPNiDo8cfojPimGC VFT0plf8yPmQ11fPuizl4wGWevQnGre2dLi2CaNaFUh3o5AKzxNRMpuP+je9L/V5WW0I gh+A== 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=YwAU1bVRiWDpl3C11z2EMbgNyQd13w59+mKdZ8PW7BM=; fh=c25v70+ehGE+SiLl84UT2m6flxwHxsFK+3J6BVG3azM=; b=0LU0eP2i3euk7lk0T96LLGNoKDhbtYgV9cFOJ5UIWoTGZy5b4AhhzG9EDrnTZafWyB iNCudiSVFdMnTVJuX6D6qBnXlrO6H1W+qC5cB9I4UevO60rulzNRH4a4F3u4a5txB+Rb 9KEcMfoYWenkP9tUPr09V1UKj8uo14phjMGrLVNZ4sjSWlTA84mmy7V4A41+yv1cqCkO JdGceBkKg+z68FsFR+4mXuL+S0zeIqrUKePsYNSxa9+/S6XKaO7EojO4VqddXDva7J8n sigY1q282cT/qTRls1EiMjNh34VFA5mjhaQ4dRSX1i5vUCivqmilWS33jPWmbyGJ6hZq wZxg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NgHKYPFT; 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-76746-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76746-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id w16-20020a1709029a9000b001db56097a9asi9835229plp.638.2024.02.22.07.07.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 07:07:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76746-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NgHKYPFT; 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-76746-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76746-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id CA70B287FF8 for ; Thu, 22 Feb 2024 15:07:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1114615098A; Thu, 22 Feb 2024 15:06:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="NgHKYPFT" 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 089E914C588 for ; Thu, 22 Feb 2024 15:06:03 +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=1708614365; cv=none; b=Hxot6Lxxhe8TUIptsf2k5Inxcd76JrIaf6kksJSfNAciZB0c/CQUw8l14pCypICJpOaziJUkwb4HtOe83cAjjPIKo7e6FEBwJb8VF9eqd/rpvmdEKCxt2hDubaB/aGYkxdNgAoK5MrhqFXFPQOIAn+35OtD2tU+o0QxVVO3efzM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708614365; c=relaxed/simple; bh=+AQtJf5/TvyBdLCUnBNNQA5gg3qQ4hhhj1LJzSNraEg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FI0lUsEn7Qx1/JofFpPwRMDV96K1NNezRvVmqaLt2MDZfIHVYj863jnQ650/SrcleaIVnVUTf1wrtC5YArQHOiB5d70iInGY1QzvLxl6WPh3qp/fYgEe+CJiRe7LIRF0z1xvuiuadFOcwXBfu5fDG722J5Pr7xNmxdk8ovSdA2Q= 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=NgHKYPFT; 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=1708614362; 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=YwAU1bVRiWDpl3C11z2EMbgNyQd13w59+mKdZ8PW7BM=; b=NgHKYPFT9r0lOI8X4TIAS9mrqzlfkYroWInVX9fjBbeH4Ig3+WcDtmKFYr2ZN1g4fvsaLi Y8A6/Sh4iFIw9o0rixtPRveKz6AC/AOEG3x6yisOGS/uBDUuyBjPLlngXssdHfJTFqyoV6 SgI8Gxy29YBkdeCH6WrJRztijs/JcpY= 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-269-5jPZbsV8P0GUuj6YG1SU7g-1; Thu, 22 Feb 2024 10:05:58 -0500 X-MC-Unique: 5jPZbsV8P0GUuj6YG1SU7g-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 D3CF42825BA9; Thu, 22 Feb 2024 15:05:57 +0000 (UTC) Received: from llong.com (unknown [10.22.33.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C8A7111D3D9; Thu, 22 Feb 2024 15:05:57 +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 v2 4/4] locking/rwsem: Make DEBUG_RWSEMS and PREEMPT_RT mutually exclusive Date: Thu, 22 Feb 2024 10:05:40 -0500 Message-Id: <20240222150540.79981-5-longman@redhat.com> In-Reply-To: <20240222150540.79981-1-longman@redhat.com> References: <20240222150540.79981-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.3 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791612091575630152 X-GMAIL-MSGID: 1791612091575630152 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.