From patchwork Mon Jun 12 20:39:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 106827 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp124405vqr; Mon, 12 Jun 2023 13:48:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5KgU3GsmjHcYhjETAT6MnKJWYMX4b2FNQTV38yw1mNcj+bJY9/YPCvDpJsiYJWWbQfBLZ8 X-Received: by 2002:a17:907:1c97:b0:973:ff4d:d01e with SMTP id nb23-20020a1709071c9700b00973ff4dd01emr11327298ejc.31.1686602900349; Mon, 12 Jun 2023 13:48:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686602900; cv=pass; d=google.com; s=arc-20160816; b=qvsa29uRZpAEwR7PYvUy1Y2DaL9e+lsOHh8mssSe1PtgrdpLCNY5NrNLtHb8D2oET0 5qQa3xW/IkzGrT8BX+VSzLB6axmLllWThgnrRM6nx+WkboyKB+4053GcLol3ouqdbNc1 +EtBHi9Nd5F6XFI/fxP9dSNwH2eE1ybaNXDP0+lFQaIMzmKnYPQfs/DdlntJhkg/8Wks ePZDwHvsZA63ogYJe7R4hraVVkWYkBPM9Gn6g/TIq0D+J6v9t7hzZacM4hpa7lt9E1Vl qXdiP6agLW3kHg4El/OnwTyvqg2B4U/guJHWQrwwDLgoZE+jfYmJtaQ5D1aMlm2IrKbD nGoQ== 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=NJmVxdLzLEbLcdb/yA4FmvurN2C/Dp3Rfx9FmMeuxiA=; b=dtuLX5kHa0lVMXFOys41YzaoddnurjW0ZeboYfOPFU2uGgRCS1/eyeFS6ecXo/+mto 0BRWJ8smN19/oBU3aew7yDfPD3sqswroPVRcxLEt12/sSh45ElJVamM/wQoiBoPyOjvO fzusrEGNXGdci3S5evR/qxekJfyvnjS6nwMhMFnaUFSETzlmuQ7bIq3n3BguXIQCF+71 jgyWA5l+jrGzabTTLm3ndaE/4kRDCvEQ4qGheboUI7fO27ol49IoXt//NxUMw5/0342y 5APTO9IpxyAenvdInT0AXwIzhgpY60QDjr8OvK/lWgsPoaTGGHRtofx1TfYb2a5gO1iY J2mg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=i9qE9hCS; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=RJQlZqZu; 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 o11-20020a170906288b00b009745de8db9dsi4985561ejd.194.2023.06.12.13.47.56; Mon, 12 Jun 2023 13:48:20 -0700 (PDT) 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-2023-03-30 header.b=i9qE9hCS; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=RJQlZqZu; 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 S233399AbjFLUlv (ORCPT + 99 others); Mon, 12 Jun 2023 16:41:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236078AbjFLUlA (ORCPT ); Mon, 12 Jun 2023 16:41:00 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B24A519A7 for ; Mon, 12 Jun 2023 13:40:53 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35CKO4nm029683; Mon, 12 Jun 2023 20:40:29 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-2023-03-30; bh=NJmVxdLzLEbLcdb/yA4FmvurN2C/Dp3Rfx9FmMeuxiA=; b=i9qE9hCSQDKA4f5Ep3rPsXgHaGrky7c1yc5PN8ZeZOAWuxj/CV8cITcF+fSQelWUPgm1 BfVUCQbtaVjaS6dUO1vqSm7wq+ysIH/R2p/tIuLcterTsHNqxy6r7xoXfa7rPxHdmH5q v6wdhJ1q/GlKWKh1lKx3u5Fyx3lPztCzRKpkVjy26CExuvkV26dtJoPZPObIkYhW5W9z LpnYCdY+oguHhdPuGczzHSeFrqfEKgiTZ5p3PnXmlhN2OTLLjHyXOkZFPO//Y2uJnAHV S+E94DWeBfEz5HL6jj9+1jrawxgeG2EEghON9/M+IoHS/8behS1qxGQYEeNOrivwFuZf Fw== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3r4h2akv49-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 12 Jun 2023 20:40:28 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 35CK5C8k016192; Mon, 12 Jun 2023 20:40:27 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2040.outbound.protection.outlook.com [104.47.51.40]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3r4fm39a2c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 12 Jun 2023 20:40:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Iu/ENnTKzbTs31QmEtIiDzbg80S3aFioxCCt0cAiT4HSPoghkxDDiDYFt1dWWJ5PT+wH3YtnF9tuH4HxmH4s7214eJZ/zobmRj3qn5xPtsbu5peuazyXswM3i1/vAUwGAEwJ4DZpnoQ9Eue9CFICEWaF28utPohX2kVs+ReQmXAn8gBU2JsNsf7twMPI0Of1v7I07oSR5EA+/pzTB0cKoPGXYtZUgGgL/om4AHG+guWrnJCQCScfFuxUx+INZkP7NLIt02BRDJXqAf3lAii4ScoHq6bnKKtOiw51WW4w8Y6AFpJ3pCoQ3DquUvOCrxWILSWDCkAQETqeG9x2eHlfdg== 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=NJmVxdLzLEbLcdb/yA4FmvurN2C/Dp3Rfx9FmMeuxiA=; b=mCsGs2f6mUmdJLMhkY9ZFfwgc3zRaWYdeeThWb3JYlVfTpU2Osy9g209cYLfVaTdyvtyNW1+HVdvdQpUCY5A6Jn2yreljze53aOwIzYWmA1gXcEpOxZ7nKTb4tGOQWi5hWEyeFFLqst9yzyB8LnpvT2najdT6eOlzco3LWKSUq4KxVHb048DCDRbN+pijKhh7HKjkKNHbI4UD4r1wt3VuMHVsR62elPn7oNOzKHa5VIyXcpiIYsPACTALDPn+4+T9/nY2o6aedJEWcUbXqmwms/s8LVSAWa3ED0ytw1TzHFt7QCF3AKWc023yvp3S7x53U4Y1GoZbA3lxmBTf1EfHA== 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=NJmVxdLzLEbLcdb/yA4FmvurN2C/Dp3Rfx9FmMeuxiA=; b=RJQlZqZuu8eb7hqkFrI7CY7CN7sByKgIa4v4/CUaw5XlvTfAkH6vEvQTcW0lEFIlzJJQQLEW0DFwF9nqPY2AXnv+SHug8yENm1rnG1hapnNtBwJ42Enc9X1ft9QU/70o4msvXU/79Qv/xOpIJ1P0gpti/yalwhLGgdYt4THu0Ww= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by SA1PR10MB5868.namprd10.prod.outlook.com (2603:10b6:806:22b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.44; Mon, 12 Jun 2023 20:40:25 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6455.045; Mon, 12 Jun 2023 20:40:25 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Peng Zhang , "Liam R. Howlett" Subject: [PATCH v2 10/16] mm: Use vma_iter_clear_gfp() in nommu Date: Mon, 12 Jun 2023 16:39:47 -0400 Message-Id: <20230612203953.2093911-11-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612203953.2093911-1-Liam.Howlett@oracle.com> References: <20230612203953.2093911-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT2PR01CA0015.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:38::20) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|SA1PR10MB5868:EE_ X-MS-Office365-Filtering-Correlation-Id: 21f98b25-61ff-460a-1927-08db6b85404f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ui6FME3PmAE0xJih6todlSqHZhFHycEvuWQQQOHktI0+6KfNlq2rJCBlLvfVtZxJeepEucrLjLbd5+uTEbNYbt9f1Ue2fGfFF1E5HC+buue3em5jlMJ/g/XyfimTu3Ld4xy+4RbZDFxQ26DZ/dg1IJpdgaetU4xhKtGb4H9pMbrQUoMBzZDilY94y/SYjw5R5rPN+ih7q3WZnGl3YpUk087bSZyGR8wejoljWQaskPjQ41KOGjo6hDhqm+HY2TpD1ssVRyedySw+KnmWhHpl5iKc6SZwQHjHCBAp4Tg3KmOIk4y4y9SpMtn8u+W4p0sjvHY3st9MiyVGk0Ytk0H/BFwQgYbmmxj+4Ryrfvlc1tOm9nEWByIGu20iVUltSHeTk0r5zegin443E1wgEnBca3mG/KHYJjq0Dt6u2af6esVEQyk4vl4RvLMCbfNLpRAPJ8RcAi/wqL46DUMI9m8Noeev74Pq7Eufr8GH4LR9ci7jCNsHWcPAbk+tcBsksHREpCXc3fPfaLjGxBuBcSef56zvqtKQ7+vBo2nrFKhQ4FxB8NN02BIMecGFzov7IU3g X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(346002)(39860400002)(136003)(396003)(376002)(451199021)(8936002)(8676002)(5660300002)(4326008)(6916009)(66946007)(66476007)(66556008)(316002)(54906003)(2906002)(41300700001)(6666004)(478600001)(6486002)(6506007)(26005)(1076003)(107886003)(6512007)(83380400001)(186003)(36756003)(2616005)(86362001)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: E85lERHnonFOLmCDSD8HiyPzvk1SlzUAXOk4YIm1nJMo9uqAe0GEKwPyMtTyp4pBoW3yTile2BoYQDe8zuUnAy9/6c9qNabKX6puW6FFUmVZ/AakCggRuAsnur00fUr9M0uCXFhyEoxNl/QJuqqq4/G5NXzBPsWHXBNaydM33irWD9boWgmds/e0nWrxZfxt1DVX7pt44a+TwL/+vxxJ6MEVxVPSY4AOgVZGtXRjuIGfgXbCfw4TCLd3zO1kxTCacH2o5q0o63OSFSlirvFDd6v4XcDn2FpWlwW6m32fcKk82/Mf8/4lIrs1Tev1Bo8AiTP4YbqGUazAqZnIPakF3nHUmjLZ/UF1UwhdUizArWjvGt1FVBEuZctKruzf87sIvSk3YnnhmBBAk5Cv4XyPM02mLG6wUGt8IfuIYr4An7WC6lng8wUVGG4jJBe0PDVW9GQTrdGgEkG3hPH7nrnoSvf9k2GS7Bq1xC//Ke0WvZrKOTMq09W/x2cIEbmUpD5AXz7C1CO0qgIg5n4W+QDAtOfORYfbJeMCsab4uXnvus/kkHSfC9/zC1gnLhx+tVA3OwKri3fnHMEpdb6XWHS7JTaauyVmuKTnjwVN+lxgneaSeUYw/H46tdicDQ2roMxfgZcqHatpZs4Gr6nIin/bxkKV8U06dJXMI8p4TCScU7tU7fa9GNrOwBySfEPclrwLoFLVW3l6mJCyCVr6jQK1AoXGux7Pl28ROIn+QTWySXHX9s8WUeh8HI9QsFpb4OFUmZYAEa2HiBLubM6YggnLfI/AhYChjRkEr+og14IQH/sWcesHEPyPrqPVFWgvBleA2novTKVAFRuIw0+gt/KJPYCPTFzwm0V2UGqfCD826e5JUuwoSGWLJwMPzeK57HyZrAsT6Wxc8Pd4MqIBmweugRrlCvh1qMuHJMyr5oEDBsKngmSlzXoCHOTJzoQwLsSXNDFX0myVnyYujKd086xQ4ngQwORE4ZlPczzxogJyVmDgpROhIeiaN8BLOYbeTJjPXS1iRHHlT747fk0O5Kw43wnrJANgjfEsPpf8XDg0NvalfshjNzfPVtlsw7vg9L0HSXZV72YgBYzKDiyDbQoIerHi0zp9Urut+FyeyzV9shOWAviBo9pCj0u+Qb3xaz7FzqZRgL3R9JDeD2gOFDvR+B602Yix00ldhaKnYBybfjAJXXnFOsRSJPErK5YP6TSzln1nMrKcgXaxrfr4etnuSBX7Pc02CERqr/LG6JYraKA3qPbIdPVfz722NzWfTl3sW9UXVy8oouQu/KYqRh+c15LSNeG6tBY9jK0x+wT+w5RNvBbTi/veOZMMk8lgpnc0jkeJ1ujKm2SlK8A5czbJyXr4TjlCr0PNnk6BD3gLml+ku2fXUv26lDeDvR2/1RhiRkSRDRAYuIR6n84UQ1P2iPyoOlj6AiNyQPQv3jZLurq+JZFM54AaaieOR0wC5B/Koa9EqaPa2dbVoCZjA7IDCV9droyJ64tXHnsXTfnhGG9YiaFPzWUfsbMy2xl8PTm1cjen8oZ6IBT2vlTraywHb5G/6mLCc38JuIdEb2cmCvUOTmJx+yuSk66z9ct0WrUc3C/CvvsarBgYCN/0O+rp/A== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: EFZ9tZrfCxV1Nsca/mQrlXaWeCJbiwD0qbiD0j2JQepVTbJW0rvi4qkkEDxcHvQrqPinQt/czT2laJcAjrKsQzhfk6FpjWu2pOGgUutDBKoRGiGRlkagbNm7JtjmbY80rbeH9uo5XXR8TW9TUKUfU9bo4i6CP1ickqiazjYsmHrJ1GsqbTMTVVkbXj0LVgY3y5Y395zcefYUKCQWUyj65NvH80dijGta/UmwQsSNlHnUoNiLJBlOCwd4PVryYncZSdk/pEwKAoHSHbkX0SCOFaJIfLUtkbgh9DsBFHvUrEaUXMWZNOVFyLWcLwGYFPAN4qcsM/ZQ6+YTxgxAEpOri26AG+TWpjRkPWKmIoIf+7c3/XcvYeRf12L58O98TPCfAlF+rvIHY1eYNFE7FBEFsuJ4Hs6oZpZoG+r4NDq6jMdbO66N6jWKiZj5+ok88R22iOCPgApUWFutfBoA3cMXj5APu7vVGmc0csOlqD8XjeeE/GDTV6tF7WdaT+9f/LpFqucF+9977HZpxcqe0Bsfqx+YYQodD1SNbYBb4NNmcrnwNHHOCedooTVuoN/R5kaTJ2WhvA0Zri6+iFPUtoujGNqGs0R+bOZJTUBquaotL9ZcRQB1nPxqPob7Wd1SopW2G+WtgLKq27n+c0EueAjCSyswkngXBW4LrCUjifXQLGvOMhDu6icNle69bsT+ebTWDUL2hyKBAj71JalLJx92UO7Be6JAFkW3d+Uarh73Qt0Rf2+POmVl37SuNcsX5ibnmv119iUx4AFb5RGdn01WvaQig2XO083GopvZHa/qljP9lOxuKpuQuK79N+71c+nzmELpA4XUu1XeAdtVdYKCdOrL0fNA+fFbPmZeKulMzpYMXa8naaIAJU/+tj6kUR4fghGIabyhnhKtH9R+3/4BW/BxZvw/VDL8YAdA/NuuYegbARBmZQ8rSFm8VKW+iCgo X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 21f98b25-61ff-460a-1927-08db6b85404f X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2023 20:40:25.7432 (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: Byx8VIziLtcaGLxkhXV51lGLldpzDUcRF10yiWivYWusligkl5CcTtLzD1gGCGH3tRbXFjjHCsGwBRDZ3FAX7w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB5868 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-12_16,2023-06-12_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=983 bulkscore=0 mlxscore=0 spamscore=0 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306120176 X-Proofpoint-ORIG-GUID: ZeGkSo8bZNxgKlZvaQXNXL-sJIYC_5hQ X-Proofpoint-GUID: ZeGkSo8bZNxgKlZvaQXNXL-sJIYC_5hQ 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_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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?1768531322636099627?= X-GMAIL-MSGID: =?utf-8?q?1768531322636099627?= Move the definition of vma_iter_clear_gfp() from mmap.c to internal.h so it can be used in the nommu code. This will reduce node preallocations in nommu. Signed-off-by: Liam R. Howlett --- mm/internal.h | 12 ++++++++++++ mm/mmap.c | 12 ------------ mm/nommu.c | 12 ++++-------- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/mm/internal.h b/mm/internal.h index 2691deca9699..d78fd0fafa3b 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1057,6 +1057,18 @@ static inline void vma_iter_clear(struct vma_iterator *vmi, mas_store_prealloc(&vmi->mas, NULL); } +static inline int vma_iter_clear_gfp(struct vma_iterator *vmi, + unsigned long start, unsigned long end, gfp_t gfp) +{ + vmi->mas.index = start; + vmi->mas.last = end - 1; + mas_store_gfp(&vmi->mas, NULL, gfp); + if (unlikely(mas_is_err(&vmi->mas))) + return -ENOMEM; + + return 0; +} + static inline struct vm_area_struct *vma_iter_load(struct vma_iterator *vmi) { return mas_walk(&vmi->mas); diff --git a/mm/mmap.c b/mm/mmap.c index 75b2a86e1faa..22c71dff762b 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -154,18 +154,6 @@ static inline struct vm_area_struct *vma_prev_limit(struct vma_iterator *vmi, return mas_prev(&vmi->mas, min); } -static inline int vma_iter_clear_gfp(struct vma_iterator *vmi, - unsigned long start, unsigned long end, gfp_t gfp) -{ - vmi->mas.index = start; - vmi->mas.last = end - 1; - mas_store_gfp(&vmi->mas, NULL, gfp); - if (unlikely(mas_is_err(&vmi->mas))) - return -ENOMEM; - - return 0; -} - /* * check_brk_limits() - Use platform specific check of range & verify mlock * limits. diff --git a/mm/nommu.c b/mm/nommu.c index f670d9979a26..a764b86b132a 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -1383,17 +1383,13 @@ static int vmi_shrink_vma(struct vma_iterator *vmi, /* adjust the VMA's pointers, which may reposition it in the MM's tree * and list */ - if (vma_iter_prealloc(vmi)) { - pr_warn("Allocation of vma tree for process %d failed\n", - current->pid); - return -ENOMEM; - } - if (from > vma->vm_start) { - vma_iter_clear(vmi, from, vma->vm_end); + if (vma_iter_clear_gfp(vmi, from, vma->vm_end, GFP_KERNEL)) + return -ENOMEM; vma->vm_end = from; } else { - vma_iter_clear(vmi, vma->vm_start, to); + if (vma_iter_clear_gfp(vmi, vma->vm_start, to, GFP_KERNEL)) + return -ENOMEM; vma->vm_start = to; }