From patchwork Wed Feb 21 12:23:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Morse X-Patchwork-Id: 204194 Return-Path: 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 (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 ; 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 ; 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 To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: Fenghua Yu , Reinette Chatre , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Tony Luck , James Morse 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: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791511222498190429 X-GMAIL-MSGID: 1791511222498190429 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 Link: https://lore.kernel.org/all/ZdUSwOM9UUNpw84Y@agluck-desk3/ Fixes: fb700810d30b ("x86/resctrl: Separate arch and fs resctrl locks") Signed-off-by: James Morse --- 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))