From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF32DCDB465 for ; Thu, 19 Oct 2023 12:16:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 888998D019F; Thu, 19 Oct 2023 08:16:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 838D48D019E; Thu, 19 Oct 2023 08:16:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7284F8D019F; Thu, 19 Oct 2023 08:16:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 620608D019E for ; Thu, 19 Oct 2023 08:16:48 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 2DF5C120525 for ; Thu, 19 Oct 2023 12:16:48 +0000 (UTC) X-FDA: 81362109696.08.CBC3E8A Received: from outbound-smtp45.blacknight.com (outbound-smtp45.blacknight.com [46.22.136.57]) by imf27.hostedemail.com (Postfix) with ESMTP id 511C240011 for ; Thu, 19 Oct 2023 12:16:45 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf27.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.136.57 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697717805; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uTMd1UOxToV26Q3ZVYlREW760XWEvDglTngjVRILg1c=; b=JlukJpERT3QRmn5r9MaOeY8N1IqUGhTUngRzv+44t3hW5WcCYCxhSRylkw4PtIL5cMUdxi e+VJ7g3hxaTfCRuU5O9ITiI/CSpfPBqsYWYkUW89xJnlFbBQOfdFfn72J+e8vVysGjO6LN YV+DOh3oquuc8A2zx4+K3wWadXmyzXA= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf27.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.136.57 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697717805; a=rsa-sha256; cv=none; b=3alQCz3yszEXkUtOdXlYkXerCDSK18KH/Aca9UZSdjP1DdtzDeaO4k0PH4XNsIFRPIYdVd QD67nYymY5KwXHT6JQN+Sr3gHWnYAAC2ff2KVzjestSo9HLVJ1l6IHvMiAKO0APG6tNTOr GtizBcPscrh5T3R1sKAKZYzCB3zqkaQ= Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp45.blacknight.com (Postfix) with ESMTPS id 84906FA96A for ; Thu, 19 Oct 2023 13:16:43 +0100 (IST) Received: (qmail 8912 invoked from network); 19 Oct 2023 12:16:43 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.199.31]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 19 Oct 2023 12:16:43 -0000 Date: Thu, 19 Oct 2023 13:16:40 +0100 From: Mel Gorman To: Huang Ying Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Arjan Van De Ven , Vlastimil Babka , David Hildenbrand , Johannes Weiner , Dave Hansen , Michal Hocko , Pavel Tatashin , Matthew Wilcox , Christoph Lameter Subject: Re: [PATCH -V3 6/9] mm: add framework for PCP high auto-tuning Message-ID: <20231019121640.ao2zvxlspgfkbwsr@techsingularity.net> References: <20231016053002.756205-1-ying.huang@intel.com> <20231016053002.756205-7-ying.huang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20231016053002.756205-7-ying.huang@intel.com> X-Rspamd-Queue-Id: 511C240011 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: wsf83x3mtwnzxobhrkteymaoo5ckcwij X-HE-Tag: 1697717805-46357 X-HE-Meta: U2FsdGVkX1/wCWlnKK6MNylXJsrR8oHSKNI/f/suPiSmtK4O7/aqGIxfGqv4OSger9+1NuG4bOd0VPIa/x1WLQYJ4i4v1mWNNDrmwCmdLPxreT7N7c4HsO+ZUUnHze9/RbibhrsRDt9Ps4j088hk+XOkx/mfOlmfdLHArCZZ5VEdl16tgWDxXWzvHs//YnQss/v1ackiLuZjJgLvbia8nwgsXPCKUV1iIzXKKzu6uj/Mt2kKfbpPN3YMEtIc9GblFOQJSf77+GNXDUyZqvJ1oUtkDfS4O24isaqOt3VE1CAE7tNdF0xPII2fF6yYVTX+7Hzfj6z0FDpDO+n5kw4H8SJ1P7NJAEfaYH7nxAJ19xrKXS2wJ7qEfGYRgNGKePFFOihXcLWtZJd9uIYs/dR94A2aF92GOtv5N3MxZQ8k2e1WHmiLa+K3Xv1aAMh1Sg+ohMZ8Gtcuu4naGn4xPGoaYPCits7+itceUcXjK1HBK/LbZ0mXWP5k3KQgsU9jtbICVGHokRbp5FS//C8l9RsCenGa86ZQCT2MoNKmoRxSKeu6gGgO8/QjwVqzu/i/zEoqkRLjIbAIMXMFbMoEstaNTQEt7LenP8Y1BUbXfVdS0w9yEZwnXD/8vU22k6jjhMMqsNw9P5de557UW5i1vTa78JcBcNAVcqxav0Ts/pCUX4roJSw2Y+NwZ1Ig5xnVDhZBd4paSs6mREg0TvPhArTbCG6Y5RapkxPfjR1GQ4Fwwa3N1ociRgM6PJoMWccqlGQzgG/CMBR9q7Yl3Re62YRjIDRFK3SjlK/c5QgZ+CqXFC2zBFBlKzS+hny21B9/x10aTvnE4pc11tNaLPNZv4tNwA8Okt42rltTWjqJWu6ONugKUw+T75ZNIfr5+TXy+WlEFJ+lSJa96DZzb2a9iQwALaPWbj4a7oBQ91rjBdrlA2+Tt/b+8zfDFJJYUeZ2ouACluKmslC7AK4/AtUKLyy 5AS2qggz jb0Tsq6jA0I5QeVvBcTDpyui4hdzOSc8OjzJpyk81BhyWRVoygZmaPC1Yz2AywnRsRTFFmRPnWnMy8+qkQmUQKTXfHuXo4HggxoRKqBgfGECMGxWGMLFulv4Zkd59JeNFqdFCz/xoO7zBsGm42S7NzulIqje30PYI7TvG/1oIObIFo7VjF547gukifYyBEdp+7epa6NHLBHQ3mbwCvB9hKRJkhRJ96UU8bgyJtRQtASpRIiT1I4w6VH48eg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Oct 16, 2023 at 01:29:59PM +0800, Huang Ying wrote: > The page allocation performance requirements of different workloads > are usually different. So, we need to tune PCP (per-CPU pageset) high > to optimize the workload page allocation performance. Now, we have a > system wide sysctl knob (percpu_pagelist_high_fraction) to tune PCP > high by hand. But, it's hard to find out the best value by hand. And > one global configuration may not work best for the different workloads > that run on the same system. One solution to these issues is to tune > PCP high of each CPU automatically. > > This patch adds the framework for PCP high auto-tuning. With it, > pcp->high of each CPU will be changed automatically by tuning > algorithm at runtime. The minimal high (pcp->high_min) is the > original PCP high value calculated based on the low watermark pages. > While the maximal high (pcp->high_max) is the PCP high value when > percpu_pagelist_high_fraction sysctl knob is set to > MIN_PERCPU_PAGELIST_HIGH_FRACTION. That is, the maximal pcp->high > that can be set via sysctl knob by hand. > > It's possible that PCP high auto-tuning doesn't work well for some > workloads. So, when PCP high is tuned by hand via the sysctl knob, > the auto-tuning will be disabled. The PCP high set by hand will be > used instead. > > This patch only adds the framework, so pcp->high will be set to > pcp->high_min (original default) always. We will add actual > auto-tuning algorithm in the following patches in the series. > > Signed-off-by: "Huang, Ying" Acked-by: Mel Gorman -- Mel Gorman SUSE Labs