From patchwork Thu May 11 06:56:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Huang, Ying" X-Patchwork-Id: 13237525 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 3FD73C7EE22 for ; Thu, 11 May 2023 06:56:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B37BD6B0072; Thu, 11 May 2023 02:56:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AE7226B0074; Thu, 11 May 2023 02:56:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9D6606B0075; Thu, 11 May 2023 02:56:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 907C96B0072 for ; Thu, 11 May 2023 02:56:36 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 69AE940172 for ; Thu, 11 May 2023 06:56:36 +0000 (UTC) X-FDA: 80777065992.11.D350946 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by imf14.hostedemail.com (Postfix) with ESMTP id 1FCF510000B for ; Thu, 11 May 2023 06:56:33 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=IiEzAj36; spf=pass (imf14.hostedemail.com: domain of ying.huang@intel.com designates 192.55.52.43 as permitted sender) smtp.mailfrom=ying.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1683788194; a=rsa-sha256; cv=none; b=KKtZkVS1QBhT/LnY0lEQf1y64uZ4TlyDd2NigMyLLFUs/znV72OubIY/v9uqY8AMcCnun2 pMNrkgiwlF+ryx2DTN4D745uV7voG7KdUTXF7tBhS7PkVFT7sRx+mZ0mGpWM2/11iutw9B fht/ANNIu/vN9iCN0FeDsyv+P9n6DJ4= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=IiEzAj36; spf=pass (imf14.hostedemail.com: domain of ying.huang@intel.com designates 192.55.52.43 as permitted sender) smtp.mailfrom=ying.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1683788194; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=hvjxUAzQgZsVwA1r2aEShqDqAqfqKwVv+/heSju6wGo=; b=gjF1VuwcGQVGNvtiiM4/YbeT2W6jR2u92b8vI68d35BUR41WcAR1W64PHa97ob20b3wc9N Gi66j05bX7ZqeW086wK3mwXrgwy0y94hgcbcIaS533Godf0mdL0dkpkMuhUnFqY8Di6t3v v2/xC8uXJgKe3T5KlXkyl2iz4kJz6do= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683788194; x=1715324194; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=5148VWt67GT1KAtmE4SFUCYsm8r3r4RYHgyw/Z4o9Gc=; b=IiEzAj36QB+ZM3VtWQ6kicmm1WZuuRlURS0OGbyrT+hn1EY6Kxnun7Tt 4T21h5liErxPLVV1iiSDDorVn8LKWJRDSZJkB714ITlO//2PdpuySN1Kf 2Wn5uvaXM2YXlLS6UCoOd4JJHmVz6GH5/4L7u05XKrt3tI2/XytIFmXYU XrqGGS5nbsA3Sr3FK0r3n8V2ONz57Lf8eEtn5P94atz3ee50Zg0OrHdit o3ABMPo+c3sEqcrewwYAtJ69qH6eDSCgukAfgW1hqvJV6zDhuJfU0cwiS lvQb0Q09GA+5ptWaUjw6BHED5/Yd8Ho0suPbdtixWlnQFO/6GWJ+rbZUI w==; X-IronPort-AV: E=McAfee;i="6600,9927,10706"; a="436744464" X-IronPort-AV: E=Sophos;i="5.99,266,1677571200"; d="scan'208";a="436744464" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2023 23:56:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10706"; a="823855230" X-IronPort-AV: E=Sophos;i="5.99,266,1677571200"; d="scan'208";a="823855230" Received: from chaoyan1-mobl2.ccr.corp.intel.com (HELO yhuang6-mobl2.ccr.corp.intel.com) ([10.255.31.95]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2023 23:56:28 -0700 From: Huang Ying To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, Arjan Van De Ven , Andrew Morton , Huang Ying , Mel Gorman , Vlastimil Babka , David Hildenbrand , Johannes Weiner , Dave Hansen , Michal Hocko , Pavel Tatashin , Matthew Wilcox Subject: [RFC 0/6] mm: improve page allocator scalability via splitting zones Date: Thu, 11 May 2023 14:56:01 +0800 Message-Id: <20230511065607.37407-1-ying.huang@intel.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: 9k6ipyawbr976c4sz8qkc913dokm6qja X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 1FCF510000B X-HE-Tag: 1683788193-383502 X-HE-Meta: U2FsdGVkX18isjrEWvQQwVnSR0x/7RDpy2+QAytvw1ZDOMmd/08ARi0OOGrd46j6fzCWgGV8fUtPmQcELchd/j+/rvr5a2PU64dgEKof31f9KD5cFevlXWJTnbbGfaAgCE/ifdLJ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-Loop: owner-majordomo@kvack.org List-ID: The patchset is based on upstream v6.3. More and more cores are put in one physical CPU (usually one NUMA node too). In 2023, one high-end server CPU has 56, 64, or more cores. Even more cores per physical CPU are planned for future CPUs. While all cores in one physical CPU will contend for the page allocation on one zone in most cases. This causes heavy zone lock contention in some workloads. And the situation will become worse and worse in the future. For example, on an 2-socket Intel server machine with 224 logical CPUs, if the kernel is built with `make -j224`, the zone lock contention cycles% can reach up to about 12.7%. To improve the scalability of the page allocation, in this series, we will create one zone instance for each about 256 GB memory of a zone type generally. That is, one large zone type will be split into multiple zone instances. Then, different logical CPUs will prefer different zone instances based on the logical CPU No. So the total number of logical CPUs contend on one zone will be reduced. Thus the scalability is improved. With the series, the zone lock contention cycles% reduces to less than 1.6% in the above kbuild test case when 4 zone instances are created for ZONE_NORMAL. Also tested the series with the will-it-scale/page_fault1 with 16 processes. With the optimization, the benchmark score increases up to 18.2% and the zone lock contention reduces from 13.01% to 0.56%. To create multiple zone instances for a zone type, another choice is to create zone instances based on the total number of logical CPUs. We choose to use memory size because it is easier to be implemented. In most cases, the more the cores, the larger the memory size is. And, on system with larger memory size, the performance requirement of the page allocator is usually higher. Best Regards, Huang, Ying