Message ID | 20240717200709.1552558-16-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 51A0BC3DA5D for <linux-mm@archiver.kernel.org>; Wed, 17 Jul 2024 20:08:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C17836B00A6; Wed, 17 Jul 2024 16:08:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B9FAC6B00A7; Wed, 17 Jul 2024 16:08:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 97BBA6B00A8; Wed, 17 Jul 2024 16:08:00 -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 77BCA6B00A6 for <linux-mm@kvack.org>; Wed, 17 Jul 2024 16:08:00 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 30CCA140C7E for <linux-mm@kvack.org>; Wed, 17 Jul 2024 20:08:00 +0000 (UTC) X-FDA: 82350330720.08.F174F5D Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf22.hostedemail.com (Postfix) with ESMTP id D1A3CC0014 for <linux-mm@kvack.org>; Wed, 17 Jul 2024 20:07:56 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=YJtJR1aJ; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Rk12HtaU; spf=pass (imf22.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.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=1721246856; a=rsa-sha256; cv=pass; b=Xlp4vWQU5XwMkNg1Xvk+TlL+cT0y0PYy0v+c+Nrb5kStQGicnsBJvS2ppLxAgZPxiclH3d YQAo3cYMR90OH7NPszYEttrj1c3lU7cMIT+g2wprBGbgQZ8WAhA2ZSF83Ry9NNE0aqtCyL uYaxCA/81KFlVxgisnI4wMDfzA3xqZ0= ARC-Authentication-Results: i=2; imf22.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=YJtJR1aJ; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Rk12HtaU; spf=pass (imf22.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.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=1721246856; 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=0BaWiKTmL5k+MzajqRbdkupIu6HCcw1ZcSuzW844wgw=; b=gpVE8p/Afk671jRHEb4dmyja2RA6bmtzDLmyqBNoqVjdf81HCgxHAmVeIOesc5vifrVWoB /BmJavMnxxvVUNJtUqu85sIRjiQVs3bVP+kFyDMxo9htPjSLbXNSknGdnP3su6LxeZKkbn ZczUbyVJAn6Thb8hXPwNs7IJaoRrtRs= Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46HJsRp6016980; Wed, 17 Jul 2024 20:07:50 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=0BaWiKTmL5k+MzajqRbdkupIu6HCcw1ZcSuzW844wgw=; b= YJtJR1aJw2jVohMrMmS0IF8HW7gRhl8vuiFra21mX0eLONTEIVAutIYDhc3Y1e9C +B5fgP+gpsEH55dgufX/YEd3erNP+lzDqIAKQbZnwA+Y8o0v1eLCgTlRsu1evczu 9C42ua3S+6PXBjkTOFDp/P9O0CPYr320C8eMDosT4WMKWPfLMha0/4YunULAUpi4 9+b+9hGzq7db6lUY14cCUqEN6P2E59r9vAC3sqkCUEvgzFzo9Fkd8yxrIMMYpGVK G5skKKI28bzO4bHQsUsfRWPC2sMvC6srI8imd0DLSogU00BJ7jW8LN1927neP24e 23OK6vO0b4lGERJH1A0djA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 40em3m033t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 17 Jul 2024 20:07:49 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 46HJIY6J003738; Wed, 17 Jul 2024 20:07:48 GMT Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam04lp2174.outbound.protection.outlook.com [104.47.73.174]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 40dweyhkpk-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 17 Jul 2024 20:07:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=P1Ld24LK8hRV3kTR7gZvwP4mXjXjiFimV4j+4IVYeeT+PfGh+FyKXERZGkOSr78wpX05WfzporEG48lUHt7oOJfAQHrvfe8NeRkUnrXWvkQwAYv6B48c54GCCP9ZlXjgshcLe9SR/JNzuM3Eo8aFp9a/w5RIazz2xs1dl3tefErvn6stFc08y4OF0aLdVpiZuKbr7LeJkAXblwER+nGyYvrC0P5Cgiyc6cYrTqzFQv7/bIChG/GO6QV4qRNLDT59DG6DR/6xBHeWDXNfp6CKd9cLx/NdA5/zOIthEgQP2aepdHGGPYoGrwjRa8lCvHERgydzevoWJ++faJOhHK8Ngw== 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=0BaWiKTmL5k+MzajqRbdkupIu6HCcw1ZcSuzW844wgw=; b=cR7+T6CYQqOh8gXYPnSns/Kr5C3Z2KZVN1avTxW/GFtfW6ppYzyB/xhhTbxtlrP+IF+4e+JbdVSmUr8vD4Xp8gAtOjaepQMb5U1aTM07mlvdK9U764KYJrFjaVxT5+vVXRIr02qyiBoqgx5pezDZJONiEuGXYb6jGalKvrlq3GI0H9wwf2rzPAWDK6WyEkKbWUBcTbIY/XEZazVtsYBGTtSBlqhQN2ROz2Ojb2oL4hhzmiG/r9ikpTdjHegqX6vfg9zGZd+1by+8ox6TH3aNmcuOWI1D53o91XaG1GgVpHJOy/9Fbg3fdSycWKk0yyCg/ZA0lyaWb1btYBHflC8YCQ== 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=0BaWiKTmL5k+MzajqRbdkupIu6HCcw1ZcSuzW844wgw=; b=Rk12HtaUqHvgf9THmGZWRndZAQ6BfD9gERU1HkDDW1wvcTr8sRX6EpU/e94b8WlUFkfYoIKYHPIrolX2+1wldo1iEWC/mGCwnAUCAstjLkzJ9qxZG1eoUTXtWjDT1o5/iRPHMrGC6qGw3uiDQSd+Gm4PjHS67IoJaRjmMUFZt4A= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by DM4PR10MB7507.namprd10.prod.outlook.com (2603:10b6:8:187::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.16; Wed, 17 Jul 2024 20:07:45 +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.7784.016; Wed, 17 Jul 2024 20:07:45 +0000 From: "Liam R. Howlett" <Liam.Howlett@oracle.com> To: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org> Cc: Suren Baghdasaryan <surenb@google.com>, Vlastimil Babka <vbabka@suse.cz>, Lorenzo Stoakes <lstoakes@gmail.com>, Matthew Wilcox <willy@infradead.org>, sidhartha.kumar@oracle.com, "Paul E . McKenney" <paulmck@kernel.org>, Bert Karwatzki <spasswolf@web.de>, Jiri Olsa <olsajiri@gmail.com>, linux-kernel@vger.kernel.org, Kees Cook <kees@kernel.org>, Jeff Xu <jeffxu@chromium.org>, "Liam R. Howlett" <Liam.Howlett@Oracle.com>, Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Subject: [PATCH v5 15/21] mm/mmap: Use PHYS_PFN in mmap_region() Date: Wed, 17 Jul 2024 16:07:03 -0400 Message-ID: <20240717200709.1552558-16-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240717200709.1552558-1-Liam.Howlett@oracle.com> References: <20240717200709.1552558-1-Liam.Howlett@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: YT4PR01CA0034.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:fe::16) To DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7933:EE_|DM4PR10MB7507:EE_ X-MS-Office365-Filtering-Correlation-Id: 5dc7fadd-b0b8-4e12-a5c4-08dca69c1f61 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: V+wEtXyUyFDe/Quihil2olE7jxBr6Ir2knpvIlIz3cYwIFbTwStJ5YyF9Uh4UNi9G0Ffr4m38Vr7Sb1UssyZo/61PzrVkbWrPhKEdKUx9ubi9kalSqJYPhQ6pJshj9uQB/OV2PybBR4wgAapvnZ/ojLq/+x40anwoPhFG2v73ISkoT+KawqhRfaijejCrL7+rEoUL8VpMhx3gSBBIs24EqVi4TunxP9pdaN95a1LUf251ipAlqessfvqdJx7CIfjaSGI1iw9DajbHjpj549KguMpEi+Az4hfVJdHgWmAYi9F+Th+6vSuSExURiKEnQ+V1bUSpGS4pKP9yzhObbf1n1g5HTUBXiZJtPE2WfZG+mIAWwio+HFsTOZ+xGV48G5eh38RuzSlWoZB6WDpW+1LgBc2zG3UNu1fuhjRGLs5DnCRxS6GLaPOfz0HtgTQNUqEep9oOyW5KwOhG7L/c/d1NgLkiEcqACh9jSmn/zMrK76aDGisYzogrWiQ4L8RpCY7axJmJcohgYjBabGIrIKadLtpwhmmAfDQgJGMf+nN4rk/cLB88E8svOLZkmKwe+1MuyRdMHJIZcZI6DY5Jjo0iZuY5H5RUnncQpxBycbE3lmFfaA/4+0ahxtgejoXsxmLixcl4e5RCrz0QfEziFxxmF+Pla3nTstgjlCtHQyD5AYubqO2kJMD64U9cc11rlbZIDGyzDv5jlTvfX25+ALp9u+nk/qUM3PXjuj9eQ/6tux1GR8bAwSS07SHciGO4+8Xt67sxJg2xVvADH9IAtujGA11xYWSOGMNiZePKzi4r6j/zUC/c9H9loPrrEGLsF/FX/hRul61voEXT4xoX1aHKwvmOh1dp9FLj9jx5U3BFjyFNdWRRBavp8k+qoGu4pmC9iMdEVnK5WXqTHVwCtM0FuFpuUs6/N2TFpGtAYkEhUW6JlWtJXJPBB7A4X3lacmE04MlUiqjpva5DJXU9GxSDKtN9+JeP0fZhOiswoO5gIJHFFcEAO0i2qnpl+tFRLdzM7eEEymQy0FGXuWFQL0gaU3Mx5jcY8JuysWFHFNRyvJPBPO0FJ/2e6+WC9u/gDCmbVXpS3YzcETZryxW79LezUF2SAQQGjpLYG2IzrQUXx2XRU6cFhGI1eGbsXVFKyntFI55IGqVVRgEcpnWAp6Kq8iSBCv5cuhdwl9u7Kv3vxbEKJe/qxLJwfhEPrLfT8rdCHYSs2eVn9ih3GKGw4achP1srQWGg/mrixgQsVU7vpAZZhSsMwcQXotFOmaN8zQcyovp1oPkXXI0k1bqDqI4bCHVfAdeJMaKLg/Efembj6n9JPO+Kme8eFHBCS+se2P2YUVvs1dehduYhPtI0+f+jw== 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)(7416014)(376014)(1800799024)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Bc/OnrVn+Hzg2nyFYy+aXmqOjw7rqNp2rq0rbQMY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MVWMMrDurrP7f/QnsQ78jbpfaef4kfoLxGGI/1m7FHzcH6AkbzfrG+dBxJk7OO5Wvxp8HRP7bWkcn6w4cS5Ti6BrBaROwFvCn7XysHZbhLvzVhMk3Tk8FtRnUhpQNKLFtxTXM= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5dc7fadd-b0b8-4e12-a5c4-08dca69c1f61 X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7933.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2024 20:07:45.2592 (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: T67CdT9UamGa5FNdKMa2fU6v4z75wr++3s32tmTvqVbr6N5HzH0FrGyCnq/7FLs/3VMZeg5AIevREB10++ejcA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB7507 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-07-17_15,2024-07-17_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 phishscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2407170152 X-Proofpoint-ORIG-GUID: i15cWQNC84QuNNyqJ0Bp1gfmyk4gk1gx X-Proofpoint-GUID: i15cWQNC84QuNNyqJ0Bp1gfmyk4gk1gx X-Stat-Signature: ot8m5tcrpcq1todjjxj5pb1spqx9u1pg X-Rspamd-Queue-Id: D1A3CC0014 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1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fKTxWfNItDs9pTO7E9/s6irDSKdDgJGh0sTVnZStAI1mSavb+01pNHxPMR6h5FH425jrrbZMPZgR5cLzgPgmjMp/VHhPcqEZD7+AAg6amCPNpaJxW+gqDTptagG0mAROZY1hIgf7vkPilCemBo4mv2JwimTGujur6pJwby5BCAgterhZhllF7unUPXy0JQeUoAMcp59cscet4JxiM5Xp0xZvc/VtNde6ZjKq3wkIsLTSMhuXNWEmSqKNMAFXizebAn597n1mkGuIyUt9orGY3b2uRl5H4QSAJLWRfwNTy7xgLaar+dJ+KiEGYBUvPLoOVU0x913Hx7BQs2iXy5P2P8uu3LlrqKHRq94tmGwUdTT9B+QgO1mTsbcJU2glk9l+rxKOuv5eOkZ/1lSfQCgqbevo9rNbhRM7YVT4Io+28Yqq1OjwD3UPa5d52k4T0tL3lg3Eee1isIWO6q4tlI+FL3C353DcP0eLQMMsdJX6QVMUuMOH7X/9x0RjmnW8A= 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> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
Avoid MAP_FIXED gap exposure
|
expand
|
diff --git a/mm/mmap.c b/mm/mmap.c index 0b7aa2c46cec..45fb8725a6c5 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2971,7 +2971,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr, struct mm_struct *mm = current->mm; struct vm_area_struct *vma = NULL; struct vm_area_struct *next, *prev, *merge; - pgoff_t pglen = len >> PAGE_SHIFT; + pgoff_t pglen = PHYS_PFN(len); unsigned long charged = 0; struct vma_munmap_struct vms; struct ma_state mas_detach; @@ -2991,7 +2991,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr, * MAP_FIXED may remove pages of mappings that intersects with requested * mapping. Account for the pages it would unmap. */ - if (!may_expand_vm(mm, vm_flags, (len >> PAGE_SHIFT) - nr_pages)) + if (!may_expand_vm(mm, vm_flags, pglen - nr_pages)) return -ENOMEM; if (unlikely(!can_modify_mm(mm, addr, end))) @@ -3025,7 +3025,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr, * Private writable mapping: check memory availability */ if (accountable_mapping(file, vm_flags)) { - charged = len >> PAGE_SHIFT; + charged = pglen; charged -= nr_accounted; if (security_vm_enough_memory_mm(mm, charged)) goto abort_munmap; @@ -3185,14 +3185,14 @@ unsigned long mmap_region(struct file *file, unsigned long addr, if (vms.nr_pages) vms_complete_munmap_vmas(&vms, &mas_detach); - vm_stat_account(mm, vm_flags, len >> PAGE_SHIFT); + vm_stat_account(mm, vm_flags, pglen); if (vm_flags & VM_LOCKED) { if ((vm_flags & VM_SPECIAL) || vma_is_dax(vma) || is_vm_hugetlb_page(vma) || vma == get_gate_vma(current->mm)) vm_flags_clear(vma, VM_LOCKED_MASK); else - mm->locked_vm += (len >> PAGE_SHIFT); + mm->locked_vm += pglen; } if (file)