Received: by 2002:a05:622a:1442:b0:3a5:28ea:c4b9 with SMTP id v2csp755982qtx; Mon, 31 Oct 2022 13:07:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM42AqLKK3GhaKuTTLXtMTMenMWy3Dtd+cYICwD7ISYJyELiKywfYK//6VIoVzQ/mlN6MhTL X-Received: by 2002:a05:6a00:1345:b0:56d:96a6:ad47 with SMTP id k5-20020a056a00134500b0056d96a6ad47mr4104132pfu.32.1667246852704; Mon, 31 Oct 2022 13:07:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667246852; cv=none; d=google.com; s=arc-20160816; b=kG1UsTkAaT5KRH6i9ArRZRNI9PZrJPutwnzhXHyryOrxLEVMUrtrAbZoSgxCyp9fst +Y4gln5HwesbUOaukStz4l6rOMgMFI0zbMwgbGPSLiMCL/H87iNBFXq5WzsytG93brdy tOvWOSQhyUiUMABrEtEuCwDcrcm8SOvD46HxZlY0Rm6iBikgldUFfyCKyRa1/ctOwLmJ NCoi62ybSJzCXs2up3BStMAcRusXiv9W5LY74ex/QsJPSB2XUeORMfaSYu0V63jHiFHC i1cH7cCG3rSlor0sqh+9QdJMAsA0HN8cLTqlPkdSqTFi/B/sOHYBEs9ZcPPWz4HJHTn/ 9HVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=RfNJO3l6Z7ys3V2gv6jY7NJdUjVqbm++e3A312/U12E=; b=hVBYz6jKXd+r8DaGJ7Ts1yCkTvcMyDQFcCmNY9ZSVjkRQLP9isk3gTT9+/dwB3tF1h DkNDK04Vn3ILdKutZ3FuvZhE2JL/17pD/roNRBwhWbwFnbQUsZuuYoXJ3gFR3YhUtLY+ EnfKWnJyTHUQRccNml3J6yXy48RrsPGltp6Falqb7Na4oOTLOjnL4QC1Oz6vAMaKn4RI XeeymzJ5zFfIctuGRqnTLthZCJ7F9XmbxVgDCCZwdcf5543vVyWT8STz+MiVdWeGgIkv P8ZUIC43BemX1eLnSIVWDY8C3PfRuQd9sicOwSTwXcJAbdE+dEV8CTjy4rbaq+j6MLq+ Ekrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=T6+KBsQA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d22-20020a056a0024d600b0056bffcfc30csi10857600pfv.249.2022.10.31.13.06.54; Mon, 31 Oct 2022 13:07:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=T6+KBsQA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229799AbiJaTMG (ORCPT + 98 others); Mon, 31 Oct 2022 15:12:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229752AbiJaTME (ORCPT ); Mon, 31 Oct 2022 15:12:04 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CBCB1181E; Mon, 31 Oct 2022 12:12:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C817EB81A02; Mon, 31 Oct 2022 19:12:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1926C433D6; Mon, 31 Oct 2022 19:11:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667243521; bh=yOLlW4b3WOWWf4x3j0sTzOFLrIjxCJoh5lRv8XuHQX0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=T6+KBsQAKIWoX9OhQwvZEA8O7d6lcTQ0zQivckZkAi8YXxmX2M7GlEwhaTDEE2I8j mWOEP5MV4yvJTHJFV048SCifQSLH2CWdqXWe0kZc3d64BaDL6lCURlM7LeIbtRzW1l ztNodA+LNLKLQgJHoejf04w+uKENE1lwuraAFzTsA6fAd/jwBly88jQLnLWLDBmS5n IXme8eckTS5ZsZ3XKteuztI5FMlqMGWlguzKemc2gPadwn1Xg88jiNUgLqzDxUs2AE b20JNxI1MTcxxCsIK6sLwfHEgbANCV3j8kcy4Q4OiLXDk7tThS36o4V35PqABCN6y1 6J5O31R7jAz5Q== Date: Mon, 31 Oct 2022 19:11:56 +0000 From: Conor Dooley To: Atish Patra Cc: linux-kernel@vger.kernel.org, Albert Ou , Atish Patra , Anup Patel , Damien Le Moal , devicetree@vger.kernel.org, Jisheng Zhang , Krzysztof Kozlowski , linux-riscv@lists.infradead.org, Palmer Dabbelt , Paul Walmsley , Rob Herring Subject: Re: [PATCH] RISC-V: Do not issue remote fences until smp is available Message-ID: References: <20221028231929.347918-1-atishp@rivosinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221028231929.347918-1-atishp@rivosinc.com> X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 28, 2022 at 04:19:29PM -0700, Atish Patra wrote: > It is useless to issue remote fences if there is a single core > available. It becomes a bottleneck for sbi based rfences where > we will be making those ECALLs for no reason. Early code patching > because of static calls end up in this path. > > Signed-off-by: Atish Patra Hey Atish, This doesn't apply for me to either fixes or for-next. What branch does it apply to? Thanks, Conor. > --- > arch/riscv/mm/cacheflush.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/arch/riscv/mm/cacheflush.c b/arch/riscv/mm/cacheflush.c > index f10cb47eac3a..7fafc8c26505 100644 > --- a/arch/riscv/mm/cacheflush.c > +++ b/arch/riscv/mm/cacheflush.c > @@ -19,6 +19,10 @@ void flush_icache_all(void) > { > local_flush_icache_all(); > > + /* No need to issue remote fence if only 1 cpu is online */ > + if (num_online_cpus() == 1) > + return; > + > if (IS_ENABLED(CONFIG_RISCV_SBI) && !riscv_use_ipi_for_rfence()) > sbi_remote_fence_i(NULL); > else > -- > 2.34.1 >