Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2261362rdb; Wed, 21 Feb 2024 02:01:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUvFDg92/MuH2dawchg7KgmRdsUZNNvDcXw7GicEHwyb09pLAV2yIyfpyaCvgZevkzFXO6JS/swfN9iOtoFbQwd/Tg4O2rMGpqSwNbPFg== X-Google-Smtp-Source: AGHT+IFa3/0ikF/UGpuZs4MQWJmBIeHaRqGG2sBM29V6fkhnYOiHXs0HD7Uqs0Wfntd0seuUM1S/ X-Received: by 2002:a17:90a:3048:b0:29a:1e64:fbfd with SMTP id q8-20020a17090a304800b0029a1e64fbfdmr609360pjl.3.1708509666222; Wed, 21 Feb 2024 02:01:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708509666; cv=pass; d=google.com; s=arc-20160816; b=NLBYnT4LRfdT5pt9VWdzsUU8ZcOigyNN7f5NpjU3VzikMzg8uEi4Q6FESSOiAcjOWC XzC1EGO5ICXAE+/AEU+/hwy0kLo9x+eo30Hk/XiLdvv41xhGSVN/agkZaJeWrFqW/CxB /33KigoMlLO5hWh1MOMd+eyvFvOsB3bvL5QXkYtAy5WlyIwE7Dfg4IZ9QNOUWDmsZipp mWbhCnBJZ/zwZkMPuYZrwI3tHfBvfCWoqKbt0OSf4qu6LivqzHUl6e6G55Kqk1msbGlK AEnqoeK0z2Wp8Of3kNXkmORityEfpZNL4Q/Ex/VSAJmXp/6PnU0Um99wEGcUwr9K91Q4 lDmw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from; bh=e5cHn1JijalHUH7ycLz92DIHggvUMO7Y1uKQlQu2opI=; fh=QMm8m/ZWm+A1EqjKAllYKUqNg+o2tkLujHELlI5tZV0=; b=xVzzTb4EUMFbhd5MU7D7mLbHZwfER5oJH5qDhQuChBVz6gTqXECm+DLbejajMPHSPH Tpwm1wajSlCyWaiRJW859UkaaPrjWuy26K7oP7CiaU6JR7O2O0wGjUgNaNFdqXmo20jn B57UP/7OLWn46uAR60oxiCIoP/LMpD9qHIV4OJhh5MNGSXrXQpnGNjLufKCrp3XzjUuL uHEM6D3jmNFjo2ge2f42cHkwPviAM1VTic7yKr/KFQ03iIucCa5/GGL/T8h67p5fIxJ5 NRr3jJhKJKSAEthB8p6iZ6MRCIAfn4sRC/C2BHa2uO4cBmxBgMfQm9a5I3+gII3PwnIJ 5Tjg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sk.com); spf=pass (google.com: domain of linux-kernel+bounces-74451-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74451-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id na13-20020a17090b4c0d00b002969bca1b53si1212754pjb.96.2024.02.21.02.01.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 02:01:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74451-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sk.com); spf=pass (google.com: domain of linux-kernel+bounces-74451-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74451-linux.lists.archive=gmail.com@vger.kernel.org" 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 95F0428AB6E for ; Wed, 21 Feb 2024 09:54:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8E2564D599; Wed, 21 Feb 2024 09:50:04 +0000 (UTC) Received: from invmail4.hynix.com (exvmail4.hynix.com [166.125.252.92]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D11242ABD; Wed, 21 Feb 2024 09:50:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=166.125.252.92 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509003; cv=none; b=lhNk79KVc+mlLvWJRCbKKws96xwFDOv/wzt0PhUVVexv+FDWnt8JucvvI/01DBAttPjz2snxzjkIL7ItAcQKwukhzrUg9ndLSg8mvpdVu0/gkF2p9ZR+gnhwPIEbBA5hiZKiTlHWF/XJjs/10YD0dqhiFU0Rt3/qBH2nAU/1G6g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509003; c=relaxed/simple; bh=32dhqEgXIybDFaJN1JuIlSUqelCcRZP5tULcFTO0inM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=gS3Av+tAytRiAVptky+gG0zHZziMajXog1pf5U+Uon4cjcwZCItswsI7WVOK55xLjdswf7HBbZI8iG6pqHxIbuV5bMXr/BZ7Ad1h0QD01gdQHGpIvlnurXSiB/LFMAxR9wy0Z8OhIVWPXnvfjOoz48D/YqD8l0Kc+I2lqsPxVQY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sk.com; spf=pass smtp.mailfrom=sk.com; arc=none smtp.client-ip=166.125.252.92 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sk.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sk.com X-AuditID: a67dfc5b-d85ff70000001748-68-65d5c73a67e7 From: Byungchul Park To: linux-kernel@vger.kernel.org Cc: kernel_team@skhynix.com, torvalds@linux-foundation.org, damien.lemoal@opensource.wdc.com, linux-ide@vger.kernel.org, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, mingo@redhat.com, peterz@infradead.org, will@kernel.org, tglx@linutronix.de, rostedt@goodmis.org, joel@joelfernandes.org, sashal@kernel.org, daniel.vetter@ffwll.ch, duyuyang@gmail.com, johannes.berg@intel.com, tj@kernel.org, tytso@mit.edu, willy@infradead.org, david@fromorbit.com, amir73il@gmail.com, gregkh@linuxfoundation.org, kernel-team@lge.com, linux-mm@kvack.org, akpm@linux-foundation.org, mhocko@kernel.org, minchan@kernel.org, hannes@cmpxchg.org, vdavydov.dev@gmail.com, sj@kernel.org, jglisse@redhat.com, dennis@kernel.org, cl@linux.com, penberg@kernel.org, rientjes@google.com, vbabka@suse.cz, ngupta@vflare.org, linux-block@vger.kernel.org, josef@toxicpanda.com, linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk, jack@suse.cz, jlayton@kernel.org, dan.j.williams@intel.com, hch@infradead.org, djwong@kernel.org, dri-devel@lists.freedesktop.org, rodrigosiqueiramelo@gmail.com, melissa.srw@gmail.com, hamohammed.sa@gmail.com, 42.hyeyoo@gmail.com, chris.p.wilson@intel.com, gwan-gyeong.mun@intel.com, max.byungchul.park@gmail.com, boqun.feng@gmail.com, longman@redhat.com, hdanton@sina.com, her0gyugyu@gmail.com Subject: [PATCH v12 14/27] cpu/hotplug: Use a weaker annotation in AP thread Date: Wed, 21 Feb 2024 18:49:20 +0900 Message-Id: <20240221094933.36348-15-byungchul@sk.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240221094933.36348-1-byungchul@sk.com> References: <20240221094933.36348-1-byungchul@sk.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzWSe2yLexjH/X7vtbXypiZ7Rw4nTRZM3IeHCP7ZOa9jE3GJGEHpG2usG93s IhGzSzmziZKt2DLdSHVbsXUuY7rUsAsZHS0lM9PIOWadyaal21xa4p8nn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reflected Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: cb92173d1f0 ("locking/lockdep, cpu/hotplug: Annotate AP thread") was introduced to make lockdep_assert_cpus_held() work in AP thread. However, the annotation is too strong for that purpose. We don't have to use more than try lock annotation for that. rwsem_acquire() implies: 1. might be a waiter on contention of the lock. 2. enter to the critical section of the lock. All we need in here is to act 2, not 1. So trylock version of annotation is sufficient for that purpose. Now that dept partially relies on lockdep annotaions, dept interpets rwsem_acquire() as a potential wait and might report a deadlock by the wait. So replaced it with trylock version of annotation. Signed-off-by: Byungchul Park --- kernel/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/cpu.c b/kernel/cpu.c index a86972a91991..b708989f789f 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -535,7 +535,7 @@ int lockdep_is_cpus_held(void) static void lockdep_acquire_cpus_lock(void) { - rwsem_acquire(&cpu_hotplug_lock.dep_map, 0, 0, _THIS_IP_); + rwsem_acquire(&cpu_hotplug_lock.dep_map, 0, 1, _THIS_IP_); } static void lockdep_release_cpus_lock(void) -- 2.17.1