Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3079281rdb; Wed, 13 Sep 2023 00:59:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHP+siSUVMvHnqGHXVLaVeL9ZgqWGPdPDRe6Ie2Z6UwaVCZl9Z0UfG4zQG8owz+zp9s22rm X-Received: by 2002:a17:902:e812:b0:1bb:83ec:832 with SMTP id u18-20020a170902e81200b001bb83ec0832mr2157163plg.2.1694591942063; Wed, 13 Sep 2023 00:59:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694591942; cv=none; d=google.com; s=arc-20160816; b=ipqNoMRdGV34RkWR1pVV6Ge4WS4fcCYypa0iBVlzfVbtUGOQDlQK79Cj62G1ZtRxVZ DAEMG1rJi+wcoRNFsWQHH/0PSYf9yhq3Ju9YuJqrr9cyYWoq6fKas5sdVwv2wTMCn0Vf j+y8m24/U3Pg3VXCBjCQoNe2OKZbUGCNRsF+tF+k+JYNwjsHIbE9wQYBYpEaQ53k1NLa jYQlEyCAdoZRuD5+i6CrOQ57GIQtG2eVwYvDrKuBEk/WG9iC7EjP2QuYdv2nZ9pGJ0uv VTp36Gv19NlTAtRvj64UXL3iymq4OhNufqld4ICKXbe0bwT2cdnAYR7eXTUzjfvM0E34 Kn5w== 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=yk9w7tl3Cq2a+/E5n8EngXXUF8nml2wwhMtU1n+ildQ=; fh=H4lu9Z6XU6Z2fZ72kUDEHt69ja1SxY3m2UtCxpu5seg=; b=uguiKb/q/2xF3lSgdtt+Syrlp9HazNn4DbTOMaP3WMJdZIaxhzo2xIRsNTYhow4D6B 6v+9X+UpEYfEWYBNVBZd/HgQEGSTB457kKjAro0ZywrL0XLuGRtTp+hO2DAzY1beIcd4 69P6JOFQE5Xpta7nlIqajzZcSK5+SBg9k58xPVBpmlAcMJDhygS/DcgZasl+dGiDKLb2 6LElG6NiK3l3uQkXwJ2STzD6caGxkBtHqmUQBzwtW/LnSpwjYGB49gaXXjnQg4UAf0v6 pSWLafYg89U7lY9Bib/ldT/z4ZgJDPtn2q7ZjcRqeyq+3qUW/BfGZ00641o/P6pwdlVb MoDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NmXTqIGp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id f4-20020a170902684400b001aff514a8f0si9369100pln.534.2023.09.13.00.59.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 00:59:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NmXTqIGp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 028E380C5F8D; Tue, 12 Sep 2023 09:05:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236558AbjILQFO (ORCPT + 99 others); Tue, 12 Sep 2023 12:05:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236583AbjILQFJ (ORCPT ); Tue, 12 Sep 2023 12:05:09 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8215310F4 for ; Tue, 12 Sep 2023 09:05:03 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CBC93C433C9; Tue, 12 Sep 2023 16:05:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694534703; bh=V/1P+uTkR8Y9g1C/QHoT7Uh+1sU48lnS8kVD/6SqiCo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NmXTqIGpIwYO31/9VBlYWASYynSAFUM+Ty8dKyuTb9B2Y3tjsTjZYDJWGvYjris1o 8c4IlC2f3R6fzW/wUjndVss/3BF0QyvvvB+Xrwp6ku5ngJFBXa0BhK3l9e2ZbH7zRk 0C7ee/mvNbYmnUmRBFAvtJzKCn3sh+RABt+x2UWAhbfsMGnW2JyQLIzosDpbw9taeQ ea6GXM89MTdJqMsMm0FVJyW16Vy06Y0ubKAVBtx96+IKvSqUolY2cACs7RVW+9Ol4Q fJwuClsvs7Sm//NAAGPt34Drmyj/PqCJPSg/Sr4fLqQ4VpyMQVY5gVD084O2wJduYn 1AMZ9Y4xlv38A== Date: Tue, 12 Sep 2023 17:04:59 +0100 From: Conor Dooley To: Jisheng Zhang Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] riscv: don't probe unaligned access speed if already done Message-ID: <20230912-shakiness-denture-69165e10017b@spud> References: <20230912154040.3306-1-jszhang@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Pjl3/Zy2tSNUUoky" Content-Disposition: inline In-Reply-To: <20230912154040.3306-1-jszhang@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 12 Sep 2023 09:05:16 -0700 (PDT) --Pjl3/Zy2tSNUUoky Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 12, 2023 at 11:40:40PM +0800, Jisheng Zhang wrote: > If misaligned_access_speed percpu var isn't so called "HWPROBE > MISALIGNED UNKNOWN", it means the probe has happened(this is possible > for example, hotplug off then hotplug on one cpu), and the percpu var > has been set, don't probe again in this case. >=20 > Signed-off-by: Jisheng Zhang Presumably this should grow a Fixes: 584ea6564bca ("RISC-V: Probe for unaligned access speed") on application. Patch seems fine to me, Reviewed-by: Conor Dooley Thanks, Conor. > --- > arch/riscv/kernel/cpufeature.c | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeatur= e.c > index 1cfbba65d11a..e12cd22755c7 100644 > --- a/arch/riscv/kernel/cpufeature.c > +++ b/arch/riscv/kernel/cpufeature.c > @@ -568,6 +568,10 @@ void check_unaligned_access(int cpu) > void *src; > long speed =3D RISCV_HWPROBE_MISALIGNED_SLOW; > =20 > + /* We are already set since the last check */ > + if (per_cpu(misaligned_access_speed, cpu) !=3D RISCV_HWPROBE_MISALIGNED= _UNKNOWN) > + return; > + > page =3D alloc_pages(GFP_NOWAIT, get_order(MISALIGNED_BUFFER_SIZE)); > if (!page) { > pr_warn("Can't alloc pages to measure memcpy performance"); > --=20 > 2.40.1 >=20 --Pjl3/Zy2tSNUUoky Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZQCMKwAKCRB4tDGHoIJi 0u2AAQDJXOTr4V+Guyy1WrFy+wQZS9QXv/enoUWBKD8RMS/HQwD9FkWGDjRftaQq WyroihCwFRCqRRdB5Bq1/KLYbw2ScQs= =w02h -----END PGP SIGNATURE----- --Pjl3/Zy2tSNUUoky--