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 9ED0CC5475B for ; Wed, 6 Mar 2024 09:18:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0F97F6B0075; Wed, 6 Mar 2024 04:18:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0AA0B6B007D; Wed, 6 Mar 2024 04:18:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EDB6E6B007E; Wed, 6 Mar 2024 04:18:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id D99D66B0075 for ; Wed, 6 Mar 2024 04:18:14 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 5DB1140762 for ; Wed, 6 Mar 2024 09:18:14 +0000 (UTC) X-FDA: 81866062908.23.5156C4F Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) by imf01.hostedemail.com (Postfix) with ESMTP id C6B8D4000A for ; Wed, 6 Mar 2024 09:18:11 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=L9H7Sqxg; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf01.hostedemail.com: domain of rulin.huang@intel.com designates 192.198.163.17 as permitted sender) smtp.mailfrom=rulin.huang@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709716692; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=6bEGJMAlab3nk+4R1/PWVXhisXHP/latZ4y0FeHt0cU=; b=lYK9Rf0hOrHaR0p68nd+BaNZJQdv2AcigxJtbp4fDh1/Txg8O+UBBDz5SNQo2i52Aflst9 iyhqYlM5DAr4CVt/4UOtFr/viaKdr+B+Msq+c7I888myzLatcjbF8LlJwTXLLawE+hTEUH kY48zuuV0b3TNK/2SDuiQNMBTZMnpLA= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=L9H7Sqxg; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf01.hostedemail.com: domain of rulin.huang@intel.com designates 192.198.163.17 as permitted sender) smtp.mailfrom=rulin.huang@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709716692; a=rsa-sha256; cv=none; b=qfThopB5FJxPYsQIjGQk8zwJ/tmCzksjOFhtAkX/J00dB8LjrJhoTHG7veGahPOPYR7S65 uUxpMmqMQ/lfu82FzorU+fUbWcv/SxsFVavGbsgZl3XsYvIeN5k22aQRQ4FWhDAk6KHfqd C1u77R13dokhThizyDIFY1Dves96qc8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709716692; x=1741252692; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=WI+zXa7b+ZGTxolUk2ZlHXMgfJyQxF83bONh/z1C4iQ=; b=L9H7SqxgsP8ZmPAK174ZqmFjnIQUIQBInVQuoloPT36HDrDMHBTG6tsV HZMPQ2HFvlJw0CK8mFUiQlJvp1mXzusZTlpZFRRucrgFoqSz576Gf/0le uX6KC4Xs4NZcF/YX0oWw34YXobp/jLJx3VAjTu6rKzNxk4Tf9u36UCAXx rnF7ZHndoM9NWr/nKePl4j6wnhtT5yDSQXDYT1GpFD6uFrs4ihq1aumco W/7oR3zxlfkjP3jqgVzRt0S+agLxWnWRKvDX3m6QYzXdIUhjMmq0kuIpV PA3X131f+Vb3jDn1qFr39MErgFDILkiRIy/RUFeSdu7Uh6X+XMwXDEJ3V A==; X-IronPort-AV: E=McAfee;i="6600,9927,11004"; a="4180216" X-IronPort-AV: E=Sophos;i="6.06,207,1705392000"; d="scan'208";a="4180216" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2024 01:18:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,207,1705392000"; d="scan'208";a="14250309" Received: from rulin.ccr.corp.intel.com (HELO [10.124.227.114]) ([10.124.227.114]) by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2024 01:18:07 -0800 Message-ID: <2c48e41a-2ff4-4b31-9212-e7fd7d4c5bb0@intel.com> Date: Wed, 6 Mar 2024 17:18:04 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 0/2] mm/vmalloc: lock contention optimization under multi-threading Content-Language: en-US To: urezki@gmail.com, bhe@redhat.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, tianyou.li@intel.com, tim.c.chen@intel.com, wangyang.guo@intel.com, zhiguo.zhou@intel.com, rulin.huang@intel.com References: <20240301155417.1852290-1-rulin.huang@intel.com> From: "Huang, Rulin" In-Reply-To: <20240301155417.1852290-1-rulin.huang@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: C6B8D4000A X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: 1mxuphd5ch9pzbkzufxmjdic1wy44ttt X-HE-Tag: 1709716691-76876 X-HE-Meta: U2FsdGVkX18H3yw/ffh1HFBScR8Zv3HNa4r1Qnoe2hUnDooiwGWW1CkhskOdhrksGrazYm++v6MgcfhwuzHkmHhcdryTlgaU07Hh3AdokYTH+ShFjeyqnxJIEIYpuZ6g03pSnvmd77UicPntmSgXZKY8aHXeD5THsPoDyBcwt7XHik0MvS9/6FOwX7oqu9b79GerNza9YVemG7dZRLz2LoL9seFy565e/cky7OgiW6Z47Z6208elNQWv9fFvuoEsfBcwY8rMHZoTq28rY20kb1fLArrkF371Z8QaIuUFKsN5RZNwZDK9I+x34IYmd3rnVB5kPsEL4q6a87oifXqplsFU1ZkhB94rYd3kM5KridIH10pviTK1i5OZpqe8E0vKMY67n26H+r/rbAq+LSohhQHGkMGb1Qvvb+Eoxcc//9ywPQYEa+Z2jHxRGuoQxhSMrWju+PHxqLE6q/E7d15nci5qFHhrUwEVXT02xql4GenDHGq9GkKJjdT0nu2xp7u5s9C5QG/uct4iqGJJtdjQK7kiNvjqeTGTsjt2CQEBVgeBnO199PUnjCeUfWa5KiLUnxyqNGxTQ0bznQB6hG47JfwjYvw8K+WvfvCEqGf5wH4MZ4jJEJbmLTT7vaGDk5yAmlnepePkyXgq/8cjZuFX+e7K4sOO644mZXEhcBAYGH0wsx+HQw/vP41LUuIXxelSh0fLslvyG7U1iwEDZP3WtQYI14XmEcwweDZcqkMCrDl1A0GaxKxXUgJ1DlfPMroFOfYV41uPvN/w+aP/a2FGgTiEVqMV+xv7OeyuUNL03GrTqbMoMTefvsdoLsth/QgHX4psi++T7qy5jUwElaCDPVgZgQLcAURgNYULcrH6ajfn7n3iiohxLYtNW62qux5X X-Bogosity: Ham, tests=bogofilter, spamicity=0.098393, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hello, are there any issues with this patch that need to be modified? If there is any, we will modify it as soon as possible, thank you. On 2024/3/1 23:54, rulinhuang wrote: > Hi, > > This version has the rearrangement of macros from the previous one. > > We are not sure whether we have completely moved these macros and > their corresponding helper to the correct position. Could you please > help to check whether they are correct? > > ~ > > 1. Motivation > > When allocating a new memory area where the mapping address range is > known, it is observed that the vmap_node->busy.lock is acquired twice > but one of the acquisitions is actually unnecessary. > > 2. Design > > Among the two acquisitions, the first one occurs in the > alloc_vmap_area() function when inserting the vm area into the vm > mapping red-black tree, and the second one occurs in the > setup_vmalloc_vm() function when updating the properties of the vm, > such as flags and address, etc. > > Combine these two operations together in alloc_vmap_area(), which > improves scalability when the vmap_node->busy.lock is contended. > By doing so, the need to acquire the lock twice can also be eliminated > to once. > > 3. Test results > > With the above change, tested on intel sapphire rapids > platform(224 vcpu), a 4% performance improvement is gained on > stress-ng/pthread(https://github.com/ColinIanKing/stress-ng), > which is the stress test of thread creations. > > rulinhuang > > [v1] https://lore.kernel.org/all/20240207033059.1565623-1-rulin.huang@intel.com/ > [v2] https://lore.kernel.org/all/20240220090521.3316345-1-rulin.huang@intel.com/ > [v3] https://lore.kernel.org/all/20240221032905.11392-1-rulin.huang@intel.com/ > [v4] https://lore.kernel.org/all/20240222120536.216166-1-rulin.huang@intel.com/ > [v5] https://lore.kernel.org/all/20240223130318.112198-2-rulin.huang@intel.com/ > [v6] https://lore.kernel.org/lkml/aa8f0413-d055-4b49-bcd3-401e93e01c6d@intel.com/ > > > rulinhuang (2): > mm/vmalloc: Moved macros with no functional change happened > mm/vmalloc: Eliminated the lock contention from twice to once > > mm/vmalloc.c | 314 +++++++++++++++++++++++++-------------------------- > 1 file changed, 155 insertions(+), 159 deletions(-) > > > base-commit: 10c2cf5fe97647d68ee89b1f921e982e71519f20