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 3740CC369AB for ; Thu, 24 Apr 2025 18:11:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0B4EE6B002C; Thu, 24 Apr 2025 14:11:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 014396B002E; Thu, 24 Apr 2025 14:11:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DF6006B0092; Thu, 24 Apr 2025 14:11:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id BE92A6B002C for ; Thu, 24 Apr 2025 14:11:07 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id CC935C6C42 for ; Thu, 24 Apr 2025 18:11:08 +0000 (UTC) X-FDA: 83369729016.15.B918609 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by imf09.hostedemail.com (Postfix) with ESMTP id 88CCD140009 for ; Thu, 24 Apr 2025 18:11:06 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=canonical.com header.s=20210705 header.b=Vu8JKX8m; dmarc=pass (policy=none) header.from=canonical.com; spf=pass (imf09.hostedemail.com: domain of mitchell.augustin@canonical.com designates 185.125.188.122 as permitted sender) smtp.mailfrom=mitchell.augustin@canonical.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1745518266; 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: references:dkim-signature; bh=/bcV79/hrYhuCYZ9AGewlfKYBwHxoJx9OcEIMx8nyzw=; b=jUhld6a3Jc7afqp96Ga3Wir6AZDM/X/E1N8Rf8HGMzoAF9MxRKIqDTOGbiWkZrHPZtZJKk KPxWvrbomqdVZk3s6i99MH8r5YagB2jwe5vHshuxEnk2EuYhAp5To97EY7Q6ACko1adPxA ZRF66zWE5nVr7DPIPmKSEY2pUPC9Mtw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1745518266; a=rsa-sha256; cv=none; b=XGlRPqesmRYG0yXmvnj1lrx5e5BYHwiO0vWn+PJYFdvp2Cwuj3YCkTF1egCq/BRM+LPPBu LNoG5X3/3tHT3NkOZiI6LSZMEuxYyW9MWmEMnY7f5hEdZPyPP12QDs4inCqmRRO23tXx4O AlIH6qVMb5v6QaXWVMfwfC9ldomyc4U= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=canonical.com header.s=20210705 header.b=Vu8JKX8m; dmarc=pass (policy=none) header.from=canonical.com; spf=pass (imf09.hostedemail.com: domain of mitchell.augustin@canonical.com designates 185.125.188.122 as permitted sender) smtp.mailfrom=mitchell.augustin@canonical.com Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 29CB340306 for ; Thu, 24 Apr 2025 18:11:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1745518263; bh=/bcV79/hrYhuCYZ9AGewlfKYBwHxoJx9OcEIMx8nyzw=; h=MIME-Version:From:Date:Message-ID:Subject:To:Cc:Content-Type; b=Vu8JKX8mOfmtoiTGJaCcVqpfMR/MabTBbdL/qqBjWaR59ahv1o1rvN8L+wE+ln8hK KdP/h5SgkuSkIi/4xX3a+S06w1gFXtcyRc5e8BmH9mY07wmCT1LqhCMBVcLgRBhMwX 662lo/yTEQE9UY3dt98GQmMV+GIVkxGbczQwdmU9b28ghSdV28HrMbpJlRT/D/++0D aDcQX64qRKE2arFWDJT9zqlaPYqW1NoJm7tNncRvz6F0Bkd1iZZAB4hvcJhY0MjxBC itcMq54oN0lCU/yHXJXSjaPSTdo4cDUCyEJCMuOE2LxR3mOND/KWPHIW5O2tyt4rZU NTk4+PXYCS4dA== Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-5f4d2e9cdbdso1298832a12.1 for ; Thu, 24 Apr 2025 11:11:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745518262; x=1746123062; h=content-transfer-encoding:cc:to:subject:message-id:date:from :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/bcV79/hrYhuCYZ9AGewlfKYBwHxoJx9OcEIMx8nyzw=; b=HReudNOU09/XYHf42RVQHBLyVoVDQuPh1XqFQpkPinR5IfSb8UPN44oKOEBWwRib9c uvM08Wg4Gm4jm/AQnz7pItK6WHxe+gxGBSkPZ94/ccXSLohuOTCd4/C2Et3jNNqrI4vx sRABNiGSZCeR0SRR0fI/ycqKrhpbv3oqlQHSVWFIJCFsIid1blPIUHmCCL8mB6ao3Bkb zwJfAIH8WSThqiQpQB7CQdsnnBa9iyQIhamsSSqAoib6hcotY8lNmjk2jzSMRkHc3J1J 4A8UKEVuBLg3xzZub+0Lz4EuISjjxU5NtECXMNAxym2EQwuIaBA4v8HakjRyFr/L1rn9 ITuQ== X-Forwarded-Encrypted: i=1; AJvYcCW5UTRmpJ3IF/VLgHkjGhLR0iV+WBYF3rxAZAqBkGgS6xvtjRJJPx8Osrnmh+3oz7bpjArWtFYsSw==@kvack.org X-Gm-Message-State: AOJu0YxJ7EwFcOmNG8Xk9+q00tqmGP8GWX8X3zlEbaEkzeMzrpGq2JQP HbAb4cRd0NWEdzAnD85ISd3WgYW5yd3j2GSlrVBfj3aIprlaZ39yQLlY8oDDwzNvheqkcYpZEjh xb8fSu+X72DW4Vl4l9WAZLSZs9Ex5iHnoKjih4TrOLGvV2AnVjVT1ZmKIkJiutvWhMqyoW8wOiF tRo5Ah3m6EGgtUFx8y3HHEgn0fPQKvR0DMvbIA8bk= X-Gm-Gg: ASbGncs4b/1psLAbWqWefTEdIyB70yPtWVT2bOzebqUbQexPEb35CDojTEhI/cSY/ob 8fLQJL7HBTTENOTc9tXpr4Zcad2C/0uao+jZgEMh6UK4x2I5CM2dTdMh/FFc2R2YQr6Si3xSLfy rFQmLFYWKrT5gllRqOFtqKDvwPnWw= X-Received: by 2002:a05:6402:3546:b0:5f6:c4ed:e24e with SMTP id 4fb4d7f45d1cf-5f6df2334aemr3811584a12.27.1745518261822; Thu, 24 Apr 2025 11:11:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEeT56dfdwXZU9gyfAf1ipXvg9DLJW0BhXvsj463JP8ntSevyGeDPQEmobu4iu7JFqk/KgJMMBCuNsi437xIOY= X-Received: by 2002:a05:6402:3546:b0:5f6:c4ed:e24e with SMTP id 4fb4d7f45d1cf-5f6df2334aemr3811537a12.27.1745518261303; Thu, 24 Apr 2025 11:11:01 -0700 (PDT) MIME-Version: 1.0 From: Mitchell Augustin Date: Thu, 24 Apr 2025 13:10:49 -0500 X-Gm-Features: ATxdqUFujSrsGNEgNvqrB8juFL36ME4oAr4i3skXtmwLE55l7TtL157IXwsVQaI Message-ID: Subject: Re: [PATCH v2 00/17] khugepaged: Asynchronous mTHP collapse To: akpm@linux-foundation.org, 20250211152341.3431089327c5e0ec6ba6064d@linux-foundation.org Cc: 21cnbao@gmail.com, aneesh.kumar@kernel.org, anshuman.khandual@arm.com, apopple@nvidia.com, baohua@kernel.org, catalin.marinas@arm.com, cl@gentwo.org, dave.hansen@linux.intel.com, david@redhat.com, dev.jain@arm.com, haowenchao22@gmail.com, hughd@google.com, ioworker0@gmail.com, jack@suse.cz, jglisse@google.com, John Hubbard , kirill.shutemov@linux.intel.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, mhocko@suse.com, npache@redhat.com, Peter Xu , ryan.roberts@arm.com, srivatsa@csail.mit.edu, surenb@google.com, vbabka@suse.cz, vishal.moola@gmail.com, wangkefeng.wang@huawei.com, will@kernel.org, willy@infradead.org, yang@os.amperecomputing.com, zhengqi.arch@bytedance.com, Zi Yan , zokeefe@google.com, Jacob Martin , =?UTF-8?Q?Vanda_Hendrychov=C3=A1?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 88CCD140009 X-Rspam-User: X-Stat-Signature: zef63br47zw5c8i4k8qcjc5ab963kqjj X-HE-Tag: 1745518266-270129 X-HE-Meta: U2FsdGVkX19GQz9YGL1+XUWEn3ss2Iqqd8TSHXwLrAHTw2dyksOyqAcEymHoNcwcyUK9/thZ6WndS9YTedqazdkD3FEgFrquop9gmuezBHD11zm6DHwWy+8cBUyPUAvh/6VeEd1t4z8nJbrKMNBNtQdXgz2Ge3dbzqPL+oSqIkUceY4IYJtkh+BLPq9sxbBVBKoXm9g0lwp6tdvlB2ZgOW/qIYXJUHzg8aTfn3kImiAv191dGp1smhW3Ae2HJDxZV5WYy2WvnsU1pQqdNbX8JfjPnSxEanJNrQMX2Nqr8LOmqi1H3UHxoIUamD3XYEvBh+wzEHpmS2hUWzbnBpfvEtQowfHNUYMkTyxqF1YTRoj/TO9OJALqALfM05k+3Lxs5kACY1AXMjCJqH0ZqPNox/+q2UYt9A709HI2QmI73HYDf42R5jsUZpRJWvqi6TLpfZxV+273S10PxWmBGeQO4BK1aDCN4Go4o9geVhajPm7HfiHgoT6H0mIqCKdIDIpvG7NmDjhF/bNqUVYwy7sc/zGy+q0siHQhcj7GPptEK8b8MWv7/Qtz0wTm9s6J8Fo3TjfmAe6AJ/EamHmp+uzou+fBR0X+2AeX2LZZZOwcR4F0ZE/ZcOkA0O4TWLsGUSNnV7JjHjN9Or9NCTbr83Zt7TMwUXk94CUTaV9D3w+IwGI1HHQ5jZfWcmr6Ln2KNVqpjVZ06nYAdjjJnI/XnSYKHpktETugMS2dszzDQVPEXDI7k+ov+iTkMuHgfABH6RLse8MvH3GuSmRToMhIAj0UyVbWYcSzofbv7RNpZ9J1OpimdtyLIA2yjhFsfKVgw/vLDjdJqAC561I+WMZCcxk24qscgooZnhqqLZynAWb9HWzuJO9rNqJ//5qyeSjd/RzzoliGSedXy+/VGD3SDriP965HBB05vNYyIVlhKdDI0Q1zkxttX1oXl2j8byDC89Lo8RSKYhiwi/XxjtqN45q y16BuDpn 64lnjl0NdrR8xq6s62LSl18gwBUSTzGyp/thPtAgTruhOj5c8h8Bi9pgAAJDMJuNsDcyWT+FCBxPBxPe7VOeT55RzcgkB8zTQVJcVmYITLBQ3IcWuhMZzK8PrZqAdfXFwbgGRjapUK1xJ9m+OhRZZMSbXcc6k/yAU/+Yo5K2LpNTJlsl3FuX9EkT0gC1XFJ80g9CmX4aTx2Ur9mKh5KxFbKlg5brYGlEz/gKK9IhfZ4kmGZ22nxP164qcgMVs3cdQ3DHN7VxvPK1TmXPASvnqA51zbLUewYHSKUhj6+xfIDDAyewk4Z6Dm+p26lUMJRnWDUs90XB/ENjHywrIIU9wwypGzRPvzkmTU629u4SJPgjEXecIiiRUIHHjwEphuCuOUgpy+wVSYyWMNw+n3L4oHHmKZrrXJouDeIONKNLZKRRLrWZbAyWgRHDeCKLWQO4OlvidTqlv7u9UsHoZtuwIUZaDfnE7yURhwaStakomHLV+mYQXzlK47mfNVBpGWwamkomNluZIDkHcmGk0CWCuP78DGhOD49np2c5ZVjmlpOlG43O0JT91C0L7f9VD+5ucwn7j 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: Hello, I realize this is an older version of the series, but @Vanda Hendrychov=C3=A1 and I started on a benchmark effort of this version prior to the most recent revision's introduction and wanted to provide our results as feedback for this discussion. For context, my team and I previously identified that some of the benchmarks outlined in this phoronix benchmark suite [0] perform more poorly with thp=3Dmadvise than thp=3Dalways - so I suspected that the THP=3Ddefer and khugepaged collapse functionality outlined in this article [6] might yield performance in between madvise and always for the following benchmarks from that suite: - GraphicsMagick (all tests), which were substantially improved when switching from thp=3Dmadvise to thp=3Dalways - 7-Zip Compression rating, which was substantially improved when switching from thp=3Dmadvise to thp=3Dalways - Compilation time tests, which were slightly improved when switching from thp=3Dmadvise to thp=3Dalways There were more benchmarks in this suite, but these three were the ones we had previously identified as being significantly impacted by the thp setting, and thus are the primary focus of our results. To analyze this, we ran the benchmarks outlined in this article on the upstream 6.14 kernel with the following configurations: - linux v6.14 thp=3Ddefer-v1: Transparent Huge Pages: defer - linux v6.14 thp=3Ddefer-v2: Transparent Huge Pages: defer - linux v6.14 thp=3Dalways: Transparent Huge Pages: always - linux v6.14 thp=3Dnever: Transparent Huge Pages: never - linux v6.14 thp=3Dmadvise: Transparent Huge Pages: madvise "defer-v1" refers to the thp collapse implementation by Nico Pache [3], and "defer-v2" refers to the implementation in this thread [4]. Both use defer as implemented by series [5]. Ultimately, we did observe that some of the GraphicsMagick tests performed marginally better with Nico Pache's khugepaged collapse implementation and thp=3Ddefer than with just thp=3Dmadvise, which aligns a bit with my theory - however, these improvements unfortunately did not appear to be statistically significant and gained only marginal ground in the performance gap between thp=3Dmadvise and thp=3Dalways in our workloads of interest. Results for other benchmarks in this set also did not show any conclusive performance gains from mTHP=3Ddefer (however I was not expecting those to change significantly with this series, since they weren=E2=80=99t heavily impacted by thp settings in my prior tests). I can't speak for the impact of this series on other workloads - I just wanted to share results for the ones we were aware of and interested in. Full results from our tests on the DGX A100 [1] and Lenovo SR670v2 [2] are linked below. [0]: https://www.phoronix.com/review/linux-os-ampereone/5 [1]: https://pastebin.ubuntu.com/p/SDSSj8cr6k/ [2]: https://pastebin.ubuntu.com/p/nqbWxyC33d/ [3]: https://lwn.net/ml/all/20250211003028.213461-1-npache@redhat.com [4]: https://lwn.net/ml/all/20250211111326.14295-1-dev.jain@arm.com [5]: https://lwn.net/ml/all/20250211004054.222931-1-npache@redhat.com [6]: https://lwn.net/Articles/1009039/ --=20 Mitchell Augustin Software Engineer - Ubuntu Partner Engineering