Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1900400ybv; Sun, 23 Feb 2020 17:59:57 -0800 (PST) X-Google-Smtp-Source: APXvYqwYjCDXismcKp1HHI9Wx6ml884v53bTMEpEBLSaRuREgBstwPIDWswakbnFMHxqj5IQSWp2 X-Received: by 2002:aca:4994:: with SMTP id w142mr10543374oia.178.1582509597699; Sun, 23 Feb 2020 17:59:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582509597; cv=none; d=google.com; s=arc-20160816; b=qGMezmDzquw366jEaUVnYsZP95bOYwonOtBtunS9UGVNK2I/QPuwxmtohOPyLV4jxq kVQev0u/3lFAHXjB7p++Rp9m496U251HII6FQ2ffVogwhRdkLRLJGpU+ckv8A8jhJEYV 2wEnQ7J8w8dFnbBsc0iOHdYC22S/2r9GGxh9WMyM93VZ6tfbC3D0eFeB3U/9aYpZaf4N cbHkEX8lWNzjH2I9+gCnar90xXiqSkpeEHub2BP5axmV6EIoMA+zWH9rR9LTWPQd9AWI 6Uk3w3LrCR4fYG+uZoe4XPzfa8hgCY+Ly/iST0PHsqZWsQ9Mp2W0fmkQPWilV1MwR2PK cFUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=gzk2d6zEzPSEoc+BZlBrLt/xSkTClY/whk64qOpCe0k=; b=j1p//jmb4Pur+QynP6yhc259b4UxZduo6LFpJx6MHqdW2agkhFIUBmyY5/jwODjiI5 fAxyxoglvyMSzZEhabPF/FtjXDbiwpgbyAdg0CakCNy6FshXi3dGQ/NqaHx6xK4UkM36 gcfLop9kIVeTr2QOlTFMC8VagagbuLSDjHbJ2DyXPEKEJ4ztdrZnz4cIB4EJYKlQz59r GGMhknS4x6h+baSq+W8d79sNPUVvUpLGIITtGM5ESLsgQPZ8c+xxWUOxavYJpynbPSwX 8gKpz15thiN46uKisUSdNXyWSvnHuM9Z28ZeYaLzE/145sD0GukIB/9cDkwSud6Is9wi DBqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r4si5415432otq.188.2020.02.23.17.59.44; Sun, 23 Feb 2020 17:59:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727193AbgBXB6P (ORCPT + 99 others); Sun, 23 Feb 2020 20:58:15 -0500 Received: from mga09.intel.com ([134.134.136.24]:10201 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727151AbgBXB6O (ORCPT ); Sun, 23 Feb 2020 20:58:14 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Feb 2020 17:58:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,478,1574150400"; d="scan'208";a="349819289" Received: from yhuang-dev.sh.intel.com (HELO yhuang-dev) ([10.239.159.23]) by fmsmga001.fm.intel.com with ESMTP; 23 Feb 2020 17:58:09 -0800 From: "Huang\, Ying" To: Feng Tang Cc: Linus Torvalds , Jiri Olsa , Peter Zijlstra , kernel test robot , Ingo Molnar , Vince Weaver , Jiri Olsa , Alexander Shishkin , "Arnaldo Carvalho de Melo" , Arnaldo Carvalho de Melo , "Naveen N. Rao" , Ravi Bangoria , Stephane Eranian , "Thomas Gleixner" , LKML , , Subject: Re: [LKP] Re: [perf/x86] 81ec3f3c4c: will-it-scale.per_process_ops -5.5% regression References: <20200205123216.GO12867@shao2-debian> <20200205125804.GM14879@hirez.programming.kicks-ass.net> <20200221080325.GA67807@shbuild999.sh.intel.com> <20200221132048.GE652992@krava> <20200223141147.GA53531@shbuild999.sh.intel.com> <20200224003301.GA5061@shbuild999.sh.intel.com> Date: Mon, 24 Feb 2020 09:58:09 +0800 In-Reply-To: (Linus Torvalds's message of "Sun, 23 Feb 2020 17:06:33 -0800") Message-ID: <87lfosd9vy.fsf@yhuang-dev.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Linus Torvalds writes: > On Sun, Feb 23, 2020 at 4:33 PM Feng Tang wrote: >> >> From the perf c2c data, and the source code checking, the conflicts >> only happens for root_user.__count, and root_user.sigpending, as >> all running tasks are accessing this global data for get/put and >> other operations. > > That's odd. > > Why? Because those two would be guaranteed to be in the same cacheline > _after_ you've aligned that user_struct. > > So if it were a false sharing issue between those two, it would > actually get _worse_ with alignment. Those two fields are basically > next to each other. > > But maybe it was straddling a cacheline before, and it caused two > cache accesses each time? > > I find this as confusing as you do. > > If it's sigpending vs the __refcount, then we almost always change > them together. sigpending gets incremented by __sigqueue_alloc() - > which also does a "get_uid()", and then we decrement it in > __sigqueue_free() - which also does a "free_uid(). > One way to verify this is to change the layout of user_struct (or root_user) to make __count and sigpending fields to be in 2 separate cache lines explicitly. Best Regards, Huang, Ying