Message ID | 9dc1848f0fcbe3abe3d22584e339f2dfee60cb32.1656531090.git.khalid.aziz@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 A7AF8C433EF for <linux-mm@archiver.kernel.org>; Wed, 29 Jun 2022 22:55:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5223D6B007E; Wed, 29 Jun 2022 18:55:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4A52F6B0081; Wed, 29 Jun 2022 18:55:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 25E4B8E0002; Wed, 29 Jun 2022 18:55:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id EDB236B007E for <linux-mm@kvack.org>; Wed, 29 Jun 2022 18:55:04 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id C7D413429A for <linux-mm@kvack.org>; Wed, 29 Jun 2022 22:55:04 +0000 (UTC) X-FDA: 79632780528.09.D72786C Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf13.hostedemail.com (Postfix) with ESMTP id E95982002E for <linux-mm@kvack.org>; Wed, 29 Jun 2022 22:55:03 +0000 (UTC) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25TM4MbT001283; Wed, 29 Jun 2022 22:54:43 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-2021-07-09; bh=iDqTod27kjnFQwMReGoWxNIy9TEDVJAT+EvrAmpvCyE=; b=SZn4QQu7xMC8Pv8cMtXLy4izWCfCqihlMX3fWg1859i4hnTTXoVjayyydS55DJKCWuz1 0i9yA8FDCMKiGcoIHbL84b/DEeCiABA4U3Tr7WDcpWGyEGV3Y1YNo8jEI0/z6mYgt9mm DXTJtCjfezXp2FlvfLINhsgFxczxrpdHbXOC00ctgIdMUCEf7ybhzkHISkaTjhYQ0ZmK uMHH9R32tra5f1S+zMagTOS+xoAFaoQqUxJGI2AO9LYfivx8SHUz50V3m11VIP50d92m PFQidgB9LDfmRPIuYfv5tqUGGRpQBojbfF/oyzhH7a95U/9wRS6bu2I4NfgALlVB5jaq /Q== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3gwt8a2axb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 Jun 2022 22:54:43 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 25TMeuBf028108; Wed, 29 Jun 2022 22:54:42 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2042.outbound.protection.outlook.com [104.47.56.42]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3gwrt3py5a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 Jun 2022 22:54:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nPvhnDWwIZHOosOovpazPVVTT2ZKZG7PBwGXyH0rGqHbUOy2pLf2lRj1eRuCE7sJxQY4ORM3n5FKxJbwWRXM3E51mtZpKMF/7NYowI1nud/qcbvLevSpo9iEN43sfrj556AHsQOsoXX4Tp1IxgevDUq3vbO9AKtt6Ss8B+Isqg63TMxL2YiJcSs15ZaGRqXASZyiXuskJ5ckhspfwpyrKKQ5mg+p3rFBWEZUpH0usSu4TGPld9z59Uwwgoh5z8+Wl0hZOXfkGLIdTEsLIfZTL62f7wRo/xz38z1c0PT7pVbnAvYS7/9aAXId291bhr+5zObNWbVZDDEdHPQ/Ts5TAg== 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=iDqTod27kjnFQwMReGoWxNIy9TEDVJAT+EvrAmpvCyE=; b=Xuqp/xKEdUUaD0BwK0ggiiyN8qfddyql+WY6w0DJZ9ODRjEAU9ERI+Nx4Pl9rJRydwYDGH24HfJTR8Tk4g+g9Y6+vUr0Gx82othOTNoMgpkZOYRiCMKn33J/j4cNqfKRi/fP6ygJ+BiNvaVXbivI/IUGyTHduwAZZS+V1KaRPB61Rg2NjIqkmuNpKh3eBsSvXJZSzBdWmdBQOGpFG+kV8SE5wJwVBK1saHFL+a5CFuZUfCg7H+fgsXspmveGR5FldAQWULZce2+OKfJV97LO3a+TDUkASoV4fMV3yYGbqSPhYzZBmVtKfT/IRkXSf5z42f6/d8mcswBAaFRU8uCn+Q== 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=iDqTod27kjnFQwMReGoWxNIy9TEDVJAT+EvrAmpvCyE=; b=CzocYIgCzjGzmejZkWzUd/MFncxEsWApjfRQH3npEqV4Md4NS04unMnxUc3R6ErGqjjOK+FLUZQq+nxjJpwxFGiUnX+6sR3Z1FfJOuj6eL0c8WCIl4P8B5VZEb9yaTn3K020JyXf0OV2tFpTTh3RFjqRhQERp28P2OXW8lb9ZqM= Received: from BN8PR10MB3220.namprd10.prod.outlook.com (2603:10b6:408:c8::18) by DM5PR10MB1834.namprd10.prod.outlook.com (2603:10b6:3:10b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14; Wed, 29 Jun 2022 22:54:35 +0000 Received: from BN8PR10MB3220.namprd10.prod.outlook.com ([fe80::28d2:e82b:afa1:bbc2]) by BN8PR10MB3220.namprd10.prod.outlook.com ([fe80::28d2:e82b:afa1:bbc2%3]) with mapi id 15.20.5373.018; Wed, 29 Jun 2022 22:54:35 +0000 From: Khalid Aziz <khalid.aziz@oracle.com> To: akpm@linux-foundation.org, willy@infradead.org Cc: Khalid Aziz <khalid.aziz@oracle.com>, aneesh.kumar@linux.ibm.com, arnd@arndb.de, 21cnbao@gmail.com, corbet@lwn.net, dave.hansen@linux.intel.com, david@redhat.com, ebiederm@xmission.com, hagen@jauu.net, jack@suse.cz, keescook@chromium.org, kirill@shutemov.name, kucharsk@gmail.com, linkinjeon@kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, longpeng2@huawei.com, luto@kernel.org, markhemm@googlemail.com, pcc@google.com, rppt@kernel.org, sieberf@amazon.com, sjpark@amazon.de, surenb@google.com, tst@schoebel-theuer.de, yzaikin@google.com Subject: [PATCH v2 9/9] mm/mshare: Enable mshare region mapping across processes Date: Wed, 29 Jun 2022 16:54:00 -0600 Message-Id: <9dc1848f0fcbe3abe3d22584e339f2dfee60cb32.1656531090.git.khalid.aziz@oracle.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <cover.1656531090.git.khalid.aziz@oracle.com> References: <cover.1656531090.git.khalid.aziz@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SN7P222CA0021.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:124::6) To BN8PR10MB3220.namprd10.prod.outlook.com (2603:10b6:408:c8::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1aa6f337-fd81-4d58-ced2-08da5a22565a X-MS-TrafficTypeDiagnostic: DM5PR10MB1834:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FopgIBV/O9vXMppSwNSx6XJudeR/JDFTvv8LezUyRtcpVQgwbGlL+N+iNYeEyIK+OyMFT4xfQp5pHcRfMeVH3jTHGwZnO/AWxVxeX4mDP4Wz3ssBb4cuABVeD8KnlfpL5bre8AeZClqUSeyx8mSn1hGPw4A8KcTTkzXKtG9f5BtqhAPahzVNBOduOIs+3ewVsIbhOpLa8RxmPKLQwxd3sxwh+r6iQFCxm197aNyZm9GYL5YDNF7OyMzXMkPeRP+h3Ao2+efVYmRS78Z9lm3ZFngGGYP+wkuP0jwCQaXH3rRN/IyB257rNs5VdnTKIYkvwKYneL4JIqmzwRL72M3qbu3WhuMRRuf9S2g6xGF2CvFmpE/dF/Ej4vfG5GES2SCujyAMeiFc0THNrXlhTNxV2H+8y6Xg/0RyTGnpAzkxhaojvpUbYqNq6NNYMa3SUp+7nEziD8zpRcm3utH9CjzJkEhovUTFaGoSlWoiP2IPYZePXMnkKwp2ztWlBdK5lvb1bLe3BsgKpjU1oc0xaLYY12dDcGiNMpCBldjOUKHixsiPkLJOlYOL9LQ7u0WBP8UGOwesqOCgK6bL/myFF9afdWUNObPQSso49BICzbOZnlrLMT93OpwZeMvkmCNm82SIs1JTA44KYawSjsRqEE3h86m7fk8p7+nFBoAjs2ofcx6mlGacohMq0BPcUMBBzO6jewJbkntv+kVgUHzEvEXifKWnnTtGKwWqFl1ay+ip9Z0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR10MB3220.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(376002)(346002)(136003)(39860400002)(366004)(396003)(6666004)(52116002)(41300700001)(186003)(6506007)(8676002)(66556008)(2616005)(6512007)(66476007)(38100700002)(83380400001)(44832011)(7416002)(8936002)(316002)(36756003)(2906002)(86362001)(66946007)(6486002)(5660300002)(478600001)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: U+GYyPb7zBAeyJNm0XQbCVA7ZOWT85thOyUC7FGJQ8AftYrG+BQgasTkCmV5V36u6e6OnmAqO3RSi8wQtm78B+Fymtrp5uhw6hZYkZC0/qIJZKdmITxSe/LGsGbUC2ffg9MBR2TYuPBmjm8gDDd7NhyM0rQnmMGMm9O2uky9kcrbWUiB/rfKJL1dCGe4OiMI5QAxaXskENrakYn8WVoZGIbPdszAco2g+pVon+cVT8YqtyFBL6fA2+AaLTbuwUN3R6VgHZfoTRFF9+UNCa2Y+Bc8bJj7k8wyug4z+mWb4PilOp7QZtQQesDiCip/PGRllKzPPUxHSRed+UYERlnqKvh3OzIgBkNLL3sm9lT+ojrXKHXmjAVGmPfSye9Dns6P3/wtp1ld4p6HHU90NeD7LoQfWbEi1M2C9i3JxdxXqH68q9v+353W+o6rwhnvXiUQwNbOhZvOFFrthGq+lZBmSYzEyRceaph66JyNkNhA7+dMQ7Xg8B6PSApppqFYtG2c0NKzITJawXSxFs2P1uDyxmyTRLMZSck7nYISzIJXWy1bq60p43Her58dkwnRigTakd39dwS53KjrYftxm3t8w5fSmThTM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6FoEQMw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1aa6f337-fd81-4d58-ced2-08da5a22565a X-MS-Exchange-CrossTenant-AuthSource: BN8PR10MB3220.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2022 22:54:35.3338 (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: MAGbDXGuSQ2v0KsxXD7hFWYHs71twdZPiR8nVAt7xjTbU5nVkbtUV9n20mAwpNEX4XhEogJr91cFB22zC56nZA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR10MB1834 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517,18.0.883 definitions=2022-06-29_22:2022-06-28,2022-06-29 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 spamscore=0 malwarescore=0 suspectscore=0 mlxlogscore=731 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206290078 X-Proofpoint-ORIG-GUID: Cwo8LPbtBA-pHs-aNfxIi8uquXbeWUuY X-Proofpoint-GUID: Cwo8LPbtBA-pHs-aNfxIi8uquXbeWUuY ARC-Authentication-Results: i=2; imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2021-07-09 header.b=SZn4QQu7; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=CzocYIgC; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com; spf=none (imf13.hostedemail.com: domain of khalid.aziz@oracle.com has no SPF policy when checking 205.220.165.32) smtp.mailfrom=khalid.aziz@oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1656543304; a=rsa-sha256; cv=pass; b=Ckv+1DtjRFe/9MxasuD/woRHe3tfs6hWElOajg3YOnTAJChx61cpDYPyYVAwxL5+MwWE7N 5yLAnm8KO2PmaDz9SpbtyO2va0LUaJTTUxFOcchUCYBIPzi1F/zD0EHyxgCyVI9d2+vuVG OA1wVJBXIY7CmlqyNGynBO0QMDxUqw8= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656543304; 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=iDqTod27kjnFQwMReGoWxNIy9TEDVJAT+EvrAmpvCyE=; b=hTBYp9lBWnA6yT/nuCzmbsudyKYpLKuXy0H9wMwjCJYuBH/eNMmwTyFBciaVmlVi+9ZLRq 34bmiEW2gJbPSprqg9m/BOazmo72vUopEJ6y01o7xrs3DJn+sMnwPB0lZhHVtI3Eypil1D 2MMdvx9rPnGw5aYT35Mozx4eKmvMVl8= X-Stat-Signature: 7tn3at3sik6ew3wzq356ou81w6pht159 X-Rspamd-Server: rspam08 X-Rspam-User: X-Rspamd-Queue-Id: E95982002E Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2021-07-09 header.b=SZn4QQu7; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=CzocYIgC; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com; spf=none (imf13.hostedemail.com: domain of khalid.aziz@oracle.com has no SPF policy when checking 205.220.165.32) smtp.mailfrom=khalid.aziz@oracle.com X-HE-Tag: 1656543303-828576 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000006, 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 |
Add support for shared PTEs across processes
|
expand
|
diff --git a/mm/mshare.c b/mm/mshare.c index 2ec0e56ffd69..455b10ca0cdf 100644 --- a/mm/mshare.c +++ b/mm/mshare.c @@ -144,7 +144,21 @@ msharefs_mmap(struct file *file, struct vm_area_struct *vma) * page table sharing */ if (new_mm->mmap_base != 0) { - return -EINVAL; + /* + * Any mappings of mshare region must use exact same + * virtual addresses + */ + if ((vma->vm_start != new_mm->mmap_base) || + (new_mm->task_size != (vma->vm_end - vma->vm_start))) + return -EINVAL; + + vma->vm_private_data = info; + /* + * mshare pages are shared pages that also share page table + */ + vma->vm_flags |= (VM_SHARED_PT|VM_SHARED); + vma->vm_ops = &msharefs_vm_ops; + refcount_inc(&info->refcnt); } else { struct mm_struct *old_mm; struct vm_area_struct *new_vma;
This patch enables propcesses that did not create the mshare region to map the region using mmap(). Signed-off-by: Khalid Aziz <khalid.aziz@oracle.com> --- mm/mshare.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)