Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp1131276pxb; Wed, 16 Feb 2022 11:42:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJyrLdz8laUoRx/F/eqop/aukV8OU5w7i4GXACl48To3jYgsqO2KXg3lW/HEhORdMj7WnlWl X-Received: by 2002:a17:906:b155:b0:6c9:ea2d:3363 with SMTP id bt21-20020a170906b15500b006c9ea2d3363mr3442263ejb.729.1645040569009; Wed, 16 Feb 2022 11:42:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645040569; cv=none; d=google.com; s=arc-20160816; b=WY3nfEKkdVCvfM6MI+5EV8oRxGGKoWmCEWMt70Uo+w46I7IhvLJw/mUKDuJw/qCGWA UWFgSuvvhIhvNEKB0mS3RWcmBmWfnlJpK686lAbxig1asVNgyGnI1gEp3RIrrf7DwsOY z7Onyc75RdNM0VkuZbkUwxYHTzgtCLvhKUph4Il76Cz4+sFoEzCU/9qmUxGuAlu7h9CU aij9r5wxP3CpbcsnQibFhkrknwxOrC7SwD2sHRsWetiWJB1UJjs1uw7eFueLTk5m212G fQ1aN41YUBL8z60YaXkY/EYS00gKYScZ5KllrQFx4jm/FvlyVjZXGEJ6NjuOLezogFa8 a01w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=iWYK3e6xwkW0Lbynsl1LJvqBNRdMDNn0qgM6Nq4Dkyg=; b=JDadP8wdv+z0v+k1WWx3MAoMLVFpo3O4JFSE51xgTdv9rh0S5IAZuzTAnnKLn/AIXA WE01B2nPlQE71uzn+c86T+lMdbRAjxEE1QCmK9lL4kJIm9xGSmkjzCO4txVaoDcXsRP5 nJ/46o/7fi2lGXe3xh9kfwLgoKl4/ngaILEB8Rvc0uTEBaf4eGqpo62zzck3t9brUf3Z wfyEo+q0Qzoce3fDkwRo9gRS844WxsBWD2TootgUTwfzHYdasJIiCuW2HKmFWVoPeoia dPaDKp4IyYX+hiNmE+jLh6fST0ulXQ4s65y0FX4snX18CU4QU6Vcw5QP4Uw0q2GPspqi GBpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CVRG844d; 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 sa15si496051ejc.797.2022.02.16.11.42.26; Wed, 16 Feb 2022 11:42:48 -0800 (PST) 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=CVRG844d; 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 S236901AbiBPRKF (ORCPT + 99 others); Wed, 16 Feb 2022 12:10:05 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:49598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236575AbiBPRKE (ORCPT ); Wed, 16 Feb 2022 12:10:04 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCDF32A7957 for ; Wed, 16 Feb 2022 09:09:52 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 64F0661BA6 for ; Wed, 16 Feb 2022 17:09:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D29ADC004E1; Wed, 16 Feb 2022 17:09:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645031391; bh=mC1Fks7IJyldNKvSocN4kpd3GRB2OB/Ri6oYSh4ZU0U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CVRG844dJm/53DJkdf9KNjs4psuCCL/81ATTFydbMCDLfGMDsx1k3wlMu5XbshbHk zu1DiOg/FsylEsEcy350txBeCl1GuUpj9D/cCwmtCYBsbdLFjOS8W+zu6IN/9hGRTn i8HN0DCB4b3NCJ/U694UXog8WnlGu216TW6Oa06JrbpIL743YO4RYUCB0pdFDbeUCT dTaBddfXxShB5Z2zx4GmNbVPMQqInEDsbJ8i9nFKGpEprSoypcMLOAHK79zUkpv67G vFtyRX1OwxEVRu8TGsEZyEL069GvWBf2KypMsYAhne7yw9hQmGqDNEMI1QOOe6ZDzY BqlFMV+CUggKQ== Date: Wed, 16 Feb 2022 17:09:47 +0000 From: Will Deacon To: Jisheng Zhang Cc: Catalin Marinas , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64: Add read_mostly declaration/definition to irq stack ptr Message-ID: <20220216170947.GB10784@willie-the-truck> References: <8798a3cc-6e64-6966-d5ad-fadca79d92ba@synaptics.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8798a3cc-6e64-6966-d5ad-fadca79d92ba@synaptics.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-7.2 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,T_SCC_BODY_TEXT_LINE 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 Mon, Feb 07, 2022 at 04:46:42PM +0800, Jisheng Zhang wrote: > Add "read-mostly" qualifier to irq_stack_ptr and > irq_shadow_call_stack_ptr. This is to prevent the false sharing. > > Before the patch, I got below percpu layout with one defconfig: > ffffffc008723050 : > ffffffc008723050: 00 00 00 00 > .... > > ffffffc008723054 : > ffffffc008723054: 00 00 00 00 > .... > > ffffffc008723058 : > ... > > ffffffc008723060 : > ... > > ffffffc008723070 : > > As can be seen, the irq_stack_ptr sits with the heavy read/write percpu > vars such as fpsimd_last_state etc. at the same cacheline. > > After the patch: > > ffffffc008723000 : > ... > > ffffffc008723008 : > ... > > ffffffc008723010 : > ... > > ffffffc008723018 : > ... > > Now, the irq_stack_ptr sits with read mostly percpu vars such as > cpu_number etc. at the same cacheline. Were you able to measure any performance difference after this change? Will