Message ID | 20240221122306.633273-1-james.morse@arm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-74691-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp999962dyc; Wed, 21 Feb 2024 04:24:00 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWsI/nVEsjzOKDT67ZzZpSKt7mpvBK1NiU/c4AWwt048BG2VrDJWLI4VK8cSDVRQeaZUGp8otIAPe90/Dhc5Q8v6rwOGg== X-Google-Smtp-Source: AGHT+IH/4nUFHt1/lMff6tXzT4TU1Es0Zy6ZXA23zSul7JjxVOscTZp5exkmzeLsIBbLirqeFx2A X-Received: by 2002:a05:6a20:d905:b0:19e:9d92:b6a6 with SMTP id jd5-20020a056a20d90500b0019e9d92b6a6mr24762513pzb.44.1708518240360; Wed, 21 Feb 2024 04:24:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708518240; cv=pass; d=google.com; s=arc-20160816; b=RChx0i//rOi2JNU1mHRIf4vAOSSqAlDTBiumHBzV6BPCvI2JwdZX2YVlJiLNsUZDgH Xhii1giGQ4pcV4BowZMRfP4exSoajf1ZaMeZQxGqj2NubvD8zeKYbxR9ZvCdi7LgeGfq zCzKDZTsucHjqKP6ZhpYm84u2Xr5OM4KYKjmduMw5vH9p2DxN93Wy2oGV+w5l88kDPOs 1bnsdYQ0/4zrF9QqIPhndXAc5zqDyWZjih393oo90+bZgrrbpf+7eUyMxgOl5tC/KWoa GAD5JoLUlFHP4Q//iwxTLgreVVGtJSPoQvFJVT7g8Cu/FF50zxCjWstjmniXKDWNKE06 ySbA== 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:message-id:date:subject:cc:to :from; bh=en+6FTUC+HkWEeJwdYOPtXtiV5hb2Bcezbl1PSrLpcE=; fh=3Jk9s+3OG/uUZPl9Gruf4+vzHoNn12n+BxYqSAcvLJ4=; b=mILkxrVyrVVMAQbepIMwIMbXXpwXjoet3kGWcwAxIyj9dtQrwFAgXtxrF2n4/ZR1uE xCAFDoy28e50JHy0HQtwFHED92YWNAAzfG9UveiBxRvBWIfKHfRO6L1kahjJAyUNE0J2 +W61jZGhD+Wan18PmOPm+rYpsgLWQ8CbTY3P627cvWUs3o/rXtq2N6ardLbQS7at5b6U NZIS3t+KkO4bddk1UTGtlY5U/eNOl2oC0NAxn1m9kWTlieU3FU1owp14k/v0ykHIPkhy 4ksm/V4z7KU24qJb4bNgcQ3JJ8U2rDz22+gbkeAhSBG5yTsjMzT8f/jU43eK1QJhrcB5 pFqw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-74691-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74691-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id pj6-20020a17090b4f4600b00297160ba34csi8102800pjb.104.2024.02.21.04.23.59 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 04:24:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74691-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; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-74691-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74691-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.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 659C9B22B12 for <ouuuleilei@gmail.com>; Wed, 21 Feb 2024 12:23:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 20FE445BFD; Wed, 21 Feb 2024 12:23:48 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C3FA34F8A2 for <linux-kernel@vger.kernel.org>; Wed, 21 Feb 2024 12:23:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708518226; cv=none; b=suBWxo2A6iICSYsX7gazHyznfqAHvYDQ9TGPRk7sEPWclGL5OMJCWRa3WczXno9Tg2h9i7A9juXSh5zpuElPQnYoAMtpxbJg09FXTviqdfNKG3+3pKZTtxBqAKdCDTNRdlDRrz+iDQI4Bc9L9cDzEyO3eu37gwYBWPdsW0reUNk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708518226; c=relaxed/simple; bh=oX9aizoUCrRamqQe1T5d8/5QrboBphelf0aIZYAOE6I=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=YPVVU09sY7KtdIooLQbwQYe/rS70rP/F5CdpP7Vp1XRkFu4MWjbULfU6D9+izfZ7VDPyQU0bR6VV4+S5Cenmnnpa95FeXpdIy5UoKyv3Jvctl41o1/mErmoYiIDplmk2lE4TBOxj1uL5sD+0ln62rXyWb6/KSQCLFCI6CWBA/JY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5B572FEC; Wed, 21 Feb 2024 04:24:22 -0800 (PST) Received: from eglon.cambridge.arm.com (eglon.cambridge.arm.com [10.1.197.60]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6FCC43F762; Wed, 21 Feb 2024 04:23:42 -0800 (PST) From: James Morse <james.morse@arm.com> To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: Fenghua Yu <fenghua.yu@intel.com>, Reinette Chatre <reinette.chatre@intel.com>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, H Peter Anvin <hpa@zytor.com>, Tony Luck <tony.luck@intel.com>, James Morse <james.morse@arm.com> Subject: [PATCH] x86/resctrl: Remove lockdep annotation that triggers false positive Date: Wed, 21 Feb 2024 12:23:06 +0000 Message-Id: <20240221122306.633273-1-james.morse@arm.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791511222498190429 X-GMAIL-MSGID: 1791511222498190429 |
Series |
x86/resctrl: Remove lockdep annotation that triggers false positive
|
|
Commit Message
James Morse
Feb. 21, 2024, 12:23 p.m. UTC
get_domain_from_cpu() walks a list of domains to find the one that
contains the specified CPU. This needs to be protected against races
with CPU hotplug when the list is modified. It has recently gained a
lockdep annotation to check this.
The lockdep annotation causes false positives when called via IPI
as the lock is held, but by another process. Remove it.
Reported-by: Tony Luck <tony.luck@intel.com>
Link: https://lore.kernel.org/all/ZdUSwOM9UUNpw84Y@agluck-desk3/
Fixes: fb700810d30b ("x86/resctrl: Separate arch and fs resctrl locks")
Signed-off-by: James Morse <james.morse@arm.com>
---
arch/x86/kernel/cpu/resctrl/core.c | 9 ---------
1 file changed, 9 deletions(-)
Comments
Hi James, On 2/21/2024 4:23 AM, James Morse wrote: > get_domain_from_cpu() walks a list of domains to find the one that > contains the specified CPU. This needs to be protected against races > with CPU hotplug when the list is modified. It has recently gained a > lockdep annotation to check this. > > The lockdep annotation causes false positives when called via IPI > as the lock is held, but by another process. Remove it. > > Reported-by: Tony Luck <tony.luck@intel.com> > Link: https://lore.kernel.org/all/ZdUSwOM9UUNpw84Y@agluck-desk3/ > Fixes: fb700810d30b ("x86/resctrl: Separate arch and fs resctrl locks") > Signed-off-by: James Morse <james.morse@arm.com> > --- > arch/x86/kernel/cpu/resctrl/core.c | 9 --------- > 1 file changed, 9 deletions(-) > > diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c > index 9f1aa555a8ea..83e40341583e 100644 > --- a/arch/x86/kernel/cpu/resctrl/core.c > +++ b/arch/x86/kernel/cpu/resctrl/core.c > @@ -362,15 +362,6 @@ struct rdt_domain *get_domain_from_cpu(int cpu, struct rdt_resource *r) > { > struct rdt_domain *d; > > - /* > - * Walking r->domains, ensure it can't race with cpuhp. > - * Because this is called via IPI by rdt_ctrl_update(), assertions > - * about locks this thread holds will lead to false positives. Check > - * someone is holding the CPUs lock. > - */ > - if (IS_ENABLED(CONFIG_LOCKDEP)) > - lockdep_is_cpus_held(); > - > list_for_each_entry(d, &r->domains, list) { > /* Find the domain that contains this CPU */ > if (cpumask_test_cpu(cpu, &d->cpu_mask)) I agree with this change. Could you please base it on x86/cache branch of tip? Thank you Reinette
On Wed, Feb 21, 2024 at 08:48:24AM -0800, Reinette Chatre wrote: > I agree with this change. Could you please base it on x86/cache > branch of tip? No need - whacked it into submission. Thx.
On 2/22/2024 7:16 AM, Borislav Petkov wrote: > On Wed, Feb 21, 2024 at 08:48:24AM -0800, Reinette Chatre wrote: >> I agree with this change. Could you please base it on x86/cache >> branch of tip? > > No need - whacked it into submission. Thank you very much Boris. Reinette
diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c index 9f1aa555a8ea..83e40341583e 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -362,15 +362,6 @@ struct rdt_domain *get_domain_from_cpu(int cpu, struct rdt_resource *r) { struct rdt_domain *d; - /* - * Walking r->domains, ensure it can't race with cpuhp. - * Because this is called via IPI by rdt_ctrl_update(), assertions - * about locks this thread holds will lead to false positives. Check - * someone is holding the CPUs lock. - */ - if (IS_ENABLED(CONFIG_LOCKDEP)) - lockdep_is_cpus_held(); - list_for_each_entry(d, &r->domains, list) { /* Find the domain that contains this CPU */ if (cpumask_test_cpu(cpu, &d->cpu_mask))