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 790A9C48297 for ; Fri, 9 Feb 2024 11:49:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C94416B0072; Fri, 9 Feb 2024 06:49:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C45386B0074; Fri, 9 Feb 2024 06:49:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B0C566B0075; Fri, 9 Feb 2024 06:49:27 -0500 (EST) 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 9F2716B0072 for ; Fri, 9 Feb 2024 06:49:27 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 1D6591A0EFF for ; Fri, 9 Feb 2024 11:49:27 +0000 (UTC) X-FDA: 81772095174.19.1B2660A Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by imf19.hostedemail.com (Postfix) with ESMTP id A855B1A0007 for ; Fri, 9 Feb 2024 11:49:24 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b="RITMMI/z"; spf=pass (imf19.hostedemail.com: domain of rulin.huang@intel.com designates 192.198.163.16 as permitted sender) smtp.mailfrom=rulin.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=1707479365; 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:in-reply-to:references:references:dkim-signature; bh=A1vZvruf8h86uOd2UoGDiMqQQE+CT1h2DXUc/lFjsfQ=; b=KprA0vFdPM9dIVKonYncjrIC1PFe7h9eD4hDAuw5CV5PuhSU6ujngI/anAeuY3ne22wav5 iPAavL/4FSD7dAkdTt5NlWWSW2mHBnZYGEAQ8KZR0AYi6ry7jUyg5CdaGW6Uy4s9VMZ8Oq xm15hbvR8HlnP5oH/qE23Wys8BfRfyg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707479365; a=rsa-sha256; cv=none; b=wsZsMh1ygHGjfGZlLpm6jphhUddxi7LcBQE4sW3eBoSU8hVxNQOu4nfnHzUzOqfRpjJxtq AjSMBFITzr8tEbg21cQqoxog2YnmNwsLa4X2a1w1+KDKa67CfN1D4ie4+HFdpluTPa7p+6 gXn3cVxSewaoMr35RqvWhZvUZ/cj0Sk= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b="RITMMI/z"; spf=pass (imf19.hostedemail.com: domain of rulin.huang@intel.com designates 192.198.163.16 as permitted sender) smtp.mailfrom=rulin.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707479365; x=1739015365; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yHIrMU+ZX5RuinTIn+nTLh+yX3ofZbcBqkJFfJ3tlV0=; b=RITMMI/zQfZ+vV1/x8RghmLGIZpCmfzuqs2272UlDWkIvPenlHTN4A/c 7C3w+qNilYV4e/OVkdjFoiTKz9e7rWeK5+ZlWntaEx+OYaxa9R1IYUjN9 AuWdTWaJABAAfohKb6mzTn9LLLIU56j3we64Cesncy89hq3MatFBHdMi0 FssoJZ+p8HV0kKjQm3cE0KpBOLlOzl49BEaThR+4jF/NdepBpgIaUapH5 ICO+qMwX0iQfzLwLgRVxLnKluwZcoBxrh2y8E5tdVM27vO5oR7n91DCkX kwINO68LGwjjnF0spnJZrEihkWOYcAOtvybahS3R1KB11poF/4B3HUKOF w==; X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="1724689" X-IronPort-AV: E=Sophos;i="6.05,256,1701158400"; d="scan'208";a="1724689" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2024 03:49:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,256,1701158400"; d="scan'208";a="32704905" Received: from linux-pnp-server-09.sh.intel.com ([10.239.176.190]) by orviesa002.jf.intel.com with ESMTP; 09 Feb 2024 03:49:21 -0800 From: rulinhuang To: urezki@gmail.com Cc: akpm@linux-foundation.org, colin.king@intel.com, hch@infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, lstoakes@gmail.com, rulin.huang@intel.com, tim.c.chen@intel.com, zhiguo.zhou@intel.com, wangyang.guo@intel.com, tianyou.li@intel.com Subject: Re: [PATCH] mm/vmalloc: lock contention optimization under multi-threading Date: Fri, 9 Feb 2024 06:51:47 -0500 Message-ID: <20240209115147.261510-1-rulin.huang@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Stat-Signature: ra9bow7qctg1z8qj3x4gkb9b7rgnb98x X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: A855B1A0007 X-Rspam-User: X-HE-Tag: 1707479364-255327 X-HE-Meta: U2FsdGVkX1/8GteeVbQEu48JjJYH1+EZRGPry1qAGOa5kxCsTc4N32nr403UUJDv2NRyi37Oa+aoY+kBOzWgZMziCgKG7SRxBJWBH9dAhg93KSGZqKnYIwu3UuYQmgZ1RnUk96wS5zPHGQ6g7P8ohvOwLWYKlAKjYFXkq1vP9ZgfApnd/Lk0Bq1fvVhikABX7GPNkfW+IdvSTEqsE6s+xsIM5AJmeNAFDcM3qUiSgY0O0cIDSzrRfXl/YR02ds8lXzNKSKdIA3yTwV8H3J9OniqVilOyluiM7HW7mAjbzTrYUAXZhviO0YN6CctiO3q0ZmIR9mxb10NMGk7lpU9LGHldowGhx4x/1xCehwSeoRYN+UNAriEkScdtg5sfKP5u4njHDZRkYP8HethfVAmLASaVLQppuMZwW1cZhnI35q/qPXpYxMaAsfJFvGpGZk6QdHo9lcdvGoHg1rwdCxRvz9/yRuOaRpWsi40qaYpsddYsIFt+WcxiQlr/dWJBu1c4ulyaWJFpbXwmyGTSYmVZDAUd8yM/ZmVYS9dhCqkG68PopNUcLltOwIXAA/TbJTpE72b7CgTjnm2nZwccAVq8FddHmgWyd+tcrzg6ZGHkkptqVOegbkxdRKi8NvIUaV0C2gPrvsvngkUBwdgHrn7SJv8HSMdeUpcFk4fgnEX4jhBPqHOjelc5KpOOl9mBGhu8Z9yMJAse2BTAmX10jqOrxIe5hncvVKOWfsAk6QPx6EEVaG764uvcPEtmOVJAv/8BdcwVyBGuYpmylave8b7NDJdSP9Slgqust1jZD6hEdZgZ52e7QHo1209VmQ1eIbPC8utN1ZL6QmlUAW0BcvCyODGPN8DkLwNZ+tvi15jzMZwM2b7CZ0Klycjs9rMMosfvWzv6CQZVb+DHGe/IUDM+BHcF+JwR8Drqq1JZVSBIPDUQJPU1DNgDlHdYvlp9bKQe41k8c7iBh00V31F01sH OhFHlpxL 0S2O6egy7i+JENbWLx0oc6xyogKG2Y+vbrxyL6uYR01oedRHYVSwSq1EnHRdlM3j2n7RJgU3CCXaKq7qbWYBkn6Raq0+/TwNuo9H/T3zfWNKdRkwJgr/mfuN2GnHf1cQ61WNDZEalol5fi1oIsFnh5WSr9w== 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: List-Subscribe: List-Unsubscribe: Hi Rezki, thanks so much for your review. Exactly, your suggestions could effectively enhance the maintainability and readability of this code change as well as the whole vmalloc implementation. To avoid the partial initialization issue, we are trying to refine this patch by separating insert_map_area(), the insertion of VA into the tree, from alloc_map_area(), so that setup_vmalloc_vm() could be invoked between them. However, our initial trial ran into a boot-time error, which we are still debugging, and it may take a little bit longer than expected as the coming week is the public holiday of Lunar New Year in China. We will share with you the latest version of patch once ready for your review. In the performance test, we firstly build stress-ng by following the instructions from https://github.com/ColinIanKing/stress-ng, and then launch the stressor for pthread (--pthread) for 30 seconds (-t 30) via the below command: ./stress-ng -t 30 --metrics-brief --pthread -1 --no-rand-seed The aggregated count of spawned threads per second (Bogo ops/s) is taken as the score of this workload. We evaluated the performance impact of this patch on the Ice Lake server with 40, 80, 120 and 160 online cores respectively. And as is shown in below figure, with the expansion of online cores, this patch could relieve the increasingly severe lock contention and achieve quite significant performance improvement of around 5.5% at 160 cores. vcpu number 40 80 120 160 patched/original 100.5% 100.8% 105.2% 105.5% Thanks again for your help and please let us know if more details are needed.