Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp542699imm; Wed, 6 Jun 2018 01:51:34 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJjkBn3a382JimFDRDyQuqn6i+m/HMc12tuffoR0PUrVVZQnz91h7VtSs1Ph3pT+Up2a6zH X-Received: by 2002:a62:da07:: with SMTP id c7-v6mr469169pfh.106.1528275094512; Wed, 06 Jun 2018 01:51:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528275094; cv=none; d=google.com; s=arc-20160816; b=NfHgMfvTiWa2ne9dhLpJlTzUD0zhUxTaQCRy95KN78Yk/X1LLSkdPjeBUIsEOq5euQ 9PiU7BVsCtKKHduJTsMs/l7g155NWjTEoN9BA5H7LbTeLNbkLRqlFN+5VtmYkzoYWpJI C5PAUvZpUiW0aXtebMrVzf/zU5fELW++4sN/gKkGyWTrNk7XoTwAnZyJS2sP8wQMUokH cgN2jEcS99Sv1Pa6QcUbKKS0iSsdrd9k0RzU7gqQryIjoUGx9Uk89miZ4HPUoiCPdcDe PfMWtPl6y/nQ2WbuinJp/RzRMl42U6gHnvQ0CfOlBSYLVM3O0QVlB74iitkSgNqsV8/k tSww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=7BFICWnRtNGry8E0NDhb7KNs5Y5OVhrcgcm2g5SaP7A=; b=QiCstUKtzL3TqPTOdtF3TIMbkdnxQvQyeREchyxaU2KP3tMCL9DmlvXGsl4Ahe3xwi 714a0G6iy1Bc+kO1/ncEPa9bb9vs109Mx7YEVV+i93KVoxAVMT5/kS3VWHJ3lmRPtVTf ebQB/flH29uzhLgQPZfDOQBuDzhqjfhpBRG9mzFJedo2nNhsPnGWUirhGXgmpDxgQ8zW HIYb4KWNFFmKc3dMGLiI9X2eDMsM4DrszoLBlbzoW2JGexSXzbYGoo9bwu5p+jW6sryl vOlIa6rw5V/tPUdYASiosvpGzbaUFYEzte2bNnpSGsZSx4oZeR5mLLOpedlYOgDCR2Tx QHCA== 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 p61-v6si51584974plb.472.2018.06.06.01.51.20; Wed, 06 Jun 2018 01:51:34 -0700 (PDT) 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 S932275AbeFFIu5 (ORCPT + 99 others); Wed, 6 Jun 2018 04:50:57 -0400 Received: from mga07.intel.com ([134.134.136.100]:35166 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932150AbeFFIu4 (ORCPT ); Wed, 6 Jun 2018 04:50:56 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Jun 2018 01:50:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,482,1520924400"; d="scan'208";a="205734181" Received: from aaronlu.sh.intel.com (HELO intel.com) ([10.239.159.135]) by orsmga004.jf.intel.com with ESMTP; 06 Jun 2018 01:50:54 -0700 Date: Wed, 6 Jun 2018 16:50:54 +0800 From: Aaron Lu To: kernel test robot Cc: Tejun Heo , lkp@01.org, LKML , Michal Hocko , linux-mm@kvack.org, Huang Ying Subject: Re: [LKP] [lkp-robot] [mm, memcontrol] 309fe96bfc: vm-scalability.throughput +23.0% improvement Message-ID: <20180606085053.GA21167@intel.com> References: <20180528114019.GF9904@yexl-desktop> <20180601072604.GB27302@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180601072604.GB27302@intel.com> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 01, 2018 at 03:26:04PM +0800, Aaron Lu wrote: > On Mon, May 28, 2018 at 07:40:19PM +0800, kernel test robot wrote: > > > > Greeting, > > > > FYI, we noticed a +23.0% improvement of vm-scalability.throughput due to commit: > > > > > > commit: 309fe96bfc0ae387f53612927a8f0dc3eb056efd ("mm, memcontrol: implement memory.swap.events") > > https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master > > > > in testcase: vm-scalability > > on test machine: 144 threads Intel(R) Xeon(R) CPU E7-8890 v3 @ 2.50GHz with 512G memory > > with following parameters: > > > > runtime: 300s > > size: 1T > > test: lru-shm > > cpufreq_governor: performance > > > > test-description: The motivation behind this suite is to exercise functions and regions of the mm/ of the Linux kernel which are of interest to us. > > test-url: https://git.kernel.org/cgit/linux/kernel/git/wfg/vm-scalability.git/ > > > > With the patch I just sent out: > "mem_cgroup: make sure moving_account, move_lock_task and stat_cpu in the > same cacheline" > > Applying this commit on top doesn't yield 23% improvement any more, but > a 6% performace drop... > I found the culprit being the following one line introduced in this commit: > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index d90b0201a8c4..07ab974c0a49 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -6019,13 +6019,17 @@ int mem_cgroup_try_charge_swap(struct page *page, swp_entry_t entry) > if (!memcg) > return 0; > > - if (!entry.val) > + if (!entry.val) { > + memcg_memory_event(memcg, MEMCG_SWAP_FAIL); Removing this line restored performance but it really doesn't make any sense. Ying suggested it might be code alignment related and suggested to use a different compiler than gcc-7.2. Then I used gcc-6.4 and turned out the test result to be pretty much the same for the two commits: (each test has run for 3 times) $ grep throughput base/*/stats.json base/0/stats.json: "vm-scalability.throughput": 89207489, base/1/stats.json: "vm-scalability.throughput": 89982933, base/2/stats.json: "vm-scalability.throughput": 90436592, $ grep throughput head/*/stats.json head/0/stats.json: "vm-scalability.throughput": 90882775, head/1/stats.json: "vm-scalability.throughput": 90675220, head/2/stats.json: "vm-scalability.throughput": 91173479, So probably it's really related to code alignment and this bisected commit doesn't cause performance change(as expected). > return 0; > + } > > memcg = mem_cgroup_id_get_online(memcg); > > If I remove that memcg_memory_event() call, performance will restore. > > It's beyond my understanding why this code path matters since there is > no swap device setup in the test machine so I don't see how possible > get_swap_page() could ever be called. > > Still investigating... >