From patchwork Mon Jun 12 20:39:44 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: 106823 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp124277vqr; Mon, 12 Jun 2023 13:47:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4vpRT2kYq04VGYLfCTkLc+OezxaOddDHuojQJLFIKxdoC1VNKeILF9DgeSU80DQ0RKulQy X-Received: by 2002:a17:907:7f94:b0:973:fe33:3622 with SMTP id qk20-20020a1709077f9400b00973fe333622mr11506235ejc.29.1686602879332; Mon, 12 Jun 2023 13:47:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686602879; cv=pass; d=google.com; s=arc-20160816; b=SU1xKn9nZ0clfyF07G4fqGVqr+CcTgcwBhE7b9bkljQgC94vIjOJ5CZ34w7hNKI5EZ OLjF1Juwr+HLzKzovJv0VL/v5lbS+FxAwkcxLvSSDkV0KVEesZoZMuWoAc/qL50MhQm4 ZhEuR7KpbKakBtS6/JCiaqKogKuzR2qv16XTziBlNAANaSbbyB2b0WB4lrjHxhwbDUy3 Fkpo9PMNsPwl2Vl2g3vuLzrfRTUs7iBM+GLxIcpc0lczwbjF9iCvxrgqSGghQRJpS7QA j3EaaVP7sxZesWuWFEcdCSmj99X7vMGZAsse81t1Zx0Aj3e3ZIGf/4rh0o2umdYaJhVq 0Esw== 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=0QsGUeSC8PoHDvjhcOgTqj5kZeGqMxkW78nbUd0JW7g=; b=P/46tdOJbCjPC7nP9In89Kq3vM3aMzeK5jp/t298lHl3MvzIwyFOQLmXr7ksH/IqUT XGjiV8NWAi5mNGxD/HJ6dQiPbXLSl0ohsiWDL+zz5ZJxOItv6u5lPvMqDPhS+fYUHQgc rit29BXXz4DwAl6DrKu/1sgjzvEhLrj4vUAN2WCH2lSqVcKtEwF/4+E8lTz+eoe7HTWP FUdoTNhYcgApJn9RoaoqSwUAvgR4Zp4PDKhvmvlIqFXwi+KJl1nwUPYZnLbXurjbLiAw 4mlKffVEgcc3XW9YBXyqQnvm1TFyLGvJh+wt2N9hAS6ZFx6B5A6pm092YYhrhZZWAAfG FO3w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=yFkLpVjm; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=sTWDow2C; 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 d26-20020a50fe9a000000b0050dbd30820bsi6649414edt.231.2023.06.12.13.47.35; Mon, 12 Jun 2023 13:47:59 -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=yFkLpVjm; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=sTWDow2C; 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 S232569AbjFLUlV (ORCPT + 99 others); Mon, 12 Jun 2023 16:41:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233070AbjFLUkp (ORCPT ); Mon, 12 Jun 2023 16:40:45 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36A38E54 for ; Mon, 12 Jun 2023 13:40:41 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35CKOQtT003957; Mon, 12 Jun 2023 20:40:20 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=0QsGUeSC8PoHDvjhcOgTqj5kZeGqMxkW78nbUd0JW7g=; b=yFkLpVjmpeFyAtGtFkwT1a9KXx87493sNzLCV4Sd1ewYYqNofgtBozTilp6fBszf/0C7 mOKC6BupJpB2VXmJ9rpyDB+tTrpbBQxk/74hCawJKxFpGEErqD729Tb/7Z2O8nN9WifW uU9VXK9hFcjwN27aLrtEHo0GlWC8elMUZg+lwTBzdLslmNNxhqimmXADxpldhbnwh70R 70oMJ3oYV1DMZdylZBzn7WEFeIEIV4ZpIewZ6xposdUa7S4lHOSlZV76yx82+joVWv3H x4sfVXZygcksa5Br5LK/MiyCvtpJrCF/bQNUpgyrqntgl2xLyfDEqkG+UkT0S4H/ihZf 8A== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3r4fs1uxa7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 12 Jun 2023 20:40:20 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 35CKZPxi008941; Mon, 12 Jun 2023 20:40:19 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2045.outbound.protection.outlook.com [104.47.51.45]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3r4fm3hf7y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 12 Jun 2023 20:40:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O0P7E79rwmAdL1sZFZb8mW0RxW9udSDv+LV5gy0KBo+yxqAXxwaiYgKFSm29fDVYTI6J3O0qHGQMmofTmy3ZJOQEnSEmZRk7hxfV1YbShXxIhffI40ygy45nOe5uiLagO/9ANsWwKYnlOGucd08UOggxa0cERtK4+y9/IfRiKWYOVxpke5PxznPPGRogVHuKmZ0f+mEJyPUsA5L8SW3FvadXflYW0VnKXhkCca5BDeVOmn6p+mkChQv0eAiQs9wI1X7GdPiawWgIqy1iuJZ0aRkr+NKpVdxFrxJJKuKBM/FJtysFnSTMFy4UjWU2mNLhGdBGB2Bn+oRjqWO5yGRH2g== 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=0QsGUeSC8PoHDvjhcOgTqj5kZeGqMxkW78nbUd0JW7g=; b=PN6BRqk0UhU6E9tRic7PKGgvfZCcP0zIsVR64OvftBf+qiQUDSWMV3X+bdBYto9+xYmapPG9SpvPFlo7M69ERoOCRBAV9AiVRMV5vPxRFPKCM1cbR9TwhZSTxUH4Pqa8T1MsygHH5rwQfp0JAGLKwZYG0lPgh4V6pCcecjfou8o9ma5uhsRkoLUQrP/yTAk12X6q4aSyZ+oHKF4OBO5XMuPxCJXaexrd9Ngu50aebUpThj2wQskrAkXlgThf5cJ5jNf82ma/MbEDci0t29wPMtFdj8L1HDYsLKBThDnamUUV7BuaZb5E9JNzNdC7t6UquwzwhAwK9bX2ZIAFIpxDOA== 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=0QsGUeSC8PoHDvjhcOgTqj5kZeGqMxkW78nbUd0JW7g=; b=sTWDow2CVvoldR7CJo3/r8Pe9cCoaEzx1VfEJ6wfzdwEaeYTOoLUNHRQ8+2LZo/s2lxRg6JHui8MXDKqArNoBtTIAjnGQzhpA3a08wl5KFbwbqSY/6HSdsOTLQ4sX37F2soYmZlClXZo5eW7ghgA+DR6TQ4slrqWoH9a6vWa57o= 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:17 +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:17 +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 07/16] mm: Remove re-walk from mmap_region() Date: Mon, 12 Jun 2023 16:39:44 -0400 Message-Id: <20230612203953.2093911-8-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: YT4PR01CA0123.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d5::26) 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: bb06d531-bedc-453e-e26f-08db6b853b2f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NdU7jP74WRqKJNTDI59tzfberdQwwUYcA2ismbAoht3v0sOOtrTK/Dq4HsLSaTeK44b73gj/sekCTlInkW1G26nY4LK8o8QD9oCMprcWqXF5ydZLTGq4u4yrsIJHcftUhOA5HYdhx/A2pgtyHVE93NXUr2YuzAaOV/ZVci7VmYS68zZ1/AjE2uLNsoTxWHTIX7DpUhPUH7PsGzqlhHIG4NqF3CkpepI/Nd54pOK5AMzv7CHFD7r4VgnlS+7o4pBTyq54KC51+QsxbjoRKf5lVGhlqMN9ZL2QQmH5dim+ZYaimpQ9nWYzbF1j9kI6V2KTkIlCnOCPaurXA+O2pAMeEB2kixJ+jSCROwAh9imVovoH0BYqdZ2d2zQy8CRLtRDie8dHTFTWvRrFxHh+R24+BE0p3gps/wq8YekCx3GVUIGUzI+Whiok5DDdxpQ6Ia/0W17iZrP/kn3O4dNANlCAaZgMvqdvrdcvBmSLjIjaAKRK80CRghj8jHZmKtyUbNPC2iDJpXfn2xkqkMtK5qj6Pg0NoOFc9kAlCz2PUkY+nTZ5uZUluULUZrl/2zLsluOZ 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: UzikNdRC7YheZf+k+2UjbzIkGxwrU6xmUAb+lxhuJLF97p6W416NA3Dm1RF3z7LuBjIdiAPNj/PilO57uJV448NYQQp6CIA/98IiTkElg63ur+d5pL21oq7BXJ3aMTlyx5eImx55cVLwGPHwlGwUxfv4xRPaqd5Q5BQm/25HhBw+UdwLOgWD0wTvpBZAJd152aMjnC6qp1/pSAX4g50o5rBfHghuSAP4eYWmxAu46eg3eVjQlhncXNFXCA4UL8OpSbkuNcZMtb8GoWTZ6uU+RtDz1NQf0FGYjmLiLhVQrZW1hlM7u9vaW3Ud+X1PdcnmBIRLFHEGNLO09ky+4SHBM6EZBf753GSbxB7FWrpOEf6cKnFUVU5QS3ANE0oKlZ4MtnqPrtKrLYpIYUcaycqrSc3dpF/2Ehf04HFthZ64seYvUPeyMJ6GNCz4/Ih3Ct+AowVwzq5A41CNI1Cp6/hphCZqQoZUcT3TDaF6a3IMabMoJn15njmnp7MczC/mr35PUWUkPCKCjtoDjRqnRTa8m21gFdnBoeHt7p9X2jDX2+CEr63Bf/aYiC7A9xlCFeBmKbjGh2d6sjs6dtrhqGyZOpY6aRlt3ZKrN0kAeG25iZ8HNgXcJm4UJ9E+5rzxoWDtUbuyheAhF0bfw3cYOaRx3UBeK052ixYBuvN2Kfsi5b+bMtY9diIZCZoDn6ml1CTwdZRtrgGqmfk02kurmENvh/kmFkQKJI/VUQ2gnSdJBboSSet3dzeU3Cw8Uz5Ic6nvuMjyIc4V0rTP4uBWF8KudOstfqYtQyyEYxevY4XxV6mBHREtnVS13AKzx99CiHYJdTKsA1ecFd4zHvXHmCcDZS5YF5fcXRjMefgqrH59sAPgbPQrR09VEbkeOXwMyWxzudoqlyCwEcBP/kJJiz/VYSNPHXSnKK8IzvL+csXFRnphwbRK+lJYIIzwyCpEiaBfo7pGj5y+1Gn+KLX/+1JDlgREaHELsIViQAXRRz2V0eTVmBLP25g028BF3F11RH5v/U0POY2heVzYB8tGfElfyAk3WRsfLV3jfDY0jZCJpBZ5A5/xK6WrCtZvwJnuSckcaaNA+2oCEHx6W3wEeUODnCENERWMEmNU2ETQA7rHIxtMtrgXWbirl9oGd3yrgp+XJdZQcLFIXdVviMwSDJpqsFMhYDSfx4Byi5Lq3TPjq/bQh4EUnSlGNclvDmbq6LzjSXe6+IjNmPHBazhdXbb+4rr76IShT07avpsgPoYTJQxkhi1PwC4swIS76T+rOqI4/igikKG2jKJ4IhYPijBJ+rB/bc5qpgckcrpR5R1iPaDn4HeCyMEYZ8d/+2JkYPh/8Hij+GOOn94GbfXMlSAXCDt729Fevs6Cpz4byB6SBP0MzkV/7QaevzBYt0/kBQBAD76A+KEhlk41N8BgCMdjWvnU0mism1ycgl0HOqhZpZZGnNEUeonazrDJTwh03UAWuZXlXxDwBYF9fPov37cUuPM2XbePErSBWXi7vnUZtKwqpaLC1zwRr6Vd7EctWhs5goU8uA73XCEgWW6VukIsr8uM+ftjLwdyCwuasnKgUOw15a2yCo2uSbme7r2wESg6nTVfmWa+9rlgMmNeni3d4w== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: h5DJsf9aOA2PLYoDopwjdOtKiZleyNCrQSxJxUFHk5Mnr8HJ+jzERkjY2c3B/eK0Wxbo6KegZ5Afm37lafPd5jZXHOHDFHZXY2Rg/kgOmWbd2xmFjN6CepoEQ+Ix+tT7SUEw8jG/aYbwmjQVwJ+EnsyhxGFs1iyEWblhqWggAtGw86XJoBA98n5OKrRfdnk7r/pTSEEgkzcSxfFM3l6J4y20swROzwV+iZ6mdoyOJAEeoXPQ3VzYfwIXus0g3PZTMsXiRRCaZEjmDWovbx95yoKbtujTBk/mjyyiVNFnt9Gjz5/UpJyMSUnKwMUHhInaXnaSv9BZlYQe35UV+eJ5jfAuLWImaGeYTJ7Dpaqt4ig0qeNL4pnEfNOctQ3yUOy7s1eKjs2gEjKVqHZCzHmTONbSx3X2a9PyYIUEh5U5HR1+aMJ6uT9sn76WSaiG8WKZTMCTp5rpahtfNld3J0rBsUFSkslmIUHH9DKE64CNINns+JkAKqQf4Gy9byjuRe/LPRRR85aww8EnUhvv+GES8Kioi/uZUlqBqEitaAofhXuUtTosT0eA0p0tzQyuCT+0wCCACy1YI/QUzBzKUTZcnq6Wjz/PmEFjMDzpC7088r7qyJsedukv4Sc/xk/kcgOaw91VRP10XsNeX430HFkKneGoj626Ggjzn2RJnEYknWb8Tu9M7OChcWQTfWiYEp33uFcneQGDm//hYm3K4TooOG6O6oR4whsz7+j2JuqTW449wRQN4RjCr5q/Q8vvLZm5Sunc8ayOmqbjvgeBUsLvVMJc8XQwqXth1ak9TlmPjNjuS55T2nFPfiakwxLAqH0eM0MfzzxfRzO8QoBbF3wPc7Vk2Cs/Frw87vvClqYpMmFT+zY4X9TUwPvYeSbTJtcFE42mngPRuGWU9hcI85yTg116OE893fkF+ZMQP+IGrGGlKgvUWfc3WO+H/UEJg4Nq X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: bb06d531-bedc-453e-e26f-08db6b853b2f 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:17.2080 (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: eo81gt8tJY7HTMPVL2K5LAN8kacb7MZYcGxB1v1q6bREAM0xsiEOfIPmfP3fGZv1OVdh1w51bP7M2cBWNcxkAg== 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 spamscore=0 bulkscore=0 phishscore=0 mlxscore=0 suspectscore=0 malwarescore=0 mlxlogscore=760 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306120176 X-Proofpoint-GUID: _VED76G80_mQbMfxLkOmBxo76DP78tXA X-Proofpoint-ORIG-GUID: _VED76G80_mQbMfxLkOmBxo76DP78tXA 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?1768531300706103834?= X-GMAIL-MSGID: =?utf-8?q?1768531300706103834?= Using vma_iter_set() will reset the tree and cause a re-walk. Use vmi_iter_config() to set the write to a sub-set of the range. Change the file case to also use vmi_iter_config() so that the end is correctly set. Signed-off-by: Liam R. Howlett --- mm/internal.h | 8 ++++++++ mm/mmap.c | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/mm/internal.h b/mm/internal.h index 24437f11d3c2..cdf06f680d6e 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1034,6 +1034,14 @@ static inline bool vma_soft_dirty_enabled(struct vm_area_struct *vma) return !(vma->vm_flags & VM_SOFTDIRTY); } +static inline void vma_iter_config(struct vma_iterator *vmi, + unsigned long index, unsigned long last) +{ + MAS_BUG_ON(&vmi->mas, vmi->mas.node != MAS_START && + (vmi->mas.index > index || vmi->mas.last < index)); + __mas_set_range(&vmi->mas, index, last - 1); +} + /* * VMA Iterator functions shared between nommu and mmap */ diff --git a/mm/mmap.c b/mm/mmap.c index fd3f505b40cc..8b3e58d6ac40 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2659,7 +2659,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr, goto unacct_error; } - vma_iter_set(&vmi, addr); + vma_iter_config(&vmi, addr, end); vma->vm_start = addr; vma->vm_end = end; vm_flags_init(vma, vm_flags); @@ -2686,7 +2686,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr, if (WARN_ON((addr != vma->vm_start))) goto close_and_free_vma; - vma_iter_set(&vmi, addr); + vma_iter_config(&vmi, addr, end); /* * If vm_flags changed after call_mmap(), we should try merge * vma again as we may succeed this time.