From patchwork Thu Jul 4 04:31:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oscar Salvador X-Patchwork-Id: 13723211 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 93CB5C30653 for ; Thu, 4 Jul 2024 04:33:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B402C6B00C0; Thu, 4 Jul 2024 00:32:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AA25C6B00C1; Thu, 4 Jul 2024 00:32:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8574B6B00C2; Thu, 4 Jul 2024 00:32:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 60B2D6B00C0 for ; Thu, 4 Jul 2024 00:32:35 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 18B38120A39 for ; Thu, 4 Jul 2024 04:32:35 +0000 (UTC) X-FDA: 82300799070.02.F0D36B0 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by imf24.hostedemail.com (Postfix) with ESMTP id 19625180016 for ; Thu, 4 Jul 2024 04:32:32 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=none; spf=pass (imf24.hostedemail.com: domain of osalvador@suse.de designates 195.135.223.131 as permitted sender) smtp.mailfrom=osalvador@suse.de; dmarc=pass (policy=none) header.from=suse.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1720067528; 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; bh=wxCRzy9udt8uFnD1otT2eiNuqHqdgC2Y99Too233j8w=; b=zjLW7bmg25nys+CZscLbK+N3ulo24JQ0J/ID0yVlXu9hZgq5dXqrYsBK902UD1BGnPf1R8 5vsIa6SWPDtlMmO0L/Myuah3AZ99APHw7cUQebch/i1ooLhk7SxNdT1tIxODXzdBkpNOWh fPJP+kqSNFpzd4Aw313xxbt0zrrdOyE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1720067528; a=rsa-sha256; cv=none; b=Azy/HqDoHPPitSGjg06Sj8DqZ4klTkeqDqbLFCSGgG+sQp/3HyqwBvrj2v5opwPEA97PH7 4wWywyU4JIgusaU8gUVj6ID0p1VyD58ybYkUgzlse5LdBmpynJ5Zjg8dL5kmQ3lgV9GM6v F1T5laZfcsnjJS/Muy+ZpG0nqwcYoBQ= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=none; spf=pass (imf24.hostedemail.com: domain of osalvador@suse.de designates 195.135.223.131 as permitted sender) smtp.mailfrom=osalvador@suse.de; dmarc=pass (policy=none) header.from=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id D6F111FCF7; Thu, 4 Jul 2024 04:32:31 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id B441C13889; Thu, 4 Jul 2024 04:32:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 8OBhJ94lhmbnDAAAD6G6ig (envelope-from ); Thu, 04 Jul 2024 04:32:30 +0000 From: Oscar Salvador To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Peter Xu , Muchun Song , David Hildenbrand , SeongJae Park , Miaohe Lin , Michal Hocko , Matthew Wilcox , Christophe Leroy , Oscar Salvador Subject: [PATCH 33/45] mm/hmm: Enable hmm_vma_walk_pud to handle PUD-mapped hugetlb vmas Date: Thu, 4 Jul 2024 06:31:20 +0200 Message-ID: <20240704043132.28501-34-osalvador@suse.de> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240704043132.28501-1-osalvador@suse.de> References: <20240704043132.28501-1-osalvador@suse.de> MIME-Version: 1.0 X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Action: no action X-Stat-Signature: w5ng35pi5uy5bnw4enwriix71ftfkekb X-Rspamd-Queue-Id: 19625180016 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1720067552-851387 X-HE-Meta: U2FsdGVkX1/OaNUpaXMgraQzZWrPYacg1u173uTJ0aI+ter7o5UNRHz8rWu15FpkErKJ3BawTdIiiSt+Db7SboFojgP9F541SuyNmRavvm0pq9fEQmZAU/X4+tLyMcTRSKYIao+7QjrXIc66yOfq+hwk7FKtppIASKVbfQf3O0LJ8ZubyRVPxRblrkzouBaAbqlnhZv9kFDL4BPYLxXxUGX4zOqlrnR0zCT1QGzrG3HDpNjH56poJG6+VV5Tv8GGg0lHSNRj/w2+lwqx7UW8Zq6f9D7wZ3L81appYU5je7wCV1dWIVUk5TPZ0DgN/f4toJFsU7s9Zot3q2gXtOS0iS/UXDaiyBosXq82WxvXm1zIsRI0cMKeeWu98q3hPiXJc1gO7fds5TQJHFoe0qcEr0vJKl2jDKNrvn3Qrp/9Ee2GBrm3HeCKA31qFqtqOCvd6UbL54t/bJkwFS0aVusGxiNHvYS119oyMkrURl2EJah/tLb93PQrZ8P6yLl4sh/0l+KOiajMuLeK3wwHoa+vTJ5jej09QQpDGk9qWuzaafkucUUcesvO/tAfaEExDW6PWHWkPIs8ozr+QewOfwvLHvAtgORUlv4qe9BDBlbMFv8YySke0zVJ8Y4x6XD8ClM9pC5RXFyZXiRXMXXHv7dSLoI73uj5WSXOqF1sh+ONhXNWyTHN5xYaZ7aDDGvO64W6natjSuuvxGea1dmHAMVtvBtSHcfk1WzAE7sqrrCBxe1sA5j/CG4eAlssgdpS+enakAgsobsZTPE3Lb/0nyyHBYDkzexjJBkJCd9eHTCDnH0IwB8XtrP8NLVEZfcU/k+Fd7iISAdaPeK+yDs30uA9mwCSlQQP8g7pRTwtLgce46h4wjmR9L5e2wXoqfgQSrpotYu3Un9m2tgPIKWp1d0wFMeM7BvT0OGeEClCiCq20srXgmCzcaHve+FPWrHy9h3njqMGIzCvYGYK9k47AQU a82u7Sv9 r2uc8QPETCr8RHO7irZ++nm4+KtYg5O14SVkYjGPsDy26loNd8tYTgvQXMTpinamk2q4QLoh11yTByCDriTWIr6RXSUnY+bf4rKrEiUU1LbLmK4HeUAJihXmsjHiFe+1HqV06BYEGU5BX7ZHAt5NPu2X0bUfP5AiCgvVvG/Xvl/TXL3g= 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: Normal THP cannot be PUD-mapped (besides devmap), but hugetlb can, so enable hmm_vma_walk_pud to handle PUD-mapped hugetlb vmas. Signed-off-by: Oscar Salvador --- mm/hmm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mm/hmm.c b/mm/hmm.c index fbee08973544..2b752f703b6d 100644 --- a/mm/hmm.c +++ b/mm/hmm.c @@ -396,8 +396,7 @@ static int hmm_vma_walk_pmd(pmd_t *pmdp, return 0; } -#if defined(CONFIG_ARCH_HAS_PTE_DEVMAP) && \ - defined(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD) +#if (defined(CONFIG_ARCH_HAS_PTE_DEVMAP) || defined (CONFIG_PGTABLE_HAS_HUGE_LEAVES)) static inline unsigned long pud_to_hmm_pfn_flags(struct hmm_range *range, pud_t pud) { @@ -429,7 +428,7 @@ static int hmm_vma_walk_pud(pud_t *pudp, unsigned long start, unsigned long end, return hmm_vma_walk_hole(start, end, -1, walk); } - if (pud_leaf(pud) && pud_devmap(pud)) { + if (pud_leaf(pud)) { unsigned long i, npages, pfn; unsigned int required_fault; unsigned long *hmm_pfns;