From patchwork Tue Aug 20 23:57:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 13770667 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 75627C5321D for ; Tue, 20 Aug 2024 23:58:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A29546B009B; Tue, 20 Aug 2024 19:58:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9AF846B009D; Tue, 20 Aug 2024 19:58:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 76EDA6B009F; Tue, 20 Aug 2024 19:58:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 43FF36B009B for ; Tue, 20 Aug 2024 19:58:18 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id EBAF8A0759 for ; Tue, 20 Aug 2024 23:58:17 +0000 (UTC) X-FDA: 82474290234.17.E99F6F1 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf25.hostedemail.com (Postfix) with ESMTP id A6CF1A000C for ; Tue, 20 Aug 2024 23:58:14 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=oAHegXJw; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=UtdD9rDr; spf=pass (imf25.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=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1724198254; a=rsa-sha256; cv=pass; b=UH2iAlYNK0DMIG19/VoDzaF88LB5k/hM2QBiaEh6cNPe+35xoPvxKC4cktCn95RFsiMtVZ PAavyqsy64prLSMvnYcaGoo+YtQFQRRI8g6L7IOoll4r0IlaXoZxmmxDF7+tjewyvOkODx XETsBm7kk4bF15TMHssN9u6mVtra0Us= ARC-Authentication-Results: i=2; imf25.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=oAHegXJw; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=UtdD9rDr; spf=pass (imf25.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=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724198254; 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=PDNDdIK+17zRq4WUoWjBIpOtq1SQCKc3/dZCfu/MLyo=; b=lySbbSKRx3hRYo5OpNhtDA0tTSAV3rj8N6V6zDyLZjUOTtSB1HkONZmMTndDdweHT2dXH2 Ncztpl6Hi/vACvMT/ibXjWXAla7hjCnM4cO7HZUkFm9aF4GQ5MMa4lzYpU2EB4Eczv8jVd q/+vC5Xs3DH+SsHprX+av+xTnsCcQFU= 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 47KMBXE4005239; Tue, 20 Aug 2024 23:58:07 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-11-20; bh=PDNDdIK+17zRq4WUoWjBIpOtq1SQCKc3/dZCfu/MLyo=; b= oAHegXJwpixOVzpL1KfcNL3FPCFLegTqsd2AHfzv17sfC/tlBKI6r64uf5YYMIuD epFqqBCRl9riX0OZWwkcWT7THClpDM6sbY1Ha/vRo+8N0BMeC9VquN2jhInOVlxN o2sq71VyaCkgQsDtxeD2oMi5cF+dPJTf93EuwOVzzy5sfkVohJ3isB3zKAFvscAn dbemQzjvXzBMZIQaKOj4J+u7wwp+z/KC789k8RASrVhWx75tDR+SI0rTJJqKQZ4C qLEZ9+M0WSp4nLmwhSBkZahBkOkKV1bQxef4uM9zcwDfCJLv0F13ZY70xnS3iVqH exN/RbjDQqEwa1C+CX3AZg== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 414yrj0mm8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 20 Aug 2024 23:58:07 +0000 (GMT) Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 47KMJJkH040123; Tue, 20 Aug 2024 23:58:06 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 4153u2tbef-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 20 Aug 2024 23:58:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aAcQaTJKyGRekAC186wA2b6DXWrmx9RdwkMhoSAfIIIC0jRIyC2k0uRRABxdhMd8c7ZR6dnZT/lV0CATFbQKN1wJCGw9TI30Yopqh8HNrxTd0eLfLTkZ5BST6PmSMvW7zVYN9vwws5s+Sx6UdrrDwI/UYpxMzlOPsRHG7kmsPuhZ1BBkvIe4WaZA2RUa1vog91RcWnGhCObFRiXNaBj62MwcDar29ObshjpeH+6SY0bzRI0XYNcJaTlrumX1t0YPJxN/K7kVTwsyFt329bbT9kBJulV2EWeRqZtxPQ/nNGehC/ZTL+LpmvFB5XTlPh/4Vg+gjiTbpBKtSQUFFvQWLw== 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=PDNDdIK+17zRq4WUoWjBIpOtq1SQCKc3/dZCfu/MLyo=; b=xXhLpbJEJE78RFANFoNvWM9o/l9lPkMGhbmKWcN/udfVsvYWTsGl1qKjcWQb9cvBcjMUmQBfBC66pNZdhsVksW+6k/efPTR5DgOXYO9sMxdqKbkli43IRICETudiny74QgDEY7dsI/5MY0tb8kHb5Ksvy1gwRczZx+HP9XfY+BIy6qOVSxCcEswBxOvHouvqJRidjo6aEiL/1qzM+0+GNP4XPikXXFqKJGRJU4YrcZ1Fa3LS51CSNJmFUiil2zePlO9kaWTLNUCcVXTJZQugjyJ6Ihaks9CYMsnTT4r6IMD2SH3M0ow1Lx/gzgghjaglwoI3dgWZgdcBy4P+JapZzg== 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=PDNDdIK+17zRq4WUoWjBIpOtq1SQCKc3/dZCfu/MLyo=; b=UtdD9rDrlEpXnv93zcUNz71neSFeWfOzf7Bzjhjyz6o4HWeet2n9WhpwXKHMhyiJ0Egp7Q9GrvnsjUzNYiXp1kXY7K9Iug9vkbGa8upN82IY+qpefDf0CP6KjJmCDJuOUL4RkLH4erZe/HY6x5ppq1Jxk8lNEk/+ecKM7tX+heg= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by PH0PR10MB7099.namprd10.prod.outlook.com (2603:10b6:510:26d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.13; Tue, 20 Aug 2024 23:58:00 +0000 Received: from DS0PR10MB7933.namprd10.prod.outlook.com ([fe80::2561:85b0:ae8f:9490]) by DS0PR10MB7933.namprd10.prod.outlook.com ([fe80::2561:85b0:ae8f:9490%3]) with mapi id 15.20.7897.010; Tue, 20 Aug 2024 23:58:00 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Suren Baghdasaryan , Lorenzo Stoakes , Matthew Wilcox , Vlastimil Babka , sidhartha.kumar@oracle.com, Bert Karwatzki , Jiri Olsa , Kees Cook , "Paul E . McKenney" , "Liam R. Howlett" , "Liam R . Howlett" Subject: [PATCH v6 07/20] mm/vma: Extract validate_mm() from vma_complete() Date: Tue, 20 Aug 2024 19:57:16 -0400 Message-ID: <20240820235730.2852400-8-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240820235730.2852400-1-Liam.Howlett@oracle.com> References: <20240820235730.2852400-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0021.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d1::27) To DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7933:EE_|PH0PR10MB7099:EE_ X-MS-Office365-Filtering-Correlation-Id: 14471e0c-be93-4fca-85ff-08dcc173ec1a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|7416014|376014; X-Microsoft-Antispam-Message-Info: 1M/5NT1fSs2l5WxbOYqVaJ7DoCP4Hm5q2H3AMcAkLJOohup91HUGazI9QpibU5ddw/OOMGTM0f4xD0xFHtmxLmV0TdiETt8Y776WwZlUkgGmh9umlZ/6Hy9pVdMnI64lqE9jrqZDs54uRAjVHbULLtoUZXB8xNKQAP6/xyc9RsHHxgP4tp2glCXdKQvUNKH1M/nF/ulmKJRCx52GNAN0sd9ksuHfwqiu38hIaoRvGs72afJgUmqcxvpl3le1rnU2FCG7KOOwEM8oVB0eweCFRd6xCITJWUzlpGTmYyABQW89ex3jRewjq/C7LcQXmvVPUF0Yk5hVOThjlubN2MIx0hWUx8JFohmV3ytO4E477XhNL4+YhW8N1p/CYlkFUnv4+aWEI9lzfI8zz+XBeB6uZiNL+CUE2ANyPbYx7bIT6ZiGw0MvFK6tB8HDifmqGq7JMZ5TS+MGU2NmNdY/PfBkiSiCWKBZCBWAqrjpxbJ3V8a0nQoHUSz52nHlxa6VcMdfSb3i/LAL8xj2nCm2GMUoAgAz8Y2S6gdnjmzMDh+VzjxdlvS15ZvUmEnVNsaDHQ1njglIYflxMjXPXhLpmQdEER8HmeI96IrS0zC04OeHCePZEl7uQjZe71BK+Wik4ZRmlh9TJ24RZJP1Mzp9yvUh1sgEi/RUEN/9c0ceeW7X7HCHBNmlp7heuZXMGg/aYT2iQRML8qKZDfLE05PNupLaxfX72r4pzQXx6UnVDLj23LgNFBw/NDcQJX03nSTWKNbEpdrQB376BzC09cHVgpmPDb+XZJAB5r9v+QIKNjylOoiraJ+NqSBqm1KfDQPgRBwhTVdF2OhwA0/8e5LCXTqWdP6h+OtrBYxLxljCnAPWh/JAFEb3PCNgMi3pxt3kbKHOLOpjH+kZkUuqP4xM/3noCo0qEmUvx/+jaVLwQ/3WLDlQw1KhwQNmNEGXIvRAmKxVnhIY1WnNNK3D/jf2ZC+0PDZBQ8YhgbM3oWswVj5H+LdF1Zm6MsiMMQYB+zefIUgaORHKJPQaeZ94nbvjEpP5Bf74W6vXCqRD437azZCYqZ0LoKCZgxR0lXcYLDrE1IVQYIHNalc0B+/L5zYnm9b2Bbk0fW10hzFUqyfz0B7YobBX6NbZ1fzKGCDbpc4JJG4/D4j9C2/qZ6aUfE0ABmgGAOW2Cr7lJP21vnWJOW1HT55c3ZzF1z6JWFiLdz6nAwazsL/cNI+x5TDYeSZFPUmjE1HBA9T0SP+yzt7wHzQRYGWPZHj21qj84UR/peBH9L3QnEO97L/PullAkUj3BRs/VG693xZeyBKjmKWLlbtRB6HlvKJ5XqTJnh+hyhpov23P8SN1p9NnZm/CoQAVKJqd0A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR10MB7933.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(7416014)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 016ydFlcY+oh70lQV8q/32rVsHSSkN+6Nljzm0P/RqBTt3Ud7QCQoQyk4pnbP+CxpXQVIUZpQpL7+Ix88PJtv4Xmyk5UWGhcZKcbwHjghloArb6ICjxYEb3ANboJbrZ01FiLnYtq2/78//0IKSi+cpaF548/fCoIaMyiSigmLg48HX0i3ozyDo6npHpitxAOO2i2FmwQMY3snKxX3L/jzOkAFNLMaEvgpMIlElKlJIlqhcNqT6ZnbvdFMZZrAmPe+t5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r2BVXUDN6LoaIjqtQzD777HMIYbfD2JwzlzwP1uSFRgJrZN3/AdDZmJqmmcxpQHXCH0ekkcMQl2LzgySlLeovjRO4lG6lmX01rEhdNmq31tFXBCzST3azgsa5lIN/JonQA2YH4Chb4t+7apD4KmaNjerjCgxKF4T1uM+x+kBXiYG60Gvhbxe17T5f8yj+IOI+210bNDgCFUTCDq/XSKv5N9AZfBG3pOQwIqrbwZI+RVZyNmgwzSErUH0Tqp1aYUsxkDA3fFjt2XAYrw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: PzjRa6om05bV8PXdTaciahrAJxCsRCI6ZuPAmlK+tjuh9zc0EZhkoKIF8/T1PUeRXwO7vwHRE5cg+wvOzXrHYtXRER1iJCzlFfped4XPc5NWZqc8Q59dIzCbMEl/SPh6RaXByJHMJGcXkYJ4lx6SlPX9YMJwH3epdIRbrpHGYfQFl7g2AClaUlyKLs7n/TO1nJpy94B1mCE5DF2MQ/APR4PeweL5wb3WF01G+X0z3gCBJMtnfezRiIOZRQEB4rMs+sC4I4shKZqnKIGLcqZ0+R59q7//E0jsynLdhP+6b99WbBjp2ehIFiyCMtXH8YmL1u3fPpqJ1rUqqX/Fgc+pZaqOeQaJrCUH0L7/Cg4IdvzGDRmPeTva2jxAQId2OzH68kJVfJFMM4JwVE3N5SxhAvfOiFScoRhoce49KokmTbNqXU2bqlAQPr8yS50B6J0up3MIFMPf4Gf6rNpL9PS32XlcMA9PAJ1Tis8HaaGAFhUNxemZ9LeK6J2yqVnV95BU5YE8IRI6henluPg1ZFUF+IYV++a+fqS1wJCY+PHlPJgHDZ+Xg44FgiYbNgA/6SX0P/E4UMpO0KlFKyCoUJ1mvZJXrLFJJ/xKIweUYs3rUJY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 14471e0c-be93-4fca-85ff-08dcc173ec1a X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7933.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2024 23:58:00.7372 (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: WYDfolKE0YHZmCl/CioxMJH05L+34pWdkh9dW1UDhdnrT2VUxeeWa/Me/8+JF3+qYdlRGfMyQKS+SAiN071RfA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB7099 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-20_18,2024-08-19_03,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 suspectscore=0 phishscore=0 adultscore=0 spamscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2408200176 X-Proofpoint-ORIG-GUID: CEVl1PdElzELRSizlCLErMBnW45nL31O X-Proofpoint-GUID: CEVl1PdElzELRSizlCLErMBnW45nL31O X-Stat-Signature: 9x4nn9qza6z8ky1c7pkkjudec88z8qf8 X-Rspamd-Queue-Id: A6CF1A000C X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1724198294-786220 X-HE-Meta: U2FsdGVkX18vuM3bbmOCJT/utSu3qmpLhDn3/PeZYsbDeyQKrPQG1uBqdE81e3MmZQ/OeSBOVVzbqDMK4S4EcdPGo6w1jLASBRYnIUC0CeqVzk1DhUPnT/YzpkPPvrfefdoNr4TOz+9Bz+T1ABqzbwyaBSfwMTf/spLsdkIzzeeuM4gCbRMELij91x7/BGGkQaazbw/w4sPQ1tOQeRm2pkFk8+nrUezmaNIvuUMfv0z0jV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4r916yOLtrMudVIf3Esrm+PjBub8jpHpqmm++590CLdpWnB9BcaNHTFgOf6E3aaicFi2WkQV9ViOJsrDCXyBJrQFY8Xz4KOu4go6OmtVUFayQ1D+CfyfEKGdYmzS3UUQsjvyElb5/V3UQh4OcMaeSoc9YoMkMA1Go4MezvVPLeZEBIwgrEr/HeauZb0DabKaF/2/ALr0p3bIgiBiiAbHl6OoXV2C1Y3YKwnkFj6U9sPqbw= 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: From: "Liam R. Howlett" vma_complete() will need to be called during an unsafe time to call validate_mm(). Extract the call in all places now so that only one location can be modified in the next change. Signed-off-by: Liam R. Howlett Reviewed-by: Lorenzo Stoakes --- mm/mmap.c | 1 + mm/vma.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mm/mmap.c b/mm/mmap.c index 30ae4cb5cec9..112f2111c457 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1796,6 +1796,7 @@ static int do_brk_flags(struct vma_iterator *vmi, struct vm_area_struct *vma, vma_iter_store(vmi, vma); vma_complete(&vp, vmi, mm); + validate_mm(mm); khugepaged_enter_vma(vma, flags); goto out; } diff --git a/mm/vma.c b/mm/vma.c index 7b8b8b983399..5abda4c49c83 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -269,6 +269,7 @@ static int __split_vma(struct vma_iterator *vmi, struct vm_area_struct *vma, /* vma_complete stores the new vma */ vma_complete(&vp, vmi, vma->vm_mm); + validate_mm(vma->vm_mm); /* Success. */ if (new_below) @@ -548,6 +549,7 @@ int vma_expand(struct vma_iterator *vmi, struct vm_area_struct *vma, vma_iter_store(vmi, vma); vma_complete(&vp, vmi, vma->vm_mm); + validate_mm(vma->vm_mm); return 0; nomem: @@ -589,6 +591,7 @@ int vma_shrink(struct vma_iterator *vmi, struct vm_area_struct *vma, vma_iter_clear(vmi); vma_set_range(vma, start, end, pgoff); vma_complete(&vp, vmi, vma->vm_mm); + validate_mm(vma->vm_mm); return 0; } @@ -668,7 +671,6 @@ void vma_complete(struct vma_prepare *vp, } if (vp->insert && vp->file) uprobe_mmap(vp->insert); - validate_mm(mm); } /* @@ -1200,6 +1202,7 @@ static struct vm_area_struct } vma_complete(&vp, vmi, mm); + validate_mm(mm); khugepaged_enter_vma(res, vm_flags); return res;