Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp573438rwl; Thu, 23 Mar 2023 21:50:04 -0700 (PDT) X-Google-Smtp-Source: AKy350ZSEYWHaRFWc35PiIxg23U8Q09mlPHExHG87Hr+5eqBsoV4qRA3Nw53LRUulQJtzrkABv8f X-Received: by 2002:a17:906:55cd:b0:933:1134:be1e with SMTP id z13-20020a17090655cd00b009331134be1emr1280316ejp.53.1679633403813; Thu, 23 Mar 2023 21:50:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679633403; cv=none; d=google.com; s=arc-20160816; b=PVJZGL8xoOUvatCooWhLlkcNLGZ5boqrfz+8zMGjeLPMXvIpK/3QmcwrGLRqmLn0DV Pcwj0zZxTY54g0n0b5ZLRKHHIqUaRGPJ9cuoksaoCQZf75mxAbTT1LM39m1oRR42CGDA QG+FClXQJk2Hky4HCI61fSZcb1Kd8pV8fZaJWYucC+KsbXXvIti22dU8P5xS63BHdSCo qNuzcbTN3MaJU0wxTmHfUah1Hss78ygAawiYFHNswZN9jLn8cwkd3oqsy2j6/SvMQydY uwmNThw7qEXi9TpQ47c6cuAwf8myY8D85RxgwEJPh9mntp68/ueoExZFumNTSiScaTvB mLOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=tFSxKzdCHt/dcQq+NfQ6l0WFyAWV4COX8pFL7v6wAJY=; b=Y+2xWv4IQUaCZa736Ebf4tYHGaqvOfBopRoTMPp09XjaGe35BjLkQjRa5U7oY8vJkW b6QcJTPVhI2uRITVcZsOfqwgqheZMigdIjmObQxjDvc7wMxWvCYzwFYQhouwpiYmgjBx Jp2JiyN0257lJx9GRQ42ah+ZxFB5v3gNgfoPOrX2xjWX8BWZCsB5mnh6DcSi01UbLA7k 2KUrSE0g7hlPeiFzXYMKQM2bBH/2T+SDk6YnLNNhQe/bFVGM1ypkAuuprnw04DBU7ECj U/fCXCmr9YX5tDREPelZc2GNiSNlUtiuDn9BO7Ny+EPfO3Ci73VajGK9Fdv3rejQTqbY 4rwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=imM1Retq; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp23-20020a1709073e1700b0093defbd6291si1368854ejc.1048.2023.03.23.21.49.39; Thu, 23 Mar 2023 21:50:03 -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=@infradead.org header.s=bombadil.20210309 header.b=imM1Retq; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230040AbjCXEaY (ORCPT + 99 others); Fri, 24 Mar 2023 00:30:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229499AbjCXEaX (ORCPT ); Fri, 24 Mar 2023 00:30:23 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC8A019F16; Thu, 23 Mar 2023 21:30:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Sender:Reply-To:Content-ID:Content-Description; bh=tFSxKzdCHt/dcQq+NfQ6l0WFyAWV4COX8pFL7v6wAJY=; b=imM1RetqpzJF3NRW6J896U5GTY iGGxojVa1Au/xl2iWHCwGIx0zmCN6rzLjt2nboBP1xBqxxgo1LaIXOHjEkb7s+JpHSM8hzH+GfrY1 BqzryrindmJweu1J+BBCUmy8ykFcOtlrBIvDW0V0ozaedY+7vUghYXrutH5ZJGDC3VUPPqQRisZi9 8QTVOX1/VrVHxiQRTH03jddKFEMrOvihtOIIGuDrcSKocHLf1ChUkwzlysHxszxFjkTe1yNroy0SE bMHjA7NHVHoWjYvWqdnjxw6VgRY/quGOeEWHyf7bZdCjre11hbea4KytZsKOrJIYMtz7uKuBKS10t hgaBzwYA==; Received: from [2601:1c2:980:9ec0::21b4] by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1pfZ4D-003W5h-0b; Fri, 24 Mar 2023 04:30:17 +0000 Message-ID: Date: Thu, 23 Mar 2023 21:30:14 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH RFC] Documentation: Add document for false sharing Content-Language: en-US To: Feng Tang Cc: Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , Joe Mario , Ingo Molnar , Peter Zijlstra , Linus Torvalds , Andrew Morton , Eric Dumazet , Shakeel Butt , dave.hansen@intel.com, ying.huang@intel.com, tim.c.chen@intel.com, andi.kleen@intel.com References: <20230323082626.100718-1-feng.tang@intel.com> From: Randy Dunlap In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 Hi-- On 3/23/23 20:03, Feng Tang wrote: > Hi Randy, > > Thank you for the thorough reviews! > > On Thu, Mar 23, 2023 at 09:49:02AM -0700, Randy Dunlap wrote: >> Hi, >> >> Lots of good/interesting info here. >> >> On 3/23/23 01:26, Feng Tang wrote: >>> From: "Tang, Feng" >>> + >>> +'refcount' is modified frequently, but 'name' is set once at object >>> +creation time and is never modified. When many CPUs access 'foo' at >>> +the same time, and 'refcount' is only bumped by one CPU frequently, >>> +while 'name' is read by all other CPUs, which have to reload the whole >>> +cache line over and over, even though the 'name' is never changed. >> >> That last "sentence" is not a sentence. > > How about: > > " > When many CPUs access 'foo' at the same time, with 'refcount' being only > bumped by one CPU frequently and 'name' being read by other CPUs, all > those reading CPUs have to reload the whole cache line over and over > due to the 'sharing', even though 'name' is never changed. > " > ? Yes, that's good. Thanks. -- ~Randy