From patchwork Tue Jan 3 19:13:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 38621 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4779384wrt; Tue, 3 Jan 2023 11:21:21 -0800 (PST) X-Google-Smtp-Source: AMrXdXtr4R9DBW7VaaKyGr3qeHXWZkfLC+6XkfJnHsVJpYYKloDwe0RrUrhxNVfnlHDGA4aFg2bS X-Received: by 2002:a17:903:1c3:b0:192:903f:7ac9 with SMTP id e3-20020a17090301c300b00192903f7ac9mr40531589plh.42.1672773681509; Tue, 03 Jan 2023 11:21:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1672773681; cv=pass; d=google.com; s=arc-20160816; b=XFxh0WqSQk5cFd8P1PNEnqNTBONjhJ3UhhJ/61Tk8AM5m/fXoFd8XuZLXG6q8DKzVa KwZ+VzJ/xdlaX2RAmBg/fOonLGQghK6QTxG9FBwqQH35KwHja57YAEv+HPiEJzUPG5cL ZQDN8rsjqn529H2VT+KQ/ZtqMgTlr7HPcbYEAhcUWzmPVZR+ruibDX+wacWKN4W79VSr gMwqOwV+qc3t+pNtnqTl06KOySSdZMUPvjYxUETJ/HVJjTJDXX1t3h+G9Y3tr0JCvnFi 8xgc1zfb2anBi6EJJ5hMU/Ce/879IQk9Bxijn0/W+IoudauDCY2+OJ5EdBkwRQHkAIZn WTgw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=Got+/JhlEbn00M0JyDO+i+N0rLTksWw+LVmAVXZxyq0=; b=UFNRYRNB/oDkeIskIowKj89mZkfVWBiXEl8/7aesa7Or2rfS6haSIUkaQf6BUH44vp EzXZE/1m1kda8v1xyPUma90sZHQzzE1WJFLCby1N+MGuw4vie6LOR7pRERxD+iLmPgvr bc2MBBmbGD3Y1nIsPcl3WfHYKiPi9f9fibr5VFKYnbcwwjgohdQy4XTSG6vw3Hbevlud n30qhvSIJldfB8Gl7S2t4p8jAuFz9xr4XZjzPRsPcYKcqX5LNmLa5cGa4UN+Mtdkoxgp Re3NeV9vdGl9s7wByhLj2UduRmDEJSc1TEe1PsWMLm6qqlvvOVujUGUrG+7AyL2EDlwi 10SQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=sQbix2s5; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Cu8CCfW4; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); 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=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c5-20020a170902c1c500b0018537cc29f9si31556144plc.15.2023.01.03.11.21.09; Tue, 03 Jan 2023 11:21:21 -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=@oracle.com header.s=corp-2022-7-12 header.b=sQbix2s5; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Cu8CCfW4; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); 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=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238994AbjACTQc (ORCPT + 99 others); Tue, 3 Jan 2023 14:16:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238924AbjACTPk (ORCPT ); Tue, 3 Jan 2023 14:15:40 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C2451409C for ; Tue, 3 Jan 2023 11:14:31 -0800 (PST) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 303G3gkY002803; Tue, 3 Jan 2023 19:13:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=Got+/JhlEbn00M0JyDO+i+N0rLTksWw+LVmAVXZxyq0=; b=sQbix2s5B2oXoDrDKOqFM30ToN68i7RjI/TvYtVbZUEvXPACUkUuk1qptiKh1l4kv2ff Hoo/x89KXX7SLun1I6PfotxLOXGpp+MU65sfqF8KAldNnzA9HmRcNMcBjVppncqfThd2 RdewSUnS5YBc5dzC4Vv4niJ12+c1tudw1JeWtN3NgAyQL1vVYhrXZCMbjhDUMZsUuU6I GXtcL7AglsBr6HtfQD99rDwoV356OB36yB0tUlYWeO7f97FwUsS0uwAcaLwCYugm/9wh TfoVPwpNJcQKiYAfFGfRTbzCHU9MMohLtfLESknjyIhvUapfqVaGLxG/ifq6PJqCPTKN zw== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mtcpt4w39-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 03 Jan 2023 19:13:57 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 303ISTnK012266; Tue, 3 Jan 2023 19:13:56 GMT Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam04lp2170.outbound.protection.outlook.com [104.47.73.170]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3mtbh58q1f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 03 Jan 2023 19:13:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=McgaTY1uzXWVRuOjCXiC29mVE4X8gKceCPBETOtC5gotSKSCKZ1NhVnN9DAbu0PaJrtJVJSDhSVKbGZRAlTUCbB4vPhpNSH61oMZcxjmutXnyGS1363ckfQnF28k0ANqLdt1+EHGI1ylfoiDTMT0gLKw6h85cKsHbcLRWa8CI3nWZnnilSS+BXa7QWCBgMErmJtKL/WLQ6UG5t/qs6hiMeaqFPIUCNtGVqmEOrSeZFLo/Fp8j0falAdFQdf7QGZY1Gj2MxsTxUhfXF5OSC/TtgrD5UWTq+KqNeJ0VkESyh/7xBK2gYZLQallQmUAr+ZPldpDOSYn4sMWy3mELi+OLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Got+/JhlEbn00M0JyDO+i+N0rLTksWw+LVmAVXZxyq0=; b=fK68sB+ErNdoFI3gW795pCcVVanj0efk3f4Glchc2Yi+qBbpbeWuG5qgNrbyEsDaRYvYSuXkwImn0WW15ogXX/UHTvUc4Syuf3tYV7yxVMQ45IGPlJi635nor0OJu0uwFg8MmUInOAQ8B+o/hlMGPFy1mwJdSU3N0k6iXbKAsuyR2v1yH9T/oTlL7hzYgr+VdcqjHG9yMFHqA+kfXnn227uLIJ/dTvw/WN99W42k2dfwqnw/WJ5GIq4Rztl8HkzQ2QXoyi2wxDEDQDEtQhlMLy+FVklapOnk380yW0XqJrUgT3Wi6QWOSEdvLR+qW/1U6d8almRBxQKG2+IuKVjA5w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Got+/JhlEbn00M0JyDO+i+N0rLTksWw+LVmAVXZxyq0=; b=Cu8CCfW4l44t8iV9Fh75a3AQ1XjMETZQU27unL1lBoDqEGnO0y61ymKe6LmE84bANyyOG1XpmQ70l0mBjJXdhSVF01q6q5lYUSPEhoJazNn8B47tKFwxaZlai65mVMEcQQrf0hdTiS2yyFQtvh+7EhXVGGtPWlBRorpP5+WwYgk= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by CH3PR10MB7332.namprd10.prod.outlook.com (2603:10b6:610:130::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Tue, 3 Jan 2023 19:13:54 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::51be:1301:5ec3:996f]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::51be:1301:5ec3:996f%9]) with mapi id 15.20.5944.019; Tue, 3 Jan 2023 19:13:54 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, songmuchun@bytedance.com, mike.kravetz@oracle.com, willy@infradead.org, tsahu@linux.ibm.com, jhubbard@nvidia.com, Sidhartha Kumar Subject: [PATCH mm-unstable 6/8] mm/hugetlb: convert alloc_migrate_huge_page to folios Date: Tue, 3 Jan 2023 13:13:38 -0600 Message-Id: <20230103191340.116536-7-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230103191340.116536-1-sidhartha.kumar@oracle.com> References: <20230103191340.116536-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: CH2PR20CA0014.namprd20.prod.outlook.com (2603:10b6:610:58::24) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|CH3PR10MB7332:EE_ X-MS-Office365-Filtering-Correlation-Id: 7d897179-a488-4ade-0f99-08daedbea7df X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9FGS2JXdQ6uqI1yyOV6RWxxposKF3Jj5vNCCv1euCYb3SRQ0GEEd83fpQqK2UKiWaS85lfvh6N0cRiFKZPXMmps80jg1sqH6LeFddhYG7j0WPJ67xKEEdi/OUM+OBBnof9ST3sYIz7kwRjVa98qmH2HYvWvkiD/C340xbrjFCHMq3FoDkoF6h8p4dfmR7H+UiZEtwgZM4kljfDgay+XefmxEwgArTdMP/P76NvdAqJFe2IBXxL0hmZWY60d16SGo+dTbksi2fKh76sFkatRW1byjPf9CaN7OZFBMu5vsQLxQ2uFLzMjdve7pMjW1anw1/iDoPdgtq1kUugTq+GfF8L2hyyFeZsipX9EBKguBamAVjbpUGyDtmy2WQflMrjI8jbi31s7lnI+szchZokZYGRge4P7Hp65gs2845MkCJKQOHKajW5mhIYZVHsycaj3BlfxiLi7Cuen8NpqPI9t/sInI956i6H0u/v7wvmsEt5MnFhGWPclVifSHfgkh3RlxDWjGC438GE6msyIwoxLeZm5Xj3Q3X7t5nK6h+9JmSTnFnyBBT2cO/EvmSpdMdCZGQMHeE28fJcht3Icdbd+txZCsQ9+1T2Bapd0ACG/flLI90vvXWGeioOiBMswW6YkNxhEqm3mMHADngQSqsJeCPjvC3x1MWFitYuesXm/FfDdI7O3Hi0kk6KnTLh6txZXh3JnV01+B55gXq9mYCqTH7A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(376002)(366004)(136003)(346002)(396003)(39860400002)(451199015)(5660300002)(2906002)(44832011)(8936002)(8676002)(4326008)(41300700001)(478600001)(316002)(66476007)(66946007)(66556008)(6486002)(107886003)(26005)(6512007)(6506007)(6666004)(83380400001)(1076003)(186003)(38100700002)(2616005)(86362001)(36756003)(22166006)(14583001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CeHWXLplE0WHpEukUVK5iKKbQdaLk4kUnPNYDEp41IsItpiRAFuw+DbK/Bkgo+MUYZcswYPPbFHQsr46gMZzwYHBm2p1RSJtS+PkroU9ZmX31+v6Vy0+i5bSdFHyMABd/aGm3Y/OnOaN2Nc/iYTkYySgKvQW5HJYILeKfYclDWZ8j2i3qR4iGa2O+JNMLEA8OEO/7ZYF+kz0v0NtRXvSkLH6sfeKjlrKv1oHEqQfNElsdX2YLvUoppLdx3VpbchR8egGpA5TzdjCtKhUsDEldOZjuI7DTUqPSHLoVGcW24Urxx5Qxl2+AaiEl0AAAXm0QIiqC8J+xcZgwmRaSGHobTMqelX6aqbbw5NpvJAz+MfQ5XctODdAqiMaDU9WaDAzX6HEd43gH2k7BOrwVD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mCC/svKgo2qTY2bLiC8HFHRb2qr+mDF3ODtIcTIs8m0GLIq+sTwOtAyXjNEgMDWnWYk6Lt+J4gyIad5UnRLmNbO7curjtfq5DKFuKe/jtl5/bx1QaQa6ewzeySM1lgx6rzC+2Z6I= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d897179-a488-4ade-0f99-08daedbea7df X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2023 19:13:54.3891 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xVxvdyv46VSJHrQ+8Dk0Vf/J+wgBwN7kKFbFieuvMEsU1ZcirYXvH6DoDa5N7xEreINOzaNbXrZ6WLGeV0OzXOsKlZ6N41FuiRcn9k7leMU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB7332 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-03_07,2023-01-03_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 mlxscore=0 phishscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301030165 X-Proofpoint-ORIG-GUID: q05cFM0JuZvSUymM15PuDO91ftZAePl0 X-Proofpoint-GUID: q05cFM0JuZvSUymM15PuDO91ftZAePl0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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?1754030335545603947?= X-GMAIL-MSGID: =?utf-8?q?1754030335545603947?= Change alloc_huge_page_nodemask() to alloc_hugetlb_folio_nodemask() and alloc_migrate_huge_page() to alloc_migrate_hugetlb_folio(). Both functions now return a folio rather than a page. Signed-off-by: Sidhartha Kumar Reviewed-by: Mike Kravetz --- include/linux/hugetlb.h | 6 +++--- mm/hugetlb.c | 18 +++++++++--------- mm/migrate.c | 5 ++++- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 482929b2d044..a853c13d8308 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -680,7 +680,7 @@ struct huge_bootmem_page { int isolate_or_dissolve_huge_page(struct page *page, struct list_head *list); struct page *alloc_huge_page(struct vm_area_struct *vma, unsigned long addr, int avoid_reserve); -struct page *alloc_huge_page_nodemask(struct hstate *h, int preferred_nid, +struct folio *alloc_hugetlb_folio_nodemask(struct hstate *h, int preferred_nid, nodemask_t *nmask, gfp_t gfp_mask); struct page *alloc_huge_page_vma(struct hstate *h, struct vm_area_struct *vma, unsigned long address); @@ -1001,8 +1001,8 @@ static inline struct page *alloc_huge_page(struct vm_area_struct *vma, return NULL; } -static inline struct page * -alloc_huge_page_nodemask(struct hstate *h, int preferred_nid, +static inline struct folio * +alloc_hugetlb_folio_nodemask(struct hstate *h, int preferred_nid, nodemask_t *nmask, gfp_t gfp_mask) { return NULL; diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 640ca4eaccf2..0db01718d1c3 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2278,7 +2278,7 @@ static struct folio *alloc_surplus_hugetlb_folio(struct hstate *h, return folio; } -static struct page *alloc_migrate_huge_page(struct hstate *h, gfp_t gfp_mask, +static struct folio *alloc_migrate_hugetlb_folio(struct hstate *h, gfp_t gfp_mask, int nid, nodemask_t *nmask) { struct folio *folio; @@ -2298,7 +2298,7 @@ static struct page *alloc_migrate_huge_page(struct hstate *h, gfp_t gfp_mask, */ folio_set_hugetlb_temporary(folio); - return &folio->page; + return folio; } /* @@ -2331,8 +2331,8 @@ struct folio *alloc_buddy_hugetlb_folio_with_mpol(struct hstate *h, return folio; } -/* page migration callback function */ -struct page *alloc_huge_page_nodemask(struct hstate *h, int preferred_nid, +/* folio migration callback function */ +struct folio *alloc_hugetlb_folio_nodemask(struct hstate *h, int preferred_nid, nodemask_t *nmask, gfp_t gfp_mask) { spin_lock_irq(&hugetlb_lock); @@ -2343,12 +2343,12 @@ struct page *alloc_huge_page_nodemask(struct hstate *h, int preferred_nid, preferred_nid, nmask); if (folio) { spin_unlock_irq(&hugetlb_lock); - return &folio->page; + return folio; } } spin_unlock_irq(&hugetlb_lock); - return alloc_migrate_huge_page(h, gfp_mask, preferred_nid, nmask); + return alloc_migrate_hugetlb_folio(h, gfp_mask, preferred_nid, nmask); } /* mempolicy aware migration callback */ @@ -2357,16 +2357,16 @@ struct page *alloc_huge_page_vma(struct hstate *h, struct vm_area_struct *vma, { struct mempolicy *mpol; nodemask_t *nodemask; - struct page *page; + struct folio *folio; gfp_t gfp_mask; int node; gfp_mask = htlb_alloc_mask(h); node = huge_node(vma, address, gfp_mask, &mpol, &nodemask); - page = alloc_huge_page_nodemask(h, node, nodemask, gfp_mask); + folio = alloc_hugetlb_folio_nodemask(h, node, nodemask, gfp_mask); mpol_cond_put(mpol); - return page; + return &folio->page; } /* diff --git a/mm/migrate.c b/mm/migrate.c index 6932b3d5a9dd..fab706b78be1 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1622,6 +1622,7 @@ struct page *alloc_migration_target(struct page *page, unsigned long private) struct migration_target_control *mtc; gfp_t gfp_mask; unsigned int order = 0; + struct folio *hugetlb_folio = NULL; struct folio *new_folio = NULL; int nid; int zidx; @@ -1636,7 +1637,9 @@ struct page *alloc_migration_target(struct page *page, unsigned long private) struct hstate *h = folio_hstate(folio); gfp_mask = htlb_modify_alloc_mask(h, gfp_mask); - return alloc_huge_page_nodemask(h, nid, mtc->nmask, gfp_mask); + hugetlb_folio = alloc_hugetlb_folio_nodemask(h, nid, + mtc->nmask, gfp_mask); + return &hugetlb_folio->page; } if (folio_test_large(folio)) {