Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6443835rwl; Tue, 4 Apr 2023 12:52:01 -0700 (PDT) X-Google-Smtp-Source: AKy350Zg1A3OnEzCj8Xb22jcCvviyZoODD7faBVuUZ1heHG9Q0rtDseY0IXBrAb4V0+8UmaBBrNk X-Received: by 2002:a17:906:3b86:b0:8de:e66a:ece9 with SMTP id u6-20020a1709063b8600b008dee66aece9mr604063ejf.24.1680637921165; Tue, 04 Apr 2023 12:52:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680637921; cv=none; d=google.com; s=arc-20160816; b=JkXNgQkSE3ApzYIltNHhHCYiTFQKMIcmYnPZZoPa0PrLWhUZdqUyqocLS5tCOvU28W CIS7RMeeAybTba3A1R2nlA8Ssw/yaJF9/iomMZsfkeJBv0ivV7boqaom/Ku4Bnevo/rF COJ+w6wA+6TvUUHF0T5lZiswtpYXlQOD8Rs9YXJxr8HDEjIXTO2crxjgluCGm6x/4+Yj dxm/D2v4QB+rILmRmqWDX+AgZPs47YcFa7yJoytsCR5dNyGMQrMWSO9ICML+PUmSa+Nz lVsmv92r8vL4uT/AfJUcoDKZfLJPrEOeHwKB4WqDjYo98QnQ9BBcFXGt/p6vzHqUXsku 8cEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=6CGGYiK7R7iym5OMqiH+Gz2BZGoptbAOBkaXb5F+LEU=; b=BhpyAvF/GT0RcrXFXHD6DDaaxsnyqtJw8krNS79vg2sXlKgAnfPCiJFj7QcivbxLt7 8Z9dh0H2TdO5/MfRleq09fqt0mZ2N0FleqLHGSqsIC3sIzWNSU7/E92jG7yxIgf2AHgv bqswKASXR33eHMBx1BUopR5of0SocgEePBPkVaqsV8c75WZbxoVgjoEqFzwmoBWrcSZr mFC9QknBhPGWwGD2Dl8jwHXFVkSfb+/wjD+Otqn7crCYx27OMCwkw2PxGmAGtZM/j761 w6dziq7y0+rVyKksemn8cLooIk2ON1AOqLoOpKhB119994aID+hw4q83T7NmGQsxzmRA 90tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=FHG9pOZw; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gr2-20020a170906e2c200b009327a2315a7si786198ejb.470.2023.04.04.12.51.35; Tue, 04 Apr 2023 12:52:01 -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=@google.com header.s=20210112 header.b=FHG9pOZw; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236130AbjDDTia (ORCPT + 99 others); Tue, 4 Apr 2023 15:38:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236110AbjDDTi2 (ORCPT ); Tue, 4 Apr 2023 15:38:28 -0400 Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com [IPv6:2607:f8b0:4864:20::b2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABB5AC7 for ; Tue, 4 Apr 2023 12:38:25 -0700 (PDT) Received: by mail-yb1-xb2a.google.com with SMTP id i6so40122260ybu.8 for ; Tue, 04 Apr 2023 12:38:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1680637105; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=6CGGYiK7R7iym5OMqiH+Gz2BZGoptbAOBkaXb5F+LEU=; b=FHG9pOZw6QmiAsoXPIuoU//8W+Zy9FAsKNV4Ix2hWzpJnqm6WKjv/tnPxvIKjz0ICe inNKM4e6vkHLrcr1dAtRZdPlv2+82wL1LgaehGuzpQ9jkG19X6B80g/R2EmtwqxoXpUm fCD3qaGgerG73zrDeEDzqtLGWfVRgoE8Y+F7uM22Ei2qu6A7R1SDcsJKuteZuL0SeeYN 5xD2JKWiT9q8TLpty/KpQWU0CGYTd0ks66+Ird2xV3c2gkE5zaxZCJk7poCJpDd1wpN7 cPPG9pR85FY41stTvKpEPyVgO2/iuasCzmIZjEQyBjcx9aMvTeHbE6tDbKyKpZOfcioX 2SDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680637105; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6CGGYiK7R7iym5OMqiH+Gz2BZGoptbAOBkaXb5F+LEU=; b=lBCdS+N9YuFkz7cjkP9JyOPjebZLL2JjMb53czsaSE3NzYibZfbkOE4tgqWv/lK670 y+YHfsY9xSzmP0oWWDKusrELh9hkDXk3L8vaWXM1SBwBh1IIf+seCozlx+xh19ESV/HW I1aOe055eRuSW28i0MSm5AEGPE7XnERbDTgGeenTTVNf6WrtzsWxUbDv+LktsJzWTh1c gnwjHCaPeqXXrreWGRUPOGbO4eLuJS9m6bsPGaIqczs2P7avEeUDtSnbTkoNTBhtdgLg m1wSH2tbnzXAK3ABHLDyRikP4YmFPuGZ6DbPrxCTac1nio4HbESPRFBB3B3lsn76RufF 12/g== X-Gm-Message-State: AAQBX9dseewRqyzL/aCxIisv6D2vI19EZ4qLR7i1owZBgEr6cCn33wAB p9h26K7S9HgoDbNfIqdxqY+aH2rwjayx4KZ2Uj4cHA== X-Received: by 2002:a25:ca41:0:b0:b7c:1144:a708 with SMTP id a62-20020a25ca41000000b00b7c1144a708mr2525071ybg.12.1680637104711; Tue, 04 Apr 2023 12:38:24 -0700 (PDT) MIME-Version: 1.0 References: <20230404052228.15788-1-feng.tang@intel.com> In-Reply-To: <20230404052228.15788-1-feng.tang@intel.com> From: Shakeel Butt Date: Tue, 4 Apr 2023 12:38:13 -0700 Message-ID: Subject: Re: [PATCH v3] Documentation: Add document for false sharing To: Feng Tang Cc: Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Randy Dunlap , Bagas Sanjaya , Arnaldo Carvalho de Melo , Joe Mario , Ingo Molnar , Peter Zijlstra , Linus Torvalds , Andrew Morton , Eric Dumazet , Thomas Gleixner , dave.hansen@intel.com, ying.huang@intel.com, tim.c.chen@intel.com, andi.kleen@intel.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-15.7 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=unavailable 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, Apr 3, 2023 at 10:28=E2=80=AFPM Feng Tang wro= te: > > When doing performance tuning or debugging performance regressions, > more and more cases are found to be related to false sharing [1][2][3], > and the situation can be worse for newer platforms with hundreds of > CPUs. There are already many commits in current kernel specially > for mitigating the performance degradation due to false sharing. > > False sharing could harm the performance silently without being > noticed, due to reasons like: > * data members of a big data structure randomly sitting together > in one cache line > * global data of small size are linked compactly together > > So it's better to make a simple document about the normal pattern > of false sharing, basic ways to mitigate it and call out to > developers to pay attention during code-writing. > > [ Many thanks to Dave Hansen, Ying Huang, Tim Chen, Julie Du and > Yu Chen for their contributions ] > > [1]. https://lore.kernel.org/lkml/20220619150456.GB34471@xsang-OptiPlex-9= 020/ > [2]. https://lore.kernel.org/lkml/20201102091543.GM31092@shao2-debian/ > [3]. https://lore.kernel.org/lkml/20230307125538.818862491@linutronix.de/ > > Signed-off-by: Feng Tang > Reviewed-by: Randy Dunlap Reviewed-by: Shakeel Butt