From patchwork Sat Feb 18 00:27:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Houghton X-Patchwork-Id: 13145369 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 2A780C636D6 for ; Sat, 18 Feb 2023 00:28:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 432E26B0075; Fri, 17 Feb 2023 19:28:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3E32B6B0078; Fri, 17 Feb 2023 19:28:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2860A280001; Fri, 17 Feb 2023 19:28:49 -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 008D06B0075 for ; Fri, 17 Feb 2023 19:28:48 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id CFAE91405E5 for ; Sat, 18 Feb 2023 00:28:48 +0000 (UTC) X-FDA: 80478527136.06.DFC33CE Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) by imf14.hostedemail.com (Postfix) with ESMTP id 204EC100003 for ; Sat, 18 Feb 2023 00:28:46 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=fw5qqHMf; spf=pass (imf14.hostedemail.com: domain of 3vhvwYwoKCNsGQELRDEQLKDLLDIB.9LJIFKRU-JJHS79H.LOD@flex--jthoughton.bounces.google.com designates 209.85.219.201 as permitted sender) smtp.mailfrom=3vhvwYwoKCNsGQELRDEQLKDLLDIB.9LJIFKRU-JJHS79H.LOD@flex--jthoughton.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1676680127; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ZDdwvW86Qv3EMGRuKtmhHN/6JFPd8EDP9/1ArRwRYXY=; b=CERpDE8XnHnvBYSXX/dfeIXoK12kwET09NhUAPeLLJkpz9gpWc8XNYBa6foSTpgpp+err/ e+PnU2wbCD9YOx6MHqQbepQvvcnPZY1jlG6QCP6HtxPskNNzoZnrALsR+g/wo5cder7YQs fDOGOYEVUefNlU8Jn0p5hjlQ/ZWLi/U= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=fw5qqHMf; spf=pass (imf14.hostedemail.com: domain of 3vhvwYwoKCNsGQELRDEQLKDLLDIB.9LJIFKRU-JJHS79H.LOD@flex--jthoughton.bounces.google.com designates 209.85.219.201 as permitted sender) smtp.mailfrom=3vhvwYwoKCNsGQELRDEQLKDLLDIB.9LJIFKRU-JJHS79H.LOD@flex--jthoughton.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1676680127; a=rsa-sha256; cv=none; b=QEW662k/1sXV7obfp+jdoZv6B6wVTG0rngRHVON06QCpcW9EBUMewuFALbcKqCHVE5aZPf F1Xdysq1GoAZXRNcNeebiJzSeGTlu3/njieV5EQKCZQqPtDHCDXfQK3phAFpH+GQyER/3X KFM2zBpBVOm74yorJuJ1kymw+8mpI6U= Received: by mail-yb1-f201.google.com with SMTP id 84-20020a251457000000b0091231592671so2246199ybu.1 for ; Fri, 17 Feb 2023 16:28:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=ZDdwvW86Qv3EMGRuKtmhHN/6JFPd8EDP9/1ArRwRYXY=; b=fw5qqHMfBDzeIudommkAOwo+9UU/gmxeQgIih9FaoEsaJr2Xir63Ni9u5plph47GPQ qKNMSk3EoMZlFvKBixc5SlWffdrOIGT9xwufVeB6w6XtbUefWoHl0UTkSBIeVWA0nx9V 3vx/k8P3X+Nic17umWBpychYwMRvoLYQTiDpyeEvZuRVuWt8x3OPh+qcKKxIEMfqpB+f E4BJn1mxijItNJzVQ7AX794mA3LDFIyPdFN2u6SvQkdpMoHSeet4GeunVcsqyLAUuaFL HvKzb76potSZYgInefPIg3oX/vB0taPuTk8WpA+EnFjlSQJ7bSf8eNOYwuT07YyeDAq/ 1HaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZDdwvW86Qv3EMGRuKtmhHN/6JFPd8EDP9/1ArRwRYXY=; b=fy8b4YUjoP6hZw1wVrWBlJscuUJhxOqXqgxQFP3AKTFi1YRluJ/YWB+qGxFm62zlMp K0mudjSkUS3DG0vTmtH5fW+A7+UpAYCHQX0QAPZuaJ1bkrHno+cbqwBmjo/3kSKM6h2j OS/+cBBWaza93CWL2VWmACQqNlLssi0Ag/m4ATombNnjg7htM2+DloYK6LLzjenhLaV7 2mMnNqQiF+eTI8J/EXG4gUKoxTiZKwySWSnfKXDXtL2q+Wf2Dkh4OjGNr7SQ7Sipnaib Ig3K4ZscT4Q68O3R9NEGh76cwyouR/0bSOEXcHXoi5tCeSbapgxSEHoPpmiwNx9y0Gji FD+Q== X-Gm-Message-State: AO0yUKWnVSA6pFdznJ9Wi7o3fUA/LepvW9TRKAML+yNOugjoPunmpCnT h0lRfkNlzwOKSpYEn/P7/Fp0RHwk+ox95HO3 X-Google-Smtp-Source: AK7set+jWNiXveMIuz9URODx+pb4bTot1Uag93kYz1pPcv1KgJFihpEhzSj3o+H8iWxGWVbjL8VHgACEeLjh2Bea X-Received: from jthoughton.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:2a4f]) (user=jthoughton job=sendgmr) by 2002:a81:4511:0:b0:52f:69d:cc75 with SMTP id s17-20020a814511000000b0052f069dcc75mr301138ywa.6.1676680126332; Fri, 17 Feb 2023 16:28:46 -0800 (PST) Date: Sat, 18 Feb 2023 00:27:36 +0000 In-Reply-To: <20230218002819.1486479-1-jthoughton@google.com> Mime-Version: 1.0 References: <20230218002819.1486479-1-jthoughton@google.com> X-Mailer: git-send-email 2.39.2.637.g21b0678d19-goog Message-ID: <20230218002819.1486479-4-jthoughton@google.com> Subject: [PATCH v2 03/46] hugetlb: remove redundant pte_mkhuge in migration path From: James Houghton To: Mike Kravetz , Muchun Song , Peter Xu , Andrew Morton Cc: David Hildenbrand , David Rientjes , Axel Rasmussen , Mina Almasry , "Zach O'Keefe" , Manish Mishra , Naoya Horiguchi , "Dr . David Alan Gilbert" , "Matthew Wilcox (Oracle)" , Vlastimil Babka , Baolin Wang , Miaohe Lin , Yang Shi , Frank van der Linden , Jiaqi Yan , linux-mm@kvack.org, linux-kernel@vger.kernel.org, James Houghton X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 204EC100003 X-Stat-Signature: efuq757ju4ai6uejm5p7x3o9zqsoq9wz X-HE-Tag: 1676680126-359154 X-HE-Meta: U2FsdGVkX18tHNKZCpkuodnHePHA2ZIR+AsgJB8U8W78UvJzKWHJkw8Ztc7AWyuVmBMLQYMC2ge0+cgVPhXAB1QY2n1NHbDgEyOwQD6Xo+sjpkrILmF4K8/EN17UI8WqX0cbw36dCjBiiQg21uMxSknpDweB9j46q2aKFBGKEeXKpY0WAY14q2xaMfKL8/c601zJbzK5TCUU9Wrdsnw8ztAMuCUEtc7stwm9DnSAD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24HPCnlzjm1iwk6qI3zemI9wUlsC1ORqtu/WTUBV7PB8Iv+fUZI4mjrvZBS0A9EvmgmMLI3Dz+s3SK9PqowJ4VbsmxV59F18ZmgGOK2lJMxp1ZJJRcW3Ze5q6n4nf2qgNS4qzNAWknQNa3vrEOw73cCs7gQo2kziivx54YPs86aRuQq2naijDSnvkuM1M7D6VrYTR+qbxNsWQEoKGqOn+QzdoxNBnJIq7ZXHmLLfONK9zmLzqkNRsjdJp00nc0I2r8/vYRH+n4+2Xk8vVXZqOhz34u+yhTyo8H9gVW1X/XX95cdDjnmOkC53uxGATRMuvemKErhpOeyylFGBJEM/GWaV0MZ/W2+oMvlZu6CKznIx/bLp 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: arch_make_huge_pte, which is called immediately following pte_mkhuge, already makes the necessary changes to the PTE that pte_mkhuge would have. The generic implementation of arch_make_huge_pte simply calls pte_mkhuge. Acked-by: Peter Xu Acked-by: Mina Almasry Reviewed-by: Mike Kravetz Signed-off-by: James Houghton diff --git a/mm/migrate.c b/mm/migrate.c index 37865f85df6d..d3964c414010 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -249,7 +249,6 @@ static bool remove_migration_pte(struct folio *folio, if (folio_test_hugetlb(folio)) { unsigned int shift = huge_page_shift(hstate_vma(vma)); - pte = pte_mkhuge(pte); pte = arch_make_huge_pte(pte, shift, vma->vm_flags); if (folio_test_anon(folio)) hugepage_add_anon_rmap(new, vma, pvmw.address,