Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp308088pxb; Thu, 12 Nov 2020 04:31:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJxrchUK8kEQlFLHVR+/3gBlL3eEmj3X6Ae86dWjGkkwNHmPFrKaPJQnj7qZmeknG1so8HbP X-Received: by 2002:a17:906:3a8d:: with SMTP id y13mr30686511ejd.460.1605184285991; Thu, 12 Nov 2020 04:31:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605184285; cv=none; d=google.com; s=arc-20160816; b=C83jsQr2XkxY0qV4KXlAJZIPpw8HRp3/cauE3+2IXSw6zbMkX0lSdMh65B8fkt8FMQ dJFCNwhmi6oyjBRjgkBsp3/GPqn//b8AaVxIi8RHOdtEvSS1jn9266POPWQl/zLK/1WL ix7kxZcd4t0IYiSZAfOc5vF9DejRvIm+67p4AwCC5TY4aSXSZBH3hwA8ekPXTwx5kUgi 698VwgVyITcRI/vgbe0CBU9WdcN0+nqe1Y5G4DBWLPHKtuIU86Oev2K/xdrzYAj4DhwY RhjWW7aGZIc41RTa8PFOQPTgQQWgavPRDvuNEnrLmd+nzcNiXes+sVGOcBiFM8tdN1zj S66Q== 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 :ironport-sdr:ironport-sdr; bh=feyigvX36JCuqpAj/svSmMQzwoGpqUw1xOfhO7L0LS8=; b=oRW8xZV0641FSOHkCXp6OqqKHhi8hjY1sYeyAQdVf2j9NVAAZwZuLXt9joUlapKu0/ Gj0sUG8+IYp76bw9l340Pcoysc4wiVI4Gov7v4ww40vOb4JmDcR93NKk8KahgQbg9vu4 YXPCMBjcOyojvIGnKkbmZYVWIHKvqqFVpFEsSiHEESHr/sTGICTKI52w5MBzOiK6pOsh j83/ny5IZuIGeYjUjIuTF+DtPsPZS7Zjn+KnaLPzYK9w/VP6hEqZlmMhYeWoWazoExLy Wg+iSujv6l6gD2K+n2hWbONtt1H7HNioaWrwO7WaRGukghDocKWw9dN6buhigf7qD4VL 38kw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id h11si3761045edn.539.2020.11.12.04.31.02; Thu, 12 Nov 2020 04:31:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1727646AbgKLM2u (ORCPT + 99 others); Thu, 12 Nov 2020 07:28:50 -0500 Received: from mga01.intel.com ([192.55.52.88]:21637 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726969AbgKLM2u (ORCPT ); Thu, 12 Nov 2020 07:28:50 -0500 IronPort-SDR: SX3zXs5Iew2UObSmSGqnspC8OZ/h373mIexmLBIMly0+9h/7JW/ObJIAEK/KLAJcFwSg1kaL+x qWJ99TwVzNTg== X-IronPort-AV: E=McAfee;i="6000,8403,9802"; a="188295147" X-IronPort-AV: E=Sophos;i="5.77,472,1596524400"; d="scan'208";a="188295147" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Nov 2020 04:28:49 -0800 IronPort-SDR: cYT05BI9hxvnX9PUk2QLfJ0mphTCpDXpBr9Pw1Lp6Hgj3aKdYuTckw3C1Hfjq/3ovCmNGK6ep3 KCZvZ+DpENaQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,472,1596524400"; d="scan'208";a="357073525" Received: from shbuild999.sh.intel.com (HELO localhost) ([10.239.147.98]) by fmsmga004.fm.intel.com with ESMTP; 12 Nov 2020 04:28:45 -0800 Date: Thu, 12 Nov 2020 20:28:44 +0800 From: Feng Tang To: Michal Hocko Cc: Xing Zhengjun , Waiman Long , Linus Torvalds , Andrew Morton , Shakeel Butt , Chris Down , Johannes Weiner , Roman Gushchin , Tejun Heo , Vladimir Davydov , Yafang Shao , LKML , lkp@lists.01.org, lkp@intel.com, zhengjun.xing@intel.com, ying.huang@intel.com Subject: Re: [LKP] Re: [mm/memcg] bd0b230fe1: will-it-scale.per_process_ops -22.7% regression Message-ID: <20201112122844.GA11000@shbuild999.sh.intel.com> References: <20201102091543.GM31092@shao2-debian> <20201102092754.GD22613@dhcp22.suse.cz> <82d73ebb-a31e-4766-35b8-82afa85aa047@intel.com> <20201102100247.GF22613@dhcp22.suse.cz> <20201104081546.GB10052@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201104081546.GB10052@dhcp22.suse.cz> User-Agent: Mutt/1.5.24 (2015-08-30) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Michal, On Wed, Nov 04, 2020 at 09:15:46AM +0100, Michal Hocko wrote: > > > > Hi Michal, > > > > > > > > We used the default configure of cgroups, not sure what configuration you > > > > want, > > > > could you give me more details? and here is the cgroup info of will-it-scale > > > > process: > > > > > > > > $ cat /proc/3042/cgroup > > > > 12:hugetlb:/ > > > > 11:memory:/system.slice/lkp-bootstrap.service > > > > > > OK, this means that memory controler is enabled and in use. Btw. do you > > > get the original performance if you add one phony page_counter after the > > > union? > > > > > I add one phony page_counter after the union and re-test, the regression > > reduced to -1.2%. It looks like the regression caused by the data structure > > layout change. > > Thanks for double checking. Could you try to cache align the > page_counter struct? If that helps then we should figure which counters > acks against each other by adding the alignement between the respective > counters. We tried below patch to make the 'page_counter' aligned. diff --git a/include/linux/page_counter.h b/include/linux/page_counter.h index bab7e57..9efa6f7 100644 --- a/include/linux/page_counter.h +++ b/include/linux/page_counter.h @@ -26,7 +26,7 @@ struct page_counter { /* legacy */ unsigned long watermark; unsigned long failcnt; -}; +} ____cacheline_internodealigned_in_smp; and with it, the -22.7% peformance change turns to a small -1.7%, which confirms the performance bump is caused by the change to data alignment. After the patch, size of 'page_counter' increases from 104 bytes to 128 bytes, and the size of 'mem_cgroup' increases from 2880 bytes to 3008 bytes(with our kernel config). Another major data structure which contains 'page_counter' is 'hugetlb_cgroup', whose size will change from 912B to 1024B. Should we make these page_counters aligned to reduce cacheline conflict? Thanks, Feng