Message ID | 20250108233128.14484-11-npache@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 973F2E77188 for <linux-mm@archiver.kernel.org>; Wed, 8 Jan 2025 23:34:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 302C16B00A1; Wed, 8 Jan 2025 18:34:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2B22B6B00A2; Wed, 8 Jan 2025 18:34:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 17B1E6B00A3; Wed, 8 Jan 2025 18:34:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id ECEAF6B00A1 for <linux-mm@kvack.org>; Wed, 8 Jan 2025 18:34:35 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id A9E94457E5 for <linux-mm@kvack.org>; Wed, 8 Jan 2025 23:34:35 +0000 (UTC) X-FDA: 82985891310.13.7489CD1 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf04.hostedemail.com (Postfix) with ESMTP id EFB4B40008 for <linux-mm@kvack.org>; Wed, 8 Jan 2025 23:34:33 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Lg3kC8q1; spf=pass (imf04.hostedemail.com: domain of npache@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=npache@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736379274; a=rsa-sha256; cv=none; b=w2tSnDRbasrzC9H4vjbBEO8RkJ+wGnQsqs1R3VUHyJ6VWoXU03ocdsgno04lKCjwPe5Ld9 jJgq8RSUjdIhoml267yEPEh2NDniAOg/2Dwl7dc7nVT6ERo33EDPXscQFk3JjDUdMyYie3 jXqvRiptZdpVm5SJhtHPVx6qY8IDp4Y= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Lg3kC8q1; spf=pass (imf04.hostedemail.com: domain of npache@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=npache@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736379274; 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=j5EOVM0v0gflap4pKtAxxmUaALnCNv8cRd9oJSElYf8=; b=5Ph/kJiZK07enXykxL6wTV9aTSYyIsG/JOAK8hV8oPowYjCPT+pTaLyrrmtRGV+PVvEdt2 +3VDEFdEnN64eKPOTuNfnm2Bcs7sJrwLWP00Fc8+bY1dEg7CLCjQ4KiMwe3MI2R/JMTT1a VxT32CpM5ZSjMJrJoE9xojXz315qam0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736379273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j5EOVM0v0gflap4pKtAxxmUaALnCNv8cRd9oJSElYf8=; b=Lg3kC8q1v2MBNsj/lUmZi+FTmlFCFExfNt0uKLAyymjo322enanOAC5Fk0gIIikVIqHP7m h2xtTakft42J3pnlkmQeVhzpZXDUrqM5QdCX9Zq4PgsG+wSWW3Goa5/8VnMi0GLn5qcEQB Nsr0rDHy+ZaoDEP4fChEewZmQxLmaF0= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-584--pEwM4wDPgm_w6pskDoyhA-1; Wed, 08 Jan 2025 18:34:27 -0500 X-MC-Unique: -pEwM4wDPgm_w6pskDoyhA-1 X-Mimecast-MFC-AGG-ID: -pEwM4wDPgm_w6pskDoyhA Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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 mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E58CE1979053; Wed, 8 Jan 2025 23:34:22 +0000 (UTC) Received: from h1.redhat.com (unknown [10.22.80.41]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4B9B419560AE; Wed, 8 Jan 2025 23:34:14 +0000 (UTC) From: Nico Pache <npache@redhat.com> To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: ryan.roberts@arm.com, anshuman.khandual@arm.com, catalin.marinas@arm.com, cl@gentwo.org, vbabka@suse.cz, mhocko@suse.com, apopple@nvidia.com, dave.hansen@linux.intel.com, will@kernel.org, baohua@kernel.org, jack@suse.cz, srivatsa@csail.mit.edu, haowenchao22@gmail.com, hughd@google.com, aneesh.kumar@kernel.org, yang@os.amperecomputing.com, peterx@redhat.com, ioworker0@gmail.com, wangkefeng.wang@huawei.com, ziy@nvidia.com, jglisse@google.com, surenb@google.com, vishal.moola@gmail.com, zokeefe@google.com, zhengqi.arch@bytedance.com, jhubbard@nvidia.com, 21cnbao@gmail.com, willy@infradead.org, kirill.shutemov@linux.intel.com, david@redhat.com, aarcange@redhat.com, raquini@redhat.com, dev.jain@arm.com, sunnanyong@huawei.com, usamaarif642@gmail.com, audra@redhat.com, akpm@linux-foundation.org Subject: [RFC 10/11] khugepaged: remove max_ptes_none restriction on the pmd scan Date: Wed, 8 Jan 2025 16:31:26 -0700 Message-ID: <20250108233128.14484-11-npache@redhat.com> In-Reply-To: <20250108233128.14484-1-npache@redhat.com> References: <20250108233128.14484-1-npache@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Rspamd-Queue-Id: EFB4B40008 X-Stat-Signature: rg48yuxfaagzd7bst4n7rgw7tdi7jsbp X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1736379273-13382 X-HE-Meta: U2FsdGVkX192tMZ9vSU4ZPg6FgLo8CIjqb+uOr1rqR6rp6sIQPNEIh76Y/Zh+jJAyifXYqwpyfb0HjS8Xff2AK/5nRe9hQhNhhuiW1yZ+848/WuZSCW03nZblpAxrNiwcccFL18dcZJRWSxYN/YX4PRUNSn8/9cvA7m7SwjGqild7n8Ryl4Wvv/c3FZcqb0RHffrvmMwicjx3/XjP9QwJqBhBNUpJZGLdy97GMaiSqEVLA7Evmlvbg0AgxCWjw1T5yJpx+3a+knZWOXkIrxbtKXLX+qbWM3nKPI1pYNX1CGt2Y5/nBKOCXAvDiWq9M5IxDlI9QwS8Ibb5XJ8t4pS2FQnFy6rQnhgkxa/IR8oLjsHKb0mkWIGqDJOj6KIdjbQ9LKv2WH9LmySY/yy0Rpc5qpLHKXzoFW2K+TieH7N0HH+2wv1EyQZU0/3D7U336rHL/xEasYxeBneJqSMJs+hqY2kr2u7kS1ukjCz1V14Uby6XrNEEPKXI/jUmQBb2XjgASCCxT1h/NmUzPHAZvimBuB8kUoKUKUXH4O8Th8Gte9umrRUOylz1jbReo7nOcJCwIDKYAz2UItFJzItK+bjY1ecv9p0DGQga4vi/JYa1K5lerkHvBllnTqcBmTB1KJ7gbkaLsSnXZyoWRfMvpxLorEMbd4iwBf3K7WiBacYdhoKfWbPVmUXDkUqtHjdzgG2wdsel4UFYSaqKdJacBxEPyufjlg+DwRI4x0AorS72NPwDCFaRQkr6oA7rroT0GK0ceJB5wJN5ahmJiyVPVv6EXxt77aPV2e1L4ZhyYgBLMzowXbvHojIlV5J5ZlP0DJifbt12OtzbJpfADDRDejNFQHzFpy+Of/9Ea1jIi1nq26uKOwQNY3ivLRP9+S1QV/mHCIoiF8lm5yMxu9rr8yrUN4a7+CCe+JtPhDvE4Mt3s3QDXcstSqQc6iMHcT8ZbA+NyYiApMp0BuFNYLDJY3 wLZ+NImg E6fjS+YJOpjGCAnhOdshz/DqkBR+6fxWAQgcelNq/3PQzeWjAVwW9r5Y8z6ihDmQKJh8O32O9CJuGjCAINJ/hu/Swh4IFQFy1VfanyVkUUUXYfOVfa+0NpBAXEW68CFVz7ICRYCxnEaoOgqJs/rrSfmUDcvEXxeqmSEoewcJjOIy0UMAziSijoFKtVIvaKN6w9fLOoFhlytoyEyS0rTbB0Z1TyO4og1s7NbSmQmYCrqeMehYXUSji32o9k8yC85XsB0FN1z5D1TAaOCL4iIL3eoBLxYIHEgoiyV942/RTF5ZKdCLpBAFbaS/8G7dKhiHD7FkDsQym4S6Ah/CvUvnqsuDdcxKTNDFa8CM02thuuK3juRhrFi5ha0rSfHaT+A2LszCdVDb1RIOCbG6Ej94Ds3lpApuq9U9OhGw9wBYgXT9omND9kk2VEa4NL+cbG/f2VyTe 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
khugepaged: mTHP support
|
expand
|
diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 4d3c560f20b4..61a349eb3cf4 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -1446,15 +1446,12 @@ static int khugepaged_scan_pmd(struct mm_struct *mm, if (pte_none(pteval) || is_zero_pfn(pte_pfn(pteval))) { all_valid = false; ++none_or_zero; - if (!userfaultfd_armed(vma) && - (!cc->is_khugepaged || - none_or_zero <= khugepaged_max_ptes_none)) { - continue; - } else { + if (userfaultfd_armed(vma)) { result = SCAN_EXCEED_NONE_PTE; count_vm_event(THP_SCAN_EXCEED_NONE_PTE); goto out_unmap; } + continue; } if (pte_uffd_wp(pteval)) { /*
now that we have mTHP support, which uses max_ptes_none to determine how "full" a mTHP size needs to collapse. lets remove the restriction during the scan phase so we dont bailout early and miss potential mTHP candidates. Signed-off-by: Nico Pache <npache@redhat.com> --- mm/khugepaged.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)