From patchwork Thu Jul 4 04:31:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oscar Salvador X-Patchwork-Id: 13723222 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 4A73FC30653 for ; Thu, 4 Jul 2024 04:33:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DDB9F6B00D0; Thu, 4 Jul 2024 00:32:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CEB2F6B00D1; Thu, 4 Jul 2024 00:32:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AA38E6B00D2; Thu, 4 Jul 2024 00:32:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 7EA066B00D0 for ; Thu, 4 Jul 2024 00:32:49 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 384FFA0FC8 for ; Thu, 4 Jul 2024 04:32:49 +0000 (UTC) X-FDA: 82300799658.19.A3314A0 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf13.hostedemail.com (Postfix) with ESMTP id 223A32000B for ; Thu, 4 Jul 2024 04:32:46 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=qWQLNf4E; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=9PS3LOnT; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=qWQLNf4E; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=9PS3LOnT; spf=pass (imf13.hostedemail.com: domain of osalvador@suse.de designates 195.135.223.130 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=1720067555; 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=9eR5Nhbb0ANiKXQprN8VC6tLG959+ERIV2i0QqHsYD4=; b=f8EEUNLqJkFay9Ci+PMRRS5oSpiOEbUIM1kr3IFNkAWt6vN3nUGsYer04LDrqSBkytYsFg WEfV7PVppDM68KgRPYUGokJK+DoscVqFdw7mD0UEWLBahx2CYd6zBi0pAntxZ/7x4ia6/l 4Bu8iE+Oqpn/Sjy5d99wwtzimoYD6z8= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=qWQLNf4E; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=9PS3LOnT; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=qWQLNf4E; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=9PS3LOnT; spf=pass (imf13.hostedemail.com: domain of osalvador@suse.de designates 195.135.223.130 as permitted sender) smtp.mailfrom=osalvador@suse.de; dmarc=pass (policy=none) header.from=suse.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1720067555; a=rsa-sha256; cv=none; b=xnsWbRd+LUckjp0Ub127YdHGQUVRmbm7E6hSF1Z8voggXjHZlsaxDuFdmj8PMqeNQAh21V fASrF64K8dLKDfHlPxI3MHRokOj9afI1TzlZzcFMm9pXZc4tZ34aX7s5jRTf2csA9+kOzu 5JLNSyW80XPJIKddES72heidhd2QpBU= Received: from imap1.dmz-prg2.suse.org (unknown [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-out1.suse.de (Postfix) with ESMTPS id D89E621180; Thu, 4 Jul 2024 04:32:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1720067565; h=from:from:reply-to: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=9eR5Nhbb0ANiKXQprN8VC6tLG959+ERIV2i0QqHsYD4=; b=qWQLNf4EDHAPFOcSiw8o9yIVaDWy3wN7EvJ2sANX/QaSm9/dzdpfyxkS+tGCPT67FTj67/ qxSBubrEfCFMg2meOU9ONT/982yfM0wORqljjkCK0CIkPk/MmyWkBuIbujyg+alQu42Nox +3A8UPaXHPIjQsi6zuoCjBr/Vxx+ZLY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1720067565; h=from:from:reply-to: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=9eR5Nhbb0ANiKXQprN8VC6tLG959+ERIV2i0QqHsYD4=; b=9PS3LOnTWX4tc9eF256ZXVJczKFHze/Ne7gNltkr5CcTePNcTuvg5Xdekx74hNiZwcr4HX nEMGuKsw4KpydzBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1720067565; h=from:from:reply-to: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=9eR5Nhbb0ANiKXQprN8VC6tLG959+ERIV2i0QqHsYD4=; b=qWQLNf4EDHAPFOcSiw8o9yIVaDWy3wN7EvJ2sANX/QaSm9/dzdpfyxkS+tGCPT67FTj67/ qxSBubrEfCFMg2meOU9ONT/982yfM0wORqljjkCK0CIkPk/MmyWkBuIbujyg+alQu42Nox +3A8UPaXHPIjQsi6zuoCjBr/Vxx+ZLY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1720067565; h=from:from:reply-to: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=9eR5Nhbb0ANiKXQprN8VC6tLG959+ERIV2i0QqHsYD4=; b=9PS3LOnTWX4tc9eF256ZXVJczKFHze/Ne7gNltkr5CcTePNcTuvg5Xdekx74hNiZwcr4HX nEMGuKsw4KpydzBA== 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 C103213889; Thu, 4 Jul 2024 04:32:44 +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 +JDnKuwlhmbnDAAAD6G6ig (envelope-from ); Thu, 04 Jul 2024 04:32:44 +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 44/45] mm/hugetlb_vmemmap: Make vmemmap_test_walk skip hugetlb vmas Date: Thu, 4 Jul 2024 06:31:31 +0200 Message-ID: <20240704043132.28501-45-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-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 223A32000B X-Stat-Signature: pranmx6oobo99ug3gzgciw37zqf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1TNqdNPNHvL4mXxp/slgI5s0naJsa02GaIJm/g07ciGPR1nLLEjRIOmpOHjRGU0XQtWXbHcRg45JbBoMLgOSTVZYss84m/naGi9crm7KdVj1Do/d6TRxdDP1SqDhZ0Y/A0pYh27WaPQpDKpui9xMJMUn5j1seFrFHxph4v78mnGJgFSGRK2s+wE/nkDzEA9CBok2GhEmJdnrmXtcLbUVL8DUktpAqbr40ZuzcF9FZ/PYzaVhYzE 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: Skip hugetlb vmas as we are not interested in those. Signed-off-by: Oscar Salvador --- mm/hugetlb_vmemmap.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mm/hugetlb_vmemmap.c b/mm/hugetlb_vmemmap.c index 829112b0a914..3e6fd5ae27bd 100644 --- a/mm/hugetlb_vmemmap.c +++ b/mm/hugetlb_vmemmap.c @@ -151,9 +151,21 @@ static int vmemmap_pte_entry(pte_t *pte, unsigned long addr, return 0; } +static int vmemmap_test_walk(unsigned long start, unsigned long end, + struct mm_walk *walk) +{ + struct vm_area_struct *vma = walk->vma; + + if (is_vm_hugetlb_page(vma)) + return 1; + + return 0; +} + static const struct mm_walk_ops vmemmap_remap_ops = { .pmd_entry = vmemmap_pmd_entry, .pte_entry = vmemmap_pte_entry, + .test_walk = vmemmap_test_walk, }; static int vmemmap_remap_range(unsigned long start, unsigned long end,