From patchwork Thu Jan 5 10:18:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Houghton X-Patchwork-Id: 39427 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp227280wrt; Thu, 5 Jan 2023 02:21:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXs4Bnp8ZvlwMAFN/6buIGf0hjVrv1S5uGUvF3iFyJIEDmVs9IZN9SnbF3yagitNjtow6vav X-Received: by 2002:a05:6a21:339b:b0:ad:c97f:1c1b with SMTP id yy27-20020a056a21339b00b000adc97f1c1bmr78188551pzb.0.1672914083186; Thu, 05 Jan 2023 02:21:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672914083; cv=none; d=google.com; s=arc-20160816; b=SloVWMrdWIhr9SMkgCJyRrqiAW2/4RDws2ufntbqF3ymX70jC9Bl2+UPlzGA3bQArk +DwWvKJQNd7Ll24K9yss8B/VCIxR9OuuKHQvriame38Wl+YT+zS6Hf0C3KfdfHkr5OmI fZax59CWrtHkgAWib5bLWLz/GsnmRMz0hIttuv30vFiwPor5gYhuL3AECmQWcAuX5wUR Hkp0IYVmzWJLxsIt6gu0qFwoPWVF50WlAlBa7BOT8MDuiUKPFVQHFAtyWVsm8rYBEinn 304YlL3874LhVwgAY0GIJYP4mRlWr2cg8jNipCHHVzp+i0BuypKiyYfhyXyG0DLWmvaO 4mDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=6/ywzp+1XO7/Q8q0gmg2VRvRHujBF/Iur/xAcCpSChk=; b=HgDuacqq5iywOo7q0G3fdjew/8d3Q9pk9NqEnkHFgMtaBwPY2tNexywaX+DVMkkD3h s3lF+AQVW3WkagW1xwxysPNl+CurGm4K2wKXe8v6lQgtFscSFvmh/1bJsFmmD7JDQO+C Yam9c81w411AsyqKZQL+PklHQM4OEzPS91kQ9s6cW0qFlTikEi8NKd1wj7qRvlFvFKaM /gjkQa4TakTAuMsbn3cNZonAvSdDE82D7yey2C5XGsqtpYEsJqlbnwKKheR02/fA/tHv UGYSBwUr4cwGEMcVqe4GaNzY6su5Ao8khXO8gitRk3+f02rlUSqLRZ3q4bDLiZhMNnuI Cqkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=pqyC2Khn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g12-20020a63fa4c000000b00477dd72d2b9si37891895pgk.72.2023.01.05.02.21.10; Thu, 05 Jan 2023 02:21:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=pqyC2Khn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232546AbjAEKTa (ORCPT + 99 others); Thu, 5 Jan 2023 05:19:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232540AbjAEKTB (ORCPT ); Thu, 5 Jan 2023 05:19:01 -0500 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F13ED395E1 for ; Thu, 5 Jan 2023 02:18:56 -0800 (PST) Received: by mail-yb1-xb4a.google.com with SMTP id v13-20020a25ab8d000000b007b54623bf71so1083316ybi.2 for ; Thu, 05 Jan 2023 02:18:56 -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=6/ywzp+1XO7/Q8q0gmg2VRvRHujBF/Iur/xAcCpSChk=; b=pqyC2KhnurZ2BnxaxGpvFtfxzpkkxexWo/NsKpGJkrtsdVnOn9JsTznF5L8T10dpT9 AAb47kUzRLKe5zL54ZIpCmLTz4iG0qnBDPnnSJAcX0pnE6+rQ5/lLGGtdmK63OoTnblo GF3eU42h4BBDQ+ilspuDnsLoOBvix+ESeq+eoZdNGcZsD8QY/hbtyL1dR+g501YZ67Fz z9RZ/NbRSQRm1YcmxGoEQ2uIv7H63+AOQO1vX0XPbnZjLlUJSXkLGIr1Ih39qo/E4CRT MtdnGWeT9yFYs2+Gmn78g91Y+8+cLHMNidVLgMRBi0PWC2oIxVrguFCrpF8qXSNrN1Aj N+1g== 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=6/ywzp+1XO7/Q8q0gmg2VRvRHujBF/Iur/xAcCpSChk=; b=k+wtV9f+Vo4yo2iwVPRg+YPf676NVMWbA/bz6f3ErzkMph4NsLxQrWvbDeBYWWN6Y/ UY5xPGHsZ8l7b6qCu7xUeiQOeUqvGmaRJrrijStmhnR6XAOXM5Le5yanImtCvWo5RH+9 2Y1SpgfVgnwNdgZTy3mu2IADGyPoQrYBwGecQgqGTEs9JgwC6xNHOEn3H6xcLYlVGr5I 3OPG1Ud6VMp7dWpsM+Vw9sDFyvNm1yHkhxWJOqsO6cf4Z7+foE1Qj8fR7dUdXdSxHMj8 w/kEsNAoxxyfc1BUz5OGPgQF+hrFfR51O1pCDz+J7WtXk13yY4Qk0/7U5uc8M1Ai7NPL 0qxQ== X-Gm-Message-State: AFqh2kpoL9USd/E7MiNSDC9LGdbGJiHGo1yZI3zOl1WOKfQRY9B9rtIK g3ONhuu5lwNuZz6Jvb3/slroZuR0Lz3eLaTF X-Received: from jthoughton.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:2a4f]) (user=jthoughton job=sendgmr) by 2002:a25:bc8c:0:b0:79c:8a57:64ed with SMTP id e12-20020a25bc8c000000b0079c8a5764edmr1722191ybk.16.1672913935908; Thu, 05 Jan 2023 02:18:55 -0800 (PST) Date: Thu, 5 Jan 2023 10:18:01 +0000 In-Reply-To: <20230105101844.1893104-1-jthoughton@google.com> Mime-Version: 1.0 References: <20230105101844.1893104-1-jthoughton@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Message-ID: <20230105101844.1893104-4-jthoughton@google.com> Subject: [PATCH 03/46] hugetlb: remove redundant pte_mkhuge in migration path From: James Houghton To: Mike Kravetz , Muchun Song , Peter Xu 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 , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, James Houghton X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754177557732941907?= X-GMAIL-MSGID: =?utf-8?q?1754177557732941907?= 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 --- mm/migrate.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/migrate.c b/mm/migrate.c index 494b3753fda9..b5032c3e940a 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -246,7 +246,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,