Message ID | 20220822150128.1562046-19-Liam.Howlett@oracle.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 36701C28D13 for <linux-mm@archiver.kernel.org>; Mon, 22 Aug 2022 15:04:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C1F426B0075; Mon, 22 Aug 2022 11:04:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BA66F8D0002; Mon, 22 Aug 2022 11:04:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9F8976B007B; Mon, 22 Aug 2022 11:04:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 8FDBE6B0075 for <linux-mm@kvack.org>; Mon, 22 Aug 2022 11:04:31 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 73F00141294 for <linux-mm@kvack.org>; Mon, 22 Aug 2022 15:04:31 +0000 (UTC) X-FDA: 79827549942.05.66E2B64 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf01.hostedemail.com (Postfix) with ESMTP id 7361E40067 for <linux-mm@kvack.org>; Mon, 22 Aug 2022 15:04:30 +0000 (UTC) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27MEirGP017918; Mon, 22 Aug 2022 15:04:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=Ddj2FICrVCtFlnyoGw3HPuEX/F0/JqO/TZfzNPxhAuE=; b=yldH9uWqxOxlDbOy8wPXKPhKm5fXtxvOXihyiBRqMnuSwH416qFvF4WCsFQlQij3F4Kf EeCtuWqky3aD9ySnD29yCQom8MouE17U9Ze6CeS+pHzx5TMiXfR4v8PTThIx2S8/mxOu W3Gqhjh5XZeoKDOws288SA0j0L4Tkn0y+ulj1Y6vJmnAA4Y77xDbIsvLcpaNb1Et4ef4 jPNx3+QWgVqTfCWrIzNr1ZMGA2CQEmruCtUZ5QtTGBqLEZdTRtUKM8DlUHZQT86prZEd zY//lzkKxxQNrnWModNmhvO4kdCLnM4uQhmDY+1DL3MeRYXOT2x8GuNH7PxEj4cIvKB9 bA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3j4bkt03xt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Aug 2022 15:04:29 +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 27ME4NR3035397; Mon, 22 Aug 2022 15:04:28 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2171.outbound.protection.outlook.com [104.47.56.171]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3j3mq1twtv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Aug 2022 15:04:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cz/vfnxK/8qbS31F5sa+xyJSt9U99CUl4Zsug3tnjzi17joUDS26PozIL3d2PaQHBPZ0g1F5cnIM0b5fWCu0Gp8Z8Jbo8G4X58qCQLXO1by74p92vP/a9wZ5fIr2324sc0wNXE9siBmKsdJ5BGl/x+geSnD7M44qTp4rShRvxHsDi+Atl95wTlURzBIC5ViCElwGkCIX295f2lg7syLW0FoLcI4kUPYexr4mfcOdrNxscLU16ON95NV91dGhhC+/qV2Sy4+jfGOUVk1FH7Heg8tGrirJOCTvdaSgAh3P2LqirYitWwq2j71GbPXJt6u1xr/88YclKpZFKT2KKd+aew== 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=Ddj2FICrVCtFlnyoGw3HPuEX/F0/JqO/TZfzNPxhAuE=; b=C7vQwHQHfq7G8m0/ER6GMQvlirDqJ7ptXkpnnpZ+GL3GmVI5bfTuwerCCZqW8cot2e1qcACHIrPyUSBDWXdZXYSGnZC4uTyQfh1nqsy4oE0zK0Wv801AS7RmNg20c/3ugif6VIsco2TBCy9iDm1YZBhbQzS+rSuZ0C1ccq8Us6Nrwmfze46juWKhZirnl60prztiGFVEwlASRW8SzMvS/lzr80LSHpteMZdJFoBhyma94TBVb07v4zGoW/qANSizYIkIhs1AsN0bLR6Pn+hhOKiQe5inqcoEj37zxObsITgG+ZSSlXdKnsIS0sCLARz1TbP71ygPBp01/B7w3lrLvw== 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=Ddj2FICrVCtFlnyoGw3HPuEX/F0/JqO/TZfzNPxhAuE=; b=Ysx7YaOO14EAQpVsQR57zJvm8/6r5MzEztTxk56QGHBQX7fknDlBHyni9nrB6F3IZsLG1I70u9dXgdhtlLKURQYFCCVHLrPILeSiLGzVqM31mZCWM0J4BZULltkl1St64NDtqMnK0hyPP30mGz+LsC6CZXW4smMrCOWO/i+hWy0= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by PH0PR10MB5418.namprd10.prod.outlook.com (2603:10b6:510:e5::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.18; Mon, 22 Aug 2022 15:04:26 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::3d34:ebb5:d9df:98b3]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::3d34:ebb5:d9df:98b3%5]) with mapi id 15.20.5546.023; Mon, 22 Aug 2022 15:04:26 +0000 From: Liam Howlett <liam.howlett@oracle.com> To: "maple-tree@lists.infradead.org" <maple-tree@lists.infradead.org>, "linux-mm@kvack.org" <linux-mm@kvack.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Andrew Morton <akpm@linux-foundation.org> CC: Liam Howlett <liam.howlett@oracle.com>, Liam Howlett <liam.howlett@oracle.com> Subject: [PATCH v13 18/70] mmap: change zeroing of maple tree in __vma_adjust() Thread-Topic: [PATCH v13 18/70] mmap: change zeroing of maple tree in __vma_adjust() Thread-Index: AQHYtjh41TNK0ix2lEu4VB6qiG0EVA== Date: Mon, 22 Aug 2022 15:04:26 +0000 Message-ID: <20220822150128.1562046-19-Liam.Howlett@oracle.com> References: <20220822150128.1562046-1-Liam.Howlett@oracle.com> In-Reply-To: <20220822150128.1562046-1-Liam.Howlett@oracle.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.35.1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2f4a683f-1d0e-4632-2f19-08da844f9b0d x-ms-traffictypediagnostic: PH0PR10MB5418:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: j7GpAUh2WirB7GWVoxtvcTALexJjdFQ+hO8Zkd41sIEoOXsE7LaEcM7OS05wcOfxm4KPh4G7HRBd19tXwl9vGaAZl+eoTqNj171F7ndy5Ac6gCJRgHap/ObWhGcmx5cbrVikQFSHWVdbsUcUW+FJN2OqX5PWftddx9YOClEpzBnHO3Iq74H41NKuUarG4HPsOGDt/dygIY9wQptB3C7wbHH6R3GAAI20YO/oiJNH4Wy86AaPeAUyjPOTcl57Fp54acPq0SaHZ+j+4rFR8B2lpm0uZfD/mlDx4mII78VQ+jXKNXydefEHzWmFmT0IK7FWwx5zS6ig+N1SbDsfYr3Wmfg6n4eEJKPZPmJiKt0HdOL+v1hK2wKmaFA7YqSrh5IPVDjaTK8rwBPRx4XiM1a6Vi09DILe1pJcv25fBYVv4GZ74v4SVuNclKGy+nSBLI6puZWXh10MqK1j2G5zxGassQYKpXCdgTma/4hDVJcpzvjgWZtuH6eQ60UQ1T9VbRvVokZRbRPbV/NtpjDmTsELAUK0mQWzbqIcg5rSy3eLwjPnxLczgtF+6CpML1AzFVqXI7mMZ8MGMvufRzv0bQnF3nglxXisEAH9BYDKvEa+AhKH/D0xWOhsT9ANbARBrDqFq9odZR6sJS0rVwOIGB98xRI44M3pCZs8RWEtgj6v9xeMqG7SqtB/13Z9axMHbndyxWfo131fSElbR2LWlr9SZA9WnYZ12AX6BKD7iAUdONB6Q6U0N0NLYGypfJdOQFqNnF6xMmGCq9b9SM8bqeM/xA== 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:(13230016)(39860400002)(396003)(376002)(136003)(346002)(366004)(83380400001)(6506007)(6512007)(2616005)(26005)(2906002)(1076003)(186003)(38070700005)(86362001)(8676002)(38100700002)(122000001)(6486002)(76116006)(66946007)(41300700001)(44832011)(5660300002)(316002)(478600001)(36756003)(54906003)(110136005)(64756008)(66476007)(107886003)(66556008)(66446008)(8936002)(4326008)(71200400001)(91956017);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?yuFVPa/J1C/qekgEFNzZN0Q?= =?iso-8859-1?q?fUzWOkZmw181pjRzZKOqQ51R55enzabY0eqkqRYPazxzcRblb4KPa8i8yaL8?= =?iso-8859-1?q?PMZaMJbo/7g4UXaUsEFTtaZk7GtAWBFXBF/DSxQs3a+FL3DFR2ntbX/h/mPY?= =?iso-8859-1?q?w7XO4VORhpcq5vHOcm9fvaZsBZ3S4TYm1ybBDl4qeUHYxvTZsX8spBWGC91A?= =?iso-8859-1?q?AQ9QhMK05k290b7YxavUev/I2H5ObhHZ1go7SL3/7uCSb/ADJpj365lwqIm8?= =?iso-8859-1?q?NS+fVsRg1fP8mXHQIYDpDElya5X897f/4ZGJfp7nEgGZg15MotoB/G+rUhgV?= =?iso-8859-1?q?UEruyyR7kXoDF2VcFYYy26Sq4EUuLvEW+2InPceKfDtEjuGVKo6gVPuQKkWd?= =?iso-8859-1?q?3h5gomS2NO/S2Go2BnTpvGVJvOlZji7wTOhNePhiXW0ROtTDyL/eYVNx8Rcl?= =?iso-8859-1?q?4jdMqtGtdeeDDaqr3jBonnyVcpWgrygUSalT5QIYXsumaQm18NDv/1ZJhEBO?= =?iso-8859-1?q?y+7h1y86J+zIddVXhjGBi8JEIp7RkFrwsphN/AKOtohx6/moYv/cMrrFclYf?= =?iso-8859-1?q?vXfRcNMeLss7/bEup8ONZrZavx6GNYxyOtDqnjtiSE52/fjOiBh8Q/e7HEGM?= =?iso-8859-1?q?ncxoTeAhBQRGhhZS+qlOckfQeASIqZ4G4CSQM0W3WF8X/q45ss5KJL5Bbu8c?= =?iso-8859-1?q?Sib+jgTFw9s+RXzTCzNMGtRFJ0MAE7uzSzWyNqTQeEDcSWMpyA8hangFmjPE?= =?iso-8859-1?q?zzBLcVF4hGoQuigLRY2RG4OuRN+fR4BCZJ+sNt3Xd3NsCAuBGz8G0QZOj0fY?= =?iso-8859-1?q?UV/8m1DY8fMR1IGAu6JJjx/6WAOOLW4Rbrg93BUVgV8BXCNlrPaqpaTcAJM5?= =?iso-8859-1?q?ZMmW7JZOj2jnvyrb3KIKl/UifOx6ZSSX5VPf3MT8IM1mhO9E+k3JQf+ZS43j?= =?iso-8859-1?q?q513f+FEKWUroOur1QX2i254tXQeGAfK0Ixodcg42WzvIzwP+tJFyss5aphm?= =?iso-8859-1?q?JS0i6ciiIeNoEgw7yVsgGG+cqOf53tG61dNY5KEm9NftwEcwGhPNHrodSM/A?= =?iso-8859-1?q?359F40d/qnhs/A+RbiqS5gUiXLgdlkrpjiXM1A4tQP7XiHDn1JLeWJTX02e4?= =?iso-8859-1?q?QapddppdUD9p0I8vm+SjlvAX6T/siSK7kkTLJRNJeCsj6tMgpTl/9jpmh8u8?= =?iso-8859-1?q?YpEb/18TKFvPeBdGWqCveXZYW3OjRaBUtKzcg1UOSZKU/0pOX0LGQGqzO9cM?= =?iso-8859-1?q?bjhNrhmmYZNqUqVJJNVFn3/Lux8bvuM5noUS/ZgZJUbultRsTcZ/0XGv7ipS?= =?iso-8859-1?q?5w6D4D29R7/z7gFGGaUvkEZIwoGUKs6f7WpQ0E7kIvEEhhOyMNiKD58TzkG0?= =?iso-8859-1?q?TIj+ru2fNV4PPIx85n2frtRdu4hH7HI6gAFl7efmZ5EZ8/I98VNJqlUob8wU?= =?iso-8859-1?q?2534Tx0YAhx33ppUDF5kgswNVefoedFKt7bGtuoNtlw+xYLJwSpSkT7avxZJ?= =?iso-8859-1?q?1FyUhkvSDkbiJ86kzPVUFT4PaNMVbh46rfht3H7erj8veDdDxWsKGdH3lL2W?= =?iso-8859-1?q?V+F+rPy7rBpR7goW0bEvxi91LvlFTF6no1drIJppoO3YalVl0A2XWb3LFBGN?= =?iso-8859-1?q?gt6uKPcuWok4X4XV9G7sM2agGrvO2BqdYSpmrew=3D=3D?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2f4a683f-1d0e-4632-2f19-08da844f9b0d X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Aug 2022 15:04:26.4336 (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: 8bgboN8/eJ2zWMTXKZXF+UdFnbTqYGO8pv53put8d1WK+/t3fuk8ziLP3dV25w1tsF3fJOrgMVoX6G20jvF7QA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5418 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-22_09,2022-08-22_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 adultscore=0 bulkscore=0 mlxlogscore=999 spamscore=0 phishscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208220064 X-Proofpoint-ORIG-GUID: fw2joZYXYqhmmUwRpFxecb1L3bbwpsgR X-Proofpoint-GUID: fw2joZYXYqhmmUwRpFxecb1L3bbwpsgR ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1661180670; a=rsa-sha256; cv=pass; b=7ox4ytwzgGduve8HJagPmGvFleNTAKn6VPj8oM28uj1F+lqP9InvamRB6yVvxvI+EtM9UD wMxHbeoUa5JIYjOn88QFC8JPWzDXYrNvNVAU7geO04Us338fxoYJi6qbuPoiFTdT03hiA9 cx6QH2vDkOV/JhPDr9UTNC0vFW39F2U= ARC-Authentication-Results: i=2; imf01.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=yldH9uWq; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Ysx7YaOO; spf=pass (imf01.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661180670; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Ddj2FICrVCtFlnyoGw3HPuEX/F0/JqO/TZfzNPxhAuE=; b=P9pBEx7JrAtb5v8QDvuQSc+iJylZ+5ZAL+3bf+5oq31ctjRa3cgAtWkOIVChiUlU4To3S7 gmOroyl5/aQkMUk87ANiv/NtAay9FAdjkMxii+GRB5j0HBBkJeJHZ7uEEyEffecYxrEq78 QHOe+yfTtfNWIE5NnKdGWDlFXLQ4BD4= X-Rspamd-Queue-Id: 7361E40067 X-Rspam-User: Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=yldH9uWq; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Ysx7YaOO; spf=pass (imf01.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") X-Rspamd-Server: rspam01 X-Stat-Signature: 7eci1cs7njihf7kzq5qetijzx4gjiy8m X-HE-Tag: 1661180670-217657 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: <linux-mm.kvack.org> |
Series |
Introducing the Maple Tree
|
expand
|
diff --git a/mm/mmap.c b/mm/mmap.c index f60d83c7f233..52a774e70e5b 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -567,11 +567,11 @@ static int vma_link(struct mm_struct *mm, struct vm_area_struct *vma, * mm's list and the mm tree. It has already been inserted into the interval tree. */ static void __insert_vm_struct(struct mm_struct *mm, struct ma_state *mas, - struct vm_area_struct *vma) + struct vm_area_struct *vma, unsigned long location) { struct vm_area_struct *prev; - mas_set(mas, vma->vm_start); + mas_set(mas, location); prev = mas_prev(mas, 0); vma_mas_store(vma, mas); __vma_link_list(mm, vma, prev); @@ -601,6 +601,7 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start, int remove_next = 0; MA_STATE(mas, &mm->mm_mt, 0, 0); struct vm_area_struct *exporter = NULL, *importer = NULL; + unsigned long ll_prev = vma->vm_start; /* linked list prev. */ if (next && !insert) { if (end >= next->vm_end) { @@ -728,15 +729,27 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start, } if (start != vma->vm_start) { - if (vma->vm_start < start) + if ((vma->vm_start < start) && + (!insert || (insert->vm_end != start))) { vma_mas_szero(&mas, vma->vm_start, start); - vma_changed = true; + VM_WARN_ON(insert && insert->vm_start > vma->vm_start); + } else { + vma_changed = true; + } vma->vm_start = start; } if (end != vma->vm_end) { - if (vma->vm_end > end) - vma_mas_szero(&mas, end, vma->vm_end); - vma_changed = true; + if (vma->vm_end > end) { + if (!insert || (insert->vm_start != end)) { + vma_mas_szero(&mas, end, vma->vm_end); + VM_WARN_ON(insert && + insert->vm_end < vma->vm_end); + } else if (insert->vm_start == end) { + ll_prev = vma->vm_end; + } + } else { + vma_changed = true; + } vma->vm_end = end; if (!next) mm->highest_vm_end = vm_end_gap(vma); @@ -783,7 +796,7 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start, * us to insert it before dropping the locks * (it may either follow vma or precede it). */ - __insert_vm_struct(mm, &mas, insert); + __insert_vm_struct(mm, &mas, insert, ll_prev); } if (anon_vma) { @@ -870,6 +883,7 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start, if (insert && file) uprobe_mmap(insert); + mas_destroy(&mas); validate_mm(mm); return 0; }