From patchwork Tue Oct 22 20:40:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Stoakes X-Patchwork-Id: 13846154 Return-Path: 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 85393CDD0F4 for ; Tue, 22 Oct 2024 20:41:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0E4006B00B6; Tue, 22 Oct 2024 16:41:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 01CCA6B00B7; Tue, 22 Oct 2024 16:41:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D3D446B00B8; Tue, 22 Oct 2024 16:41:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id AF9CC6B00B6 for ; Tue, 22 Oct 2024 16:41:42 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 7F29D1A0490 for ; Tue, 22 Oct 2024 20:41:12 +0000 (UTC) X-FDA: 82702408782.22.296D2CA Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf25.hostedemail.com (Postfix) with ESMTP id 8A315A0024 for ; Tue, 22 Oct 2024 20:41:27 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=RRkHlGTE; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=K1gq3NQS; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (imf25.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=lorenzo.stoakes@oracle.com; dmarc=pass (policy=reject) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729629549; 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=/O91e0wD9LofGQVbbD9R68Czyy5IEr6OFCxJlloVhbE=; b=OIb8BrUFxcv9lDMOT3CAJgXCHuTi7otMkSLK/uYn+vd7YzTpbBXvkSVsi6UP5k2SvFdczT yJvj3QRCKIZScYjOB4cAJ36bbpYx8ZAE6bWDSd8/f5/k3p1FqgZI3M350kvPEv1jkkHZ97 cDQTVqx7WY11cxYysGXSEG0EFdaRFy4= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1729629549; a=rsa-sha256; cv=pass; b=3bqmtGlOKStofsh4zz9MniKiJiOEu4cAcTOgvSVB3o3B6ZOkDxW0NFBd0/cf/VELkkEVXS xFG9CsUSdBR+nQ06rDqfguZ5+DaI2J/lzTsgWYzCD1lACc/YTDpm9Dg3W3aqERAp3Qe1y2 fTNAU+nctmzBtawjwZ/rHj9u23Om2PE= ARC-Authentication-Results: i=2; imf25.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=RRkHlGTE; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=K1gq3NQS; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (imf25.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=lorenzo.stoakes@oracle.com; dmarc=pass (policy=reject) header.from=oracle.com Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49MK3a9U013287; Tue, 22 Oct 2024 20:41:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=/O91e0wD9LofGQVbbD9R68Czyy5IEr6OFCxJlloVhbE=; b= RRkHlGTEceW9skLKTCkH2+KhyGz6ZTg8oXFYJUsyjsUyu5wSeGkZd9wJnP9D1gEK T5c8Nc1/Dl6N6pNdEHPuQWLwJ2ruLQrWrRiwu3Ckjpkg1AgoAgV0myqOe/AyJOap XOmoE3AlhnI3kSjmSEDFNxO7s9Jajt1gBC2por4QgDbkMmdH2gEFtL4UivN4C/ZM sPXE26FS7CpwU0bL+spQUkbrz68JigCLh1omuECLrIyd9hReXQyXg94sGGO1mFJ9 ZzriUxGqRaMutWCP8g542X4xi3lHr2VAWGugqtqolNPtgNMRYM8EDS7ZIU9OGAZ9 u/8HAMM+cqwwbwepyl+QCA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42cqv3dsvt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 22 Oct 2024 20:41:37 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 49MKXDcN019706; Tue, 22 Oct 2024 20:41:36 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 42c37ef3v5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 22 Oct 2024 20:41:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=H/DpYTFyLyVZWco+dKmJRNaMlTFPjjd9WJ43j2mVvHP0zO+Gqf5H3b/T2ujrqcCQcFsNdJw2tyUynSrb7TcCb1eyLgYjgL1FflC4X5BlJuktBOvDJ2oDQaDcb2R+IdMTxcoUAWVy7AQhto1gm7W6o9pwIHI+A4NxdUPG7HwjR+QvinuccyyTNhefiD0UUnt0+ftNtckxTCT4pDUfDC8fJP5nuA994KOPSicAfZFQ1j3LsDkfvvYx/iVmlFKtwdgOYp8HgV1GKZJNuiAIg9QjJnQ+sosCxwSqMiRkR/7E9QUhITEXUBrS0TEcZmlH7U//JOGrPGVqilcQtSGjwBflmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=/O91e0wD9LofGQVbbD9R68Czyy5IEr6OFCxJlloVhbE=; b=uTPvxf+m3yYwoBV6gOb1K/PFFlQO6uQca/NHHF9gprsrS2Zo7JMqfrn/9OPSeoqqoYg5xpwaw3ol5qEiqEMN4xrDxbHZoYQOQ00jhC8tnbkxc9nbE6xYMxCdJZkD4VzsqhRatycsvP6ovTeHPPch8ZZqFJQriQwrPDuU+yFqII9dKve/1+xAR3gmYLxwgT19h1USZVBdz2qv+wc2v42FhCTbCHTYBG4fYiHwrn1kU6D/qXytfR9zxUQYe8J8QrnSHROpJxJdJb96cGvJzky/Tv3Da7hhqB4YQVJTOIdfm1du/sOZoRU2Coa5uoEGfyZZEcn+/HtYXO7jmV8rSIJPDw== 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=/O91e0wD9LofGQVbbD9R68Czyy5IEr6OFCxJlloVhbE=; b=K1gq3NQS37Q0/SLRmmZlxIHc8dLbnsVMu96/8g5E7y/FEBtqGh3rU4c349Xk702+uD0RpZ/Fc3DuDS4fpP0XHoI4jxnrt8iXnRtxLDpcXckpsQxe70sxXOlYCSbSQsR4i9w3wHFlTSkdH5mIktFH7CzEiLPazW0yGkAnnRinIC8= Received: from BYAPR10MB3366.namprd10.prod.outlook.com (2603:10b6:a03:14f::25) by CH0PR10MB7437.namprd10.prod.outlook.com (2603:10b6:610:193::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28; Tue, 22 Oct 2024 20:41:33 +0000 Received: from BYAPR10MB3366.namprd10.prod.outlook.com ([fe80::baf2:dff1:d471:1c9]) by BYAPR10MB3366.namprd10.prod.outlook.com ([fe80::baf2:dff1:d471:1c9%6]) with mapi id 15.20.8069.024; Tue, 22 Oct 2024 20:41:33 +0000 From: Lorenzo Stoakes To: Andrew Morton Cc: "Liam R . Howlett" , Vlastimil Babka , Jann Horn , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Linus Torvalds , Peter Xu Subject: [PATCH hotfix 6.12 8/8] mm: do not attempt second merge for file-backed VMAs Date: Tue, 22 Oct 2024 21:40:59 +0100 Message-ID: <7b6bf6165080505feb5e00b313d2c84c25015e45.1729628198.git.lorenzo.stoakes@oracle.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: References: X-ClientProxiedBy: LO2P265CA0215.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9e::35) To BYAPR10MB3366.namprd10.prod.outlook.com (2603:10b6:a03:14f::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR10MB3366:EE_|CH0PR10MB7437:EE_ X-MS-Office365-Filtering-Correlation-Id: 086c1ccf-e4b1-4bcd-c404-08dcf2d9ea93 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: 30ShBGC92MNAhvuyHDLZxFLexKIGbtrpUkBdjOeyRiSJORiu7KiSdYbkW2Mj26b5EWDgdkdaCSWyxJSDBXgB6fI9v8MVmWzaZk2C4Ag8C/hQva+rn9/atLHeyA+gKwArDtzMy5cNLt++5+ZMNKaqq2hk37z4j88PRwecMtj956KBDF3dNxZtBBYPXbijvmbT9Xk/uwrtZl484BT1pl0eajRc7AJNxn4wWDKUPWUwMkWUw4wZIulpdCWHcjBoU4CI89rn7CJIhPfJnlP8FidIle9k+Z+D0q2lDR73NHkLF9qme1qXqVCA/t35CpYRWi+myt83Df2U7kuEf0JqKg3fhYyYvotkN7zfPudb6U+IAq6peMmQZpRp5YukZqvSYNoaMJjjBN2cIUDaoI5f6KqJZ0eVo2WuyxMd0Hry5uuKJ6r8RnXwbHauv6reNDLwCgdFCc9Fkct+YHQlid6a4PrNDqJUVviTBxHHvztYv7XRWVc3YUjDjtVJNL+9ogiIZcDXY+sGzRtQKzHTEvNmk9VZSp3ikKlzynGY4SsDhWWMVuS2DN6Sy3f+WC2uOeCf3IkGqoyThYeOcBAVW3N/cOf1dr+A1+1EMr6BY1WqHOjwQ4GfrV34BvumEEUm2xYoXDIbBPidXBL9XhUkInKo3Ax9sree69QWlzIoV+n/oA/tHufWoeD8U/Ztl/HbMZC72PM6c2x4fJaZ98sqbq+WLnPdy28IDkIsN4qDnMBmiL84ddbPJVkGJgg7+Nz1Bfv7A1mg0zeQuFQr/vz5GZr9Qdwr/4ORheAOV2XtTjNVUPFEUQBMW9FumyDTK7A23W7y8oIRM65eVIoCJRGuJ0fW4/UsAREdfPBgi/IBGb44zT/ZalT1dbExJCjhRx9ogiU1estY50X9dUDBmBvmNXq8HbJBty7yprwFXVS1AamtXJwHElrmCoHd0yRgDF66AB/18TisM3kJ6FvbX0ruv8diGagl2jC26v6C4RmxcyGemT9OZ4cjrDbHJ0zqkq6PWKUq90Hxyy5hSLxhCF00Ly5i2dR/IDXcHiSNikYUws/i2KMZXsAWmpiCILp6j0g2mM5DWxBRT1Un1OWlDB7ABARRQdeCx8Gao+gXbszCFDtHdG9+n7sjkEnvs8zlbSUYwzL4Xdr7HJGhvF55zmMUY/hEwZ2aDI+6iXyrtO4wZLyJgqM+zqoK5ZnzpLvIXZ3THRBOlUHFD/aesYlFg1W4XuTsKKz7S12nrmHK05sqqbpS8hwZO1RkWNVqRAK7+iEZTefxxzjvwnNBFeFBIdp46MGYsr5iqSTkNHFyDpoUcZDjW5T/1Vg9Jh7wqKhaKtABgGDpE+rF X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB3366.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(376014)(366016)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: AL1jjUIabVKfMDMQTeKS+NOLB8EOHKyOsY/NTdLvvMbwsROD47kpxFDxBNdTvlUYDx2SeCXYalVPQM2iB90PDX5x2rScJNPsLih2tvU+N3fjwx2Bjv5Ar2v0GZ882ENPoHObBSu/b6de/DZDQMDUN8PkiPpfUtmA/iRTsdWdts85Lq50MzwNpgK+qLeyytLMfmlqLdT6e6d7uskl4fvknXST6BtlorK7yyzcnLCMUpl/VM+1eX22mA5+JALeDuW7nrLay1aaRb0zWyALfVObWkBH0P3iKk2Zzp3HNoHPO4b0QghNATT2Vio65LXte165ksHm2Ed9v0soQvQ1YHgfoggcZjg1d0G7Ndtvik4kuipCa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H4Kv9Im/Gu35EoAkCilpBbeoUm2z7PDghE5tPG+lO2/zacBeT+sP1Q8jBTk6xgNfyd6O4NaNZPcJDV8YaoQZaKRUjMA80PP8k/VdMeglTrcGFX6JWueiZnXwsA8XX59LseYrtRu+Q7lYs30LZHqVpM0ja4tRB19G3+pOOUJmg4epOL8NmGCtuCU9CfIshNwexs9fAKxxAsr2XDYvopyLmYbKWkUsbWLik5jVjCdgIvubw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: PI4UNchyM4NbA/8ErWkLLyxGB6P9UW9HFzArjkL5yLCx5wmrqD/xhUuUpXd1FPajN480V0OL7XLTFCdtcgOe5lpXbFWQjoo246zoKuhhG2r51NrKnU4zl3QNR6oceTOhtai0NA0gZxnSQlp1qZRFlkfNcRTXlT5qGF8lZ15SvKrMdEym6JCCh8ya+y4hOgCVLMiZ6A7ys5SW4HJ4q9tNQWu5DlvaCN6+BIU7lGn+xgskFKW9bvagIaBoZfkLZmz7PsPuT/QJlmhn3/rfoGp50O1EWcpjgrlP7uvPbozxkkintupwMmT5kTD4clLVrYb2FUxxudomjRZ4H6xSuw5Y3/2xhHa1oKzHvKIBIHQh6Zn5LhhjB0UsVDF376zVdd0vunVBTEpasdzWpPHqzDgXDNbB5v0WlDuyZp1sAAobU3gHtFomRY5ULdM466CNZ5stXz7/qmUP2b03gW1Vdw0KI0uQfpvpM2rfRvm4ouol+0SQd4v7apylEuGVsb/zwNxsgzg/m6ApIhDJ4ah2dBDINGMuNBZrDjkSyRHpswcAjNY6CCi3ufHKAZkSUTEyc3s9e5Ub6KHxhx+c/+mOrjyW1+AGL8Hm4D8o+u0F5YMSAvs= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 086c1ccf-e4b1-4bcd-c404-08dcf2d9ea93 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3366.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2024 20:41:33.8002 (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: 7CaO4yRoaSo8UfW9TQwfs6gbS3SkNp/fR6bkfN/k7mVFpgkYQHnCEqZmO8A7XL7i9mN0cFhu+xtVC1gpp5LfjlhVKrJo0vsBVSFt8EId/bM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB7437 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-22_21,2024-10-22_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 mlxlogscore=999 spamscore=0 malwarescore=0 mlxscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2410220134 X-Proofpoint-ORIG-GUID: 0SYT3gDCiej8Hdw2SYk-M3WBSiCJQ4cQ X-Proofpoint-GUID: 0SYT3gDCiej8Hdw2SYk-M3WBSiCJQ4cQ X-Rspamd-Queue-Id: 8A315A0024 X-Stat-Signature: 86b7czqqn4e7tk88y8o586yrfefsiej7 X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1729629687-488407 X-HE-Meta: U2FsdGVkX18hnSRx0+npKUY0pRLjVxU/bKynxphpZ0iPpyg2yFxXjJ02oBvaAFLren3gzSejSyI66jSX2VSyb1dwUbcNZ8jZxd9zG/Tdv1+bGL1YslAwaLUHDi1qZtOW8NOD2JfPg97y+QqzXdrXPYByBap39whV0vC43ivTRfEoDvKA+4JPysuxgUzosv98D/HSrLXntY5pw3L8kVdU2Kqp7MZlwQkrULj18zX8OG01m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/McRbxElrhbzruY63rSasvH5QWHdFca1qHHfBO6Gm0Sm/FUHmbVqOxjrfV+Y7m19Z/vyGizovKtwy48mybOLP9iX0BPPH+IFHrrbgSWfH1DBeMHT1xNK4X1zMOr8+PIIeOkMDTB6DSNtx4GPw+1RsHU0dTyKmgGe7Fux+MRV2s/FX114x/RX7tFSLtWyTX/hnze0hnnN/jg+FcuL5jqxFF81jtEI4obrKmuabL3oavkWkbwJ23ISXCfye1IVpdFqjKGDBUxhdbWSS7yccRP/ZV2lajLq1gMQsun9id4= 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: List-Subscribe: List-Unsubscribe: Previously, we'd always try to merge a file-backed VMA if its flags were changed by the driver. This however is rarely meaningful as typically the flags would be changed to VM_PFNMAP or other VM_SPECIAL flags which are inherently unmergable. In cases where it is meaningful (for instance DAX) it is doubtful that this optimisation is worth the effort and maintenance risk of having to unwind state and perform a merge. Since we've observed bugs and resource leaks due to complexity in this area, it is simply not acceptable to have a 'nice to have' optimisation like this complicating an already very complicated code path, so let's simply eliminate it. Signed-off-by: Lorenzo Stoakes --- mm/vma.c | 39 ++------------------------------------- 1 file changed, 2 insertions(+), 37 deletions(-) -- 2.47.0 diff --git a/mm/vma.c b/mm/vma.c index a271e2b406ab..fe1fe5099e78 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -2260,8 +2260,7 @@ static int __mmap_prepare(struct mmap_state *map) return 0; } -static int __mmap_new_file_vma(struct mmap_state *map, struct vm_area_struct *vma, - struct vm_area_struct **mergep) +static int __mmap_new_file_vma(struct mmap_state *map, struct vm_area_struct *vma) { struct vma_iterator *vmi = map->vmi; struct vma_merge_struct *vmg = map->vmg; @@ -2291,34 +2290,6 @@ static int __mmap_new_file_vma(struct mmap_state *map, struct vm_area_struct *vm (vma->vm_flags & VM_MAYWRITE)); vma_iter_config(vmi, vmg->start, vmg->end); - /* - * If flags changed after mmap_file(), we should try merge - * vma again as we may succeed this time. - */ - if (unlikely(map->flags != vma->vm_flags && vmg->prev)) { - struct vm_area_struct *merge; - - vmg->flags = vma->vm_flags; - /* If this fails, state is reset ready for a reattempt. */ - merge = vma_merge_new_range(vmg); - - if (merge) { - /* - * ->mmap() can change vma->vm_file and fput - * the original file. So fput the vma->vm_file - * here or we would add an extra fput for file - * and cause general protection fault - * ultimately. - */ - fput(vma->vm_file); - vm_area_free(vma); - vma_iter_free(vmi); - *mergep = merge; - } else { - vma_iter_config(vmi, vmg->start, vmg->end); - } - } - map->flags = vma->vm_flags; return 0; } @@ -2341,7 +2312,6 @@ static int __mmap_new_vma(struct mmap_state *map, struct vm_area_struct **vmap) { struct vma_iterator *vmi = map->vmi; struct vma_merge_struct *vmg = map->vmg; - struct vm_area_struct *merge = NULL; int error = 0; struct vm_area_struct *vma; @@ -2365,7 +2335,7 @@ static int __mmap_new_vma(struct mmap_state *map, struct vm_area_struct **vmap) } if (vmg->file) - error = __mmap_new_file_vma(map, vma, &merge); + error = __mmap_new_file_vma(map, vma); else if (map->flags & VM_SHARED) error = shmem_zero_setup(vma); else @@ -2374,9 +2344,6 @@ static int __mmap_new_vma(struct mmap_state *map, struct vm_area_struct **vmap) if (error) goto free_iter_vma; - if (merge) - goto file_expanded; - #ifdef CONFIG_SPARC64 /* TODO: Fix SPARC ADI! */ WARN_ON_ONCE(!arch_validate_flags(map->flags)); @@ -2393,8 +2360,6 @@ static int __mmap_new_vma(struct mmap_state *map, struct vm_area_struct **vmap) * call covers the non-merge case. */ khugepaged_enter_vma(vma, map->flags); - -file_expanded: ksm_add_vma(vma); *vmap = vma;