From patchwork Tue Feb 6 18:49:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 197616 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1757083dyb; Tue, 6 Feb 2024 11:07:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IGOXIn68C03gv61UBejR7S1lOpCfzRiYKSiZfAsAbl9Q/w57ze070GD/kGquuR35IcMMeGL X-Received: by 2002:a17:902:ea0d:b0:1d9:53ca:e651 with SMTP id s13-20020a170902ea0d00b001d953cae651mr2674040plg.33.1707246443558; Tue, 06 Feb 2024 11:07:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707246443; cv=pass; d=google.com; s=arc-20160816; b=LoRm7JoTAAom8ZOeJ9op9SlEYNgDFCIP10P+DgrQGE36EhfmIBgjhvVVIM0PfmsmZP TEwopcVp4ll51oD/CsGpPvAUmy46FEwQKmCUNMEpMy07AkrOPIh6vwGjBjXwxTrZUP48 4BEc8keYTnzGSxqcEupBvs65UThDhwh/diDxJFmiyV7CkWwGjU0+/0wu3FyezqeEuirn iVG5GMZnPAzHJTh0KsouK8P48ujLJOCpC9JHVME36LrhHbClKYitZdhWUn4e67n22hRO NMhynsBkaGgDL1E3omIeJ9mV+mcd+wdXfglCvY8ANq+vqldSGSY3bVm7I36JfXq6MAwN 4ZaA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:subject:cc:to:from:date:user-agent:message-id :dkim-signature; bh=qlDKbMqWBelqVSfNEbh2M7kUdtgo3q7n46OC/sINoRo=; fh=kWC6s7ahARNq/isyl3lZ+2SULl4iS0xj631U+kr+Bik=; b=QFN+EKlXdtebZlOVuMY8s/IKT3vr1SoAx+MOPCG8STSvkKlk1ybWfZJKxioutbSqqQ ++ALByQOBOUSE21gVDnLm1qpwPE/vSOVWVCdoDeqjUv8E9OQXawscIqu7UX/7JfVeso3 L+M/7bYwfknrBhYKEtePH3NDiz1nKDOYum+AcRqmGmoCMZLf9BPojeHQBFtonsq87q5E lURKZHsxGVOUYtzYGrvRmSjVrDdw6oD5BEwV0qoI59KauSd2Jx6unM+n7i5RdcFNKXzO EV5hQ0wCtEej72rJHmpXzot9HTmbVAdXz1sz8Kcp1jAg6DaoyfSoPhc2kfGRJ6dNQH4P ppoA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NHgV8i8r; 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-55522-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55522-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=1; AJvYcCWjRYz3JwB1m3q7sqKMKucKPbda6+GBW9nfqMyHOZTd9Du+om2HMTdKbUux4Xz/BbDi+sOUeg8tpK7+TeDFYv48JAw6AQ== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id jj20-20020a170903049400b001d50ecf8686si2068864plb.520.2024.02.06.11.07.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 11:07:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55522-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=NHgV8i8r; 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-55522-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55522-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 99847B24DD2 for ; Tue, 6 Feb 2024 19:02:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B0C971C291; Tue, 6 Feb 2024 19:00:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="NHgV8i8r" 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 B9B9C14274 for ; Tue, 6 Feb 2024 19:00:28 +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=1707246035; cv=none; b=lpHa0/i1cUfojKM/RTX473fbw+4VeRRgQJ1SRMGFkkdcOdoK3XX7BICjP79ugnz/f2pcyf4aqW0v21ImXGA+YHMV4kef84PpwtwVDwNYNjQ4R6m/MozvJPdMMq84ijk/uoDUVJ34S7l84264j9ThY+dYUrlfjccpaUk7gRjtsHE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707246035; c=relaxed/simple; bh=i8Przs01+5+AauKouVnKvrVBH6MR9m6+MAbeEFlDNtM=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=W79KgsjKXqHg4fCMA8DC/f1gw9ghhJniTzyiK5IzJuUmlG1sbXjfhyEQFj3HyQZlepVk5jL8Iv5NCE62sN3cpPpqOYx1sQwVH6xGMntbLkxbiojGpHcRxLw73mXxqcVyY3k9SrAZt0rEuu2NHzCpNAzu3zaibwfq7LYEFsg+ioE= 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=NHgV8i8r; 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=1707246027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=qlDKbMqWBelqVSfNEbh2M7kUdtgo3q7n46OC/sINoRo=; b=NHgV8i8rTEYOTCdK32YWg8f+MEB06M6kXWudEVkG+ozuOT8SV3G25niScsYCci2/1fY4Fr NOG0vnHAMoh0kMSACqXjuBuI1vKN5HiC0Iw3KR84Qlix2tJjsbtr9jSvCDSSlzdabk/XX5 NEhLplmu6anV8IYIVq/yGtGvs8v4JCA= 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-472-mjveR6rZPGOLWpW7CJvbBg-1; Tue, 06 Feb 2024 14:00:26 -0500 X-MC-Unique: mjveR6rZPGOLWpW7CJvbBg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (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 54F0638212C8; Tue, 6 Feb 2024 19:00:25 +0000 (UTC) Received: from tpad.localdomain (unknown [10.96.133.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0D117C0FDCB; Tue, 6 Feb 2024 19:00:25 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id 3F6B0401E1311; Tue, 6 Feb 2024 15:58:07 -0300 (-03) Message-ID: <20240206185710.037579553@redhat.com> User-Agent: quilt/0.67 Date: Tue, 06 Feb 2024 15:49:19 -0300 From: Marcelo Tosatti To: linux-kernel@vger.kernel.org Cc: Daniel Bristot de Oliveira , Juri Lelli , Valentin Schneider , Frederic Weisbecker , Leonardo Bras , Peter Zijlstra , Thomas Gleixner , Marcelo Tosatti Subject: [patch 08/12] arm64 kernel/topology: use smp_call_function_single_fail References: <20240206184911.248214633@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.8 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790177646971986635 X-GMAIL-MSGID: 1790177646971986635 Convert cpu_read_constcnt from smp_call_function_single to smp_call_func_single_fail, which will fail in case the target CPU is tagged as block interference CPU. Signed-off-by: Marcelo Tosatti Index: linux-isolation/arch/arm64/kernel/topology.c =================================================================== --- linux-isolation.orig/arch/arm64/kernel/topology.c +++ linux-isolation/arch/arm64/kernel/topology.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -280,6 +281,8 @@ static void cpu_read_constcnt(void *val) static inline int counters_read_on_cpu(int cpu, smp_call_func_t func, u64 *val) { + int ret, idx; + /* * Abort call on counterless CPU or when interrupts are * disabled - can lead to deadlock in smp sync call. @@ -290,7 +293,11 @@ int counters_read_on_cpu(int cpu, smp_ca if (WARN_ON_ONCE(irqs_disabled())) return -EPERM; - smp_call_function_single(cpu, func, val, 1); + idx = block_interf_srcu_read_lock(); + ret = smp_call_function_single_fail(cpu, func, val, 1); + block_interf_srcu_read_unlock(idx); + if (ret) + return ret; return 0; }