From patchwork Thu Aug 22 19:25:30 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: 13774128 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 79A61C3DA4A for ; Thu, 22 Aug 2024 19:27:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6B5E78005D; Thu, 22 Aug 2024 15:27:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 666858005A; Thu, 22 Aug 2024 15:27:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 41B778005D; Thu, 22 Aug 2024 15:27:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 22BD48005A for ; Thu, 22 Aug 2024 15:27:13 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id D0C24C07E0 for ; Thu, 22 Aug 2024 19:27:12 +0000 (UTC) X-FDA: 82480864704.13.75C3EBA Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf29.hostedemail.com (Postfix) with ESMTP id 954CC120014 for ; Thu, 22 Aug 2024 19:27:09 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="Ij/wZyPv"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=sMIiuek7; spf=pass (imf29.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1"); 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=1724354812; 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=MpWIi7cMQmivMHPf3/Pmr7r1vB9/WxBvplax7ihq6P8=; b=SkIsXHc9+80l88I+pVxBOowZvKOxo+k1PXSLENIHT9pMXvqn2gwPBoGgEIqZV9chesdvml IUahWGjPNS8K0mqwUUPFTDrSR8uhbnVx7wF6tNKtphTqki+ZLRNXe5j5gZ1D1ilVZgtYlU 7JOilydiYn2jCrvF+x/IhLm9IxGjAFg= ARC-Authentication-Results: i=2; imf29.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="Ij/wZyPv"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=sMIiuek7; spf=pass (imf29.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1"); dmarc=pass (policy=reject) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1724354812; a=rsa-sha256; cv=pass; b=LhX3PiRYm/kCT1p4YmMoaiXm3PJW45IX7e6bWtvUS8TkR30psroOUNp/VCXQJeGIVBVmpI PTtXZJGwjdvYM1e7CDKFbI06ugB5dhbAKCBhL9/DsebwGWGByefUWf41IYVTKoDUh71Zli j/Afl4/V1kWGHAXQCqua7vdqfTyN4d8= Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47MIMijE016087; Thu, 22 Aug 2024 19:26:56 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=MpWIi7cMQmivMHPf3/Pmr7r1vB9/WxBvplax7ihq6P8=; b= Ij/wZyPvePB65w1aeiQDxkwS0v6kk60cTbqXjYGw6zz6xE4zmOZCeRY/lxwcXKmw 9GitBAFTZLDi9wIAIRbTJky+Huw1gMO+6tl8ui6/E+rYITOdMFcFLfyj6VxAAyoW IKd3vEhxzDyLmcG19XaTBKMjxo2j+K91qnXjueQLj7AtwGM8s+b0ZvxsC1r6ppiW 0E3qUVqZDuaaN38QMisflmDnmtZv83qWxipiDU77T8uZgG2KT6J4laLISdHLFu0U sH5Ar1O0s9Ca/PTi6Wa1RBDPbKMucgXDEW+s9llsYOIQcY8veao2I7D0/41nCuRx FINV0gwsvX3Hm59RQCmqoA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 412m3du5kj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Aug 2024 19:26:55 +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 47MJJK8f005374; Thu, 22 Aug 2024 19:26:55 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2040.outbound.protection.outlook.com [104.47.57.40]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 416bcu08ec-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Aug 2024 19:26:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ho7qtT1nbx7Ahu5PZjjjZs5eTZekmcwM6tJuUkaciGxlLtES6mfZhLkzwWtfjQT2CgkbZHn7ySzWTaW/T8XXq21hMadMWFvMabj0TAbvVbnFzly4xuwOUclFCtopfinV0UmwAwxDmSmDjvTJ7XgRCNdR0qrnhf+lDBmRseLKH7/xmtSGzu7KEacFZe6gDVPHD17fWsZXhNJGbmWv7l+WbajmxmSZmSgm1rNRxIfToxld8TmLTCFIGvRp7tVDXHt8bKgIWX3taR9lVgHTsq5XkuwuDNFlfa7xVsToo/AMo+k3zsUk9l1OcXDWRt3MqUgssC6XWUhI0QirlDC0uIL67g== 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=MpWIi7cMQmivMHPf3/Pmr7r1vB9/WxBvplax7ihq6P8=; b=g+Afx9R74JCqqQO2zw/yjdS9nf4qjBWBzCdOo35F0HrS1sLJYIFjBe+7/uPIcYWv4bThD3emsysQGXzTGp85v8e9B5FmdeVfbrI+d2N2IEfPB6T5S0/uPz3wrxaQcW9SctqhiZTm+BKwnqbY/7N7bMg5dKGiwVQaRJSZwKWbKiwU8BrPMDCqjgWOCGR26q3c2lsB+NinHUhcIk8rX3EGr+ngcfX07pOvo6FdOp0Nx2h55jDc8K6QbGPBeE4I8Zo+2Q1ExJLqK0DoOPXaYdIZ1V4o5JpyD3T8mPflbQ3RtwSsaDMZ5TkPICxapC301dgy6qeZCmzKQDhVvsPyerT+UQ== 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=MpWIi7cMQmivMHPf3/Pmr7r1vB9/WxBvplax7ihq6P8=; b=sMIiuek7GWajIofwmqdYeqvyVsjyaCzH9XormY0+i6HXg8H3RlfrKKcMMce4SUjRVfIt363I5KjnFUm3G1jZ9S9Si+viWE7I7kqVlGljcHu6lQKcTXOtxnmarooTHmzDWr+ikTPFaEGXeBd77ilmkND6YWyc4UAFsLiTVSydoDc= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by PH0PR10MB5729.namprd10.prod.outlook.com (2603:10b6:510:146::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.13; Thu, 22 Aug 2024 19:26:25 +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.014; Thu, 22 Aug 2024 19:26:25 +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" Subject: [PATCH v7 08/21] mm/vma: Inline munmap operation in mmap_region() Date: Thu, 22 Aug 2024 15:25:30 -0400 Message-ID: <20240822192543.3359552-9-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240822192543.3359552-1-Liam.Howlett@oracle.com> References: <20240822192543.3359552-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0199.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:ad::23) To DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7933:EE_|PH0PR10MB5729:EE_ X-MS-Office365-Filtering-Correlation-Id: 6a8f1d07-62cd-4fee-253c-08dcc2e0501d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|7416014|1800799024; X-Microsoft-Antispam-Message-Info: mouoI6yc4hFWSx5nVhptBO2SlM01D7zirctezm0WCGd9y7j+BvMT2n1gIXnupqV4IVk6ouulEgNrqNf0QrK6FYzdXEGE8pxF3cK/vVRbi67nK03/R75XsXoJPwqkdCQ6e/kxhhsSrk5EzZJdDZPaVsVXtciY/oF4indyRp4En8EfEgutcuNjQwZ38NqH5EhEi4ucz8YJCvSGGj/ANUhaJR4ymSiYcJZZSEOXKVfkMvKa1On3XEU7p/AG0yWkZEOPj6WGyNpE9BVtuezByPtUkqQyAi+t8HlIorFR3TwojI+ktu40ejkHafAXvgeXls4s1c/AhNvz/0m5kzS2P9+2b23rWk1yWRCoC5cW0roqhZQOf9Gsa0sOhwa9wYL4Z2tfwmNCsypBiieonN8WsbtaLbJSsS5stJY9fzNe0tGDY8BY30rIMhUWYt4eemGMVmH9BRFultMtPpGWj2T0e20LSPFECzw0bikpTkuoqQDSU5UGschugR/EN+ji9OcP9IZYT4fvVIaMfXBnXa7u4VnOSKey388LA6CztFSbrzMJdTUSXaB/YZW/Ai2hN3QX0afZopFja+bPdkTmsmZXe3X1Yr+MvhAPbbBzgCHrcCByaTePX3/pHuFOkaOLL9pd4KzE0OggSLLbPIR2kKYDwlg5uPK/FNd/zAGVFTJ91sP26Qw3bj6WJt+OINZMCOzAaZssO3Gu4wH1L9937alsIqZF+zHpa1lo1Ew/DuIAGB9y6GzV+EC40Rdvyn1Zpfl9tgJSZhTPSgwAiCox0742DJfKC1Z2zN1jkbEPI/7TSH/VyJiMloxr1D54bWeizSxZWZQ2oJaFVpN+otKHmFhf0FNK+66kOnKsnh+ZVtm6q4/AJ/a/I+ZYNW1Dg1aDkTm+Ckp8w7YxpESqkc5DipoBduJibnEEJtiEcScFRFDQIQFTf1U2R21jX2TF167W2J4KahmcP/u5RJzqMPN8/qvDXoAdbj4ZU+347GDjOTIspqH/i3j4KQTUzOXq6G17H9ZboAeBoOcjZ9L+nbh5FkvbM9mdgbKKFLNRukqrwSorhUsUfv1BJ/wQIucydhaATClg/nVTye/5EDU6XsvkVs4w1YtYfTDUW/s3sjpi5xRRaES5uVo2Jm3GSNchLapNOoaMWzMkdXyRlJmhUab0Gsxy70lkoCosrESJ/aQiRKrprbXHe562kEpS8OTdGGW9qiFbPXZp1k+dyv7SdYpbYphfwpZlTuzC+5U3KeifWzPeiEZLZ9nc+tKNzoPHUWHYS/y+H0VrCrQ3bI8vjig2yiK8Jhbg97d/xb3D9XFBg9oRB0wy+To4UKmgodiFAOAoYqIfvfQlqaPNw0j8l1Ugu+ixrRtxRw== 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)(376014)(7416014)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wl6XKmCWNjH5GZMbhNrQkrJ/ty0JFNDoYw95DeXOx8MvpfbsGmg31EriMQuGYZU1lWVINT83oBhVk1vN+lcUg8gny8/BEv4hfHBMe29JuU34SVQz3vO1Sk8WEBlUpasi8QRZ00ZmX3gs/hEfSMGsKgqGqAP9p77YRkCT+U3/OhBCTjTD1L8XsvzyPwgE2jdtRLEHMvEze+lgwyFAt4s3AYznlDNmVTc0bOpN6u0NzJKkPUnsFjYpCqzq5dOMlVvPLlNSS6sSbMbKjkNo250wF5OUzMJLIi53IOrr8IjwfU72t238Or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rA8JsQXkG5DM2SRfM5G0Jv2wMmeVNe4I21PHET8Vw0w1TtIF2BxFLy6t8DV1S7Zodc2aysSHhHfhlMwbSWzFh2butpVj/zoa9cWlDiNvU22QQGsSLaNd7W6M8VM20bMzjfXnXt7o37n6BQCljkdeJ4X5rES0M21HTcJrLMLNbQ9OH0YWJFJaja+NhCpc9lfiOKyodis1OvjsnwFNbI5Pgyb8yTfvXzW+OyXciPF0+0nrNygTXKA== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: DM2tRcH7LKgK2QzPyvqnj0080OPj4skzKpaIkmtP5/Ctx96bkG+AysYrz4gcwHSilib+s+4YANhhW7DUuLzrQP1ZRSHLCK/WzvwG8M+cg8Cl3QfeElNJhHlhtuhKimNDY48bmY8kyYtUi94qU9fqSs8yEijqdrpI//N/cYrhuI2fAG4Yg8fypx4Capyqt+J839DfJks8kVEwOf1NPnyFCVIHjloWNvRCGq1ipe6a4e0HZVyHwFe/syY99kO5HJ8BWKgBlfiNl26pGrK8fqWEAx1+zOe/PkFsJNHBg0SOAdPlG11BsmPznXQi9g8MLTCG0yEtnfrTmL53ev4vaUxbErcCU0+YmZ+bwFsRHowanJQ7vCYUf4Rou2CTIGISedybRztxwbSrczrVC11gMD7uY7UVlXcOt1wPDD05Lru91cAldXpVDbFEBJuEZxtFtVeT1/YKXiG/mvB/ry7HBqaSZHSEe/8AFQACVuRc2MV8gwMqPQP+jFQtezt6UBdualWk6bYmY5JUc3H10me5zTu3AgQVwTbr8SW+vAJmvaeHYneQZJo7M1T8PCBCCkZtOM/7NuTd+ZP+/yyrf8ubEguDe5tOW+PA63XBgxofylDGiBQ= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6a8f1d07-62cd-4fee-253c-08dcc2e0501d X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7933.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2024 19:26:25.4892 (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: FAHVP44Airy2GUCJTw54OifSDfbUPYxlD2Tmbik5mcLHDjLicOPglidFlqWaWCHWkFKDJNXA2JxQx54whqiGtg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5729 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-22_12,2024-08-22_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=925 mlxscore=0 bulkscore=0 adultscore=0 phishscore=0 malwarescore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2408220146 X-Proofpoint-ORIG-GUID: dW8BNL22iIqjVJJGV-2vlWIi2aFHEq9G X-Proofpoint-GUID: dW8BNL22iIqjVJJGV-2vlWIi2aFHEq9G X-Rspam-User: X-Stat-Signature: ngppo4s6ksbhaahrkg4nwp5h1s87tcez X-Rspamd-Queue-Id: 954CC120014 X-Rspamd-Server: rspam11 X-HE-Tag: 1724354829-670048 X-HE-Meta: U2FsdGVkX1+8voxlzDmtyrWwEitVBtIehasHxt4LdrJozbiQ9ncb8Yx2FfmqmDuVvtdP1qyjVQHBnuqJ621OReN3rttdnjN2N4U2sS4rfE6WtrHIJGtMOi8/t4VT6vV4/ra2OJeCD/NQcvZ9SYj6skfnxnw3Q69w1lFRdaHiBtIjifTkeERqHZ0+YWVUPUgt1gsi53Vi4ZVqui9/YeRULBhq0xbzTgimy/haZypbNDRH3ILIIpwqcKs1mbqyQDcDGtHyjXMeB+VXamNdpOo75K3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XAAQ9aFKwjynkSHoyTySRifNLs3wXZRkrWEl9ghbemKUdeaBfxMFutM34OeKT5tJnQXzhX+DOrjidAUItHG5JzxoMyiWMq0pdROnNXyRddj+U1/5FlYEt4TischlePBOafk3gzmalRCXgwvo3UsjN1b3pF5lfVSj4lLGOCF3JusPcqy2EYUI= 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" mmap_region is already passed sanitized addr and len, so change the call to do_vmi_munmap() to do_vmi_align_munmap() and inline the other checks. The inlining of the function and checks is an intermediate step in the series so future patches are easier to follow. Signed-off-by: Liam R. Howlett Reviewed-by: Lorenzo Stoakes --- mm/mmap.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 112f2111c457..0f5be29d48b6 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1388,12 +1388,14 @@ unsigned long mmap_region(struct file *file, unsigned long addr, return -ENOMEM; } - /* Unmap any existing mapping in the area */ - error = do_vmi_munmap(&vmi, mm, addr, len, uf, false); - if (error == -EPERM) - return error; - else if (error) - return -ENOMEM; + /* Find the first overlapping VMA */ + vma = vma_find(&vmi, end); + if (vma) { + /* Unmap any existing mapping in the area */ + if (do_vmi_align_munmap(&vmi, vma, mm, addr, end, uf, false)) + return -ENOMEM; + vma = NULL; + } /* * Private writable mapping: check memory availability