Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp516661pxb; Wed, 27 Jan 2021 13:37:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+N6k/NpCwggQHge5sMfPDBz1WVZZ/xIUYo8zoM/TwHFD4KRC+DX8EQDXFLD+3a0w3bgHd X-Received: by 2002:a17:906:2a06:: with SMTP id j6mr7926895eje.164.1611783444538; Wed, 27 Jan 2021 13:37:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611783444; cv=none; d=google.com; s=arc-20160816; b=oobjRrQMNMWyVa0HosBkrXPvfJmXmJeaACKjzngRbmVAYkmLbXrm0NILieulMmzqeh PAqGr9mJpcNMsVaW86eRQqt0OwiRXg9LPyljU85yP5A1h6KXC6W231oSVL7fcqapXGIw V1xeRtdLm3lBrGUxswBc3zUxch9oV5vW2vWNgGmgd/VMjzSM2JnlmLWP3C5ML0qWT3DV BZpKSDF1W0nyvCCuKTOfBSZSjJwr8m4MexL0x+j3yUHre14xvyoPK283p2tJdIM39y9S ByGZ4vgpo9u3kSWYw+xt5rRWYzcjaQ7N85EALynYHGG5ptkssEVyZYGtsclDRGHK9mAr 01fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:subject:from:ironport-sdr:ironport-sdr; bh=J6rDlT/QXqlbRE7X6uwPRSPWf7AxCbQ1wom3/shLisM=; b=jzC8APv3/5ae5MIeFJYw0bLa2oMFUWDFkdEk1PyyWQHKDV6+5ph3JCEgbQh1aOjhh5 3iK/YZEn3ZdQWtFBriWYipY7IYukH1YvpCN1qHwjtFxRG43EUgXtiI6alnmgYjmsqA98 I7kFU/LSjxKoErclAtpQaPaGzQrmNJE0c5LdNVO7LFgriYPzuHi6uVaS3Bvex2noIAmR ggOdeZGd1M9l2mkSVvnuJBEt/qqY5O5WF1duj1zwGi86A4KB8k5RUtdzdpWxe95H6Mb7 XtrF2k61cbK+B5hoZ9fQXCSngv62mb2ZLdOJe9R/Pdjp7J9HHaghz6KD1aP9GxWtp7R5 SMTQ== 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 y11si1748606edo.40.2021.01.27.13.36.59; Wed, 27 Jan 2021 13:37:24 -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 S234596AbhA0IE6 (ORCPT + 99 others); Wed, 27 Jan 2021 03:04:58 -0500 Received: from mga11.intel.com ([192.55.52.93]:6127 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233251AbhA0ICN (ORCPT ); Wed, 27 Jan 2021 03:02:13 -0500 IronPort-SDR: SYjuaK1J+oGm4xnngNo+LMaojlPGCOHrWCdsmL5ti5qew5PCoJxdcWaY+nquCC+UrDqfwbXAxS rz+GaBOVxZGw== X-IronPort-AV: E=McAfee;i="6000,8403,9876"; a="176522363" X-IronPort-AV: E=Sophos;i="5.79,378,1602572400"; d="scan'208";a="176522363" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2021 23:50:18 -0800 IronPort-SDR: eD2oDV6h3qL71zCkSo2+mFfu9YEIV5Ss8ka2ITgXic1M5rPT43UvxaldKt1AmAtd+yTsbaAVz4 9koE5GpPY6iA== X-IronPort-AV: E=Sophos;i="5.79,378,1602572400"; d="scan'208";a="362322980" Received: from xingzhen-mobl.ccr.corp.intel.com (HELO [10.238.6.97]) ([10.238.6.97]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2021 23:50:15 -0800 From: Xing Zhengjun Subject: Re: Test report for kernel direct mapping performance To: Michal Hocko Cc: linux-mm@kvack.org, LKML , Dave Hansen , Tony , Tim C Chen , "Huang, Ying" , "Du, Julie" References: <213b4567-46ce-f116-9cdf-bbd0c884eb3c@linux.intel.com> <20210126150016.GT827@dhcp22.suse.cz> Message-ID: <8e844e46-3ee0-9898-0d39-1571302dbc9f@linux.intel.com> Date: Wed, 27 Jan 2021 15:50:13 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210126150016.GT827@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/26/2021 11:00 PM, Michal Hocko wrote: > On Fri 15-01-21 15:23:07, Xing Zhengjun wrote: >> Hi, >> >> There is currently a bit of a debate about the kernel direct map. Does using >> 2M/1G pages aggressively for the kernel direct map help performance? Or, is >> it an old optimization which is not as helpful on modern CPUs as it was in >> the old days? What is the penalty of a kernel feature that heavily demotes >> this mapping from larger to smaller pages? We did a set of runs with 1G and >> 2M pages enabled /disabled and saw the changes. >> >> [Conclusions] >> >> Assuming that this was a good representative set of workloads and that the >> data are good, for server usage, we conclude that the existing aggressive >> use of 1G mappings is a good choice since it represents the best in a >> plurality of the workloads. However, in a *majority* of cases, another >> mapping size (2M or 4k) potentially offers a performance improvement. This >> leads us to conclude that although 1G mappings are a good default choice, >> there is no compelling evidence that it must be the only choice, or that >> folks deriving benefits (like hardening) from smaller mapping sizes should >> avoid the smaller mapping sizes. > > Thanks for conducting these tests! This is definitely useful and quite > honestly I would have expected a much more noticeable differences. > Please note that I am not really deep into benchmarking but one thing > that popped in my mind was whethere these (micro)benchmarks are really > representative workloads. Some of them tend to be rather narrow in > executed code paths or data structures used AFAIU. Is it possible they > simply didn't generate sufficient TLB pressure? > The test was done on 4 server platforms with 11 benchmarks which 0day run daily. For the 11 different benchmarks that were used, echo benchmarks have a lot of subcases, so there was a total of 259 test cases. The test memory size for the 4 server platform ranges from 128GB to 512GB. Yes, some of the benchmarks tend to be narrow in executed code paths or data structures. So we run a total of 259 cases which include test cases in memory, CPU scheduling, network, io, and database, try to cover most of the code path. For the 11 benchmarks, some of them may not generate sufficient TLB pressure, but I think cases in vm-scalability and will-it-scale may generate sufficient TLB pressure. I have provided the test results for different benchmarks, if you are interested, you can see in the details of the test report: https://01.org/sites/default/files/documentation/test_report_for_kernel_direct_mapping_performance_0.pdf > Have you tried to look closer on profiles of respective configurations > where the overhead comes from? > The test cases selected from the 0day daily run cases, just use the different kernel settings; Enable both 2M and 1G huge pages (up to 1G, so named to "1G" in the test report): no extra kernel command line need Disable 1G pages (up to 2M, so named to 2M in the test report): add kernel command line "nogbpages" Disable both 2M and 1G huge pages (up to 4k, so named to 4K in the test report): add kernel command line "nohugepages_mapping" (by debug patch) User spaces add THP enabled setting for all the three kernels (1G/2M/4K) transparent_hugepage: thp_enabled: always thp_defrag: always During the test, we enabled some monitors, but the overhead should be not too big, most of the overhead should be the test cases themselves. I will study some test cases to find the hotspot from which overhead comes from and provide it later if someone is interested in it. -- Zhengjun Xing