From patchwork Wed Jun 29 22:53:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khalid Aziz X-Patchwork-Id: 12900742 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 44D6CC43334 for ; Wed, 29 Jun 2022 22:55:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1E7D76B0078; Wed, 29 Jun 2022 18:55:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 174C96B007B; Wed, 29 Jun 2022 18:55:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E93FC6B007D; Wed, 29 Jun 2022 18:55:01 -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 BF5E16B0078 for ; Wed, 29 Jun 2022 18:55:01 -0400 (EDT) Received: from smtpin31.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 894EC20862 for ; Wed, 29 Jun 2022 22:55:01 +0000 (UTC) X-FDA: 79632780402.31.E42E7BF Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf17.hostedemail.com (Postfix) with ESMTP id EBDB740039 for ; Wed, 29 Jun 2022 22:55:00 +0000 (UTC) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25TM4TJN028210; Wed, 29 Jun 2022 22:54:30 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=tzNjiQC2Kh52nvj/IA2iScjKaJFJxuA0Ek6TWDJoEic=; b=MnXcqcHeRPmrklSmn4b6Tw1yLeQE3DfesgjobBPP32PylIFZcFhXt27XP55wVh9Dq4bz E5c3Uv7qMN+YLD4335sWjT6JfyzLx/hOM27DKMYQBXickrUG0zKxeEMWkX7ohHkPHYyN BMVFb6HoaJkc1WxxP9Psa0uCVTgqIPSMPjusA/ZquWxlyycUmSlIuHN5dD1vfGSmyCZu dEytKyodMGlIPa7osoOaJphoeLE4fNCVPThEb8hatKFthB11wqoA0nvLlQc6BD+79pJg K198oMHZtUQkqc/XAuq0FyFDEI+Al3hGDtY1Dw4Mh6MdJZyFAHc9YZiViGdcCxIlXA2v 9w== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3gwtwuan8t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 Jun 2022 22:54:30 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 25TMf7FN003521; Wed, 29 Jun 2022 22:54:28 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2171.outbound.protection.outlook.com [104.47.55.171]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com with ESMTP id 3gwrt98nsr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 Jun 2022 22:54:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mi+Plaey2aej9NovQwIvPYcm7g4RcGBntXQM660NqGy2snbD6aGWt8MmPX/AhDwLNNgyM3VeOFd/MherHdUrTLw9y0NxN0UMzxvRce0CjM31XFNqt43DHLuzijHbQqSCAKlbmOSS6eoHJ3nD70gNEEf/qA4xsoBXt7h7o5UsmIbc2RYxBOMspKNYR26N4tMnlq2YUa8mTqJ2DgIgwxkw0E6uzUQsa22xAWlamP7rbvka8YjRoJJ24yRKND0cBXkLELeazzIufvFTaJsAguZ3eaULQ4CGVwH+HSzqGs/SOhwoears2qwPuu+ulW/ryj1SxFB8bBw0jtbV/TPx79ldaw== 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=tzNjiQC2Kh52nvj/IA2iScjKaJFJxuA0Ek6TWDJoEic=; b=lmSyXeqBgu376wf2/spOaZjaQ3/l2NF4+n5wuKriSFpkENDVjKFSCDzavyOE2opss0vkh9JqOQld75tT7wpuVf2VAoL7s+0uq73pHHgMXga2SZDn/eodBE1b3BMJdF0En4YcpsRUliQR/0yl7flC0b3fIw0N8hK6dzwRcAOMpvni18nyQMQ3Goo2U41jJrv46tMjIPi+4R45n6dkq3R0o3w3ustGbXO/8Fvw/0zHDX/fsaqDexz0gvId/goeZEIeT88H6hML68yemKXNsjAOY+jSbd9BDDVAmKh5gx+jONFX22VsdsiYpdGBLLsur9W2KUFBsFQgJ+HVOOak4zjBUQ== 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=tzNjiQC2Kh52nvj/IA2iScjKaJFJxuA0Ek6TWDJoEic=; b=aSUFzGe2R4kf4101qX5OL2raEJNt/HsHd4BEDyNVcVD07kmneVXO0M23MzutpHOzw1dYX5Y0/2+CvEfdSVbfX16XzaZlTlu15V7KuCtCX4mtHWPEkRxtYkrsjYGsL0heBkXe3qIeF3GwJY5bmnhswTgDh5bpmtUcT2APHH2xvCI= 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:27 +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:26 +0000 From: Khalid Aziz To: akpm@linux-foundation.org, willy@infradead.org Cc: Khalid Aziz , 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 5/9] mm/mshare: Add vm flag for shared PTE Date: Wed, 29 Jun 2022 16:53:56 -0600 Message-Id: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: 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: a01ffffb-3980-401c-1e81-08da5a225145 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: Sc3Dkh6y2hKGYCpWl7SmwH6f1L+MMe3G+cUAQeaF4+fprG4oWrApLz0UNkH65d26TWj5u51hX2nnEKAMRKpvPKrRlIYoQXgXqb5MMJvUUdnMNTEeHMJ5wIl4f+IphizrDswswJ83DWYvzgP3MQ+JXGl7VUHDdWIGE9mZw81pZG9Kq7vlhf7PWqSWmef1Q+dsCFsi95dgZelHNR2/WPgmx5TKY1s1Z5+Z7ff+M2JMhPge7dUWd4SVEeA20ueELSFiHBYULPdcftcAwtIRqfhb7Ytq6KCbk4RTCQUKINEnbXDb1zBmf9Un+ukXRUprzW0KV2BPUP0kWlnFAyRxHCc/BvstgZGI5lzluRV6ekdFlLXGqV7NlaKfH9K8rYXCjAyUAV1hi7vc38y5P6UI4N+OSmIlx8OoEK0Sv7kWpRxWLFBzdYTpYUaX0s1Bf04F7dEYrzTS/mn+SDUnsOJiPa7eE4W5xCJfoD84jmIrFgGQRkHZ6xEur0Edg+roIHZ3subUAp9SthRhEmp4RVMYLc3EM/6YUDM5QRV17xb3rbljEnHkfs557RAHvlbSoge+uPZkkBJa07tjuhGtiCEhPnOAnFzBmZEBfBVABV7qubMX8HN+d8oIaHBGxwAnB/9/SxpxS8eH3vP3u2dTUUfYoHr8WPznWRR5qcmR+13Q0QddaMQg+LhtoMNV0IqqkcA50Ks9EYvkavSR5vkWBTeNA4CcsmKn8h0jpEj8FtibpY4de+0= 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: g2NajX0XLhaneVk90fQiYu9p4fP2AXDVcw85PZEBTuJZPl85zhEpxh+jlLASetx8aPDPYGUFxQj2w/xGWlMyFgjcSXUDen5prlPeljxyBuO9X/LLNC0pRe3F6ValBuk+W2RAyL6E+5lB4inOGxN+4Ww1ts7Aaeu2BPEfeTNbOp3wVNf+/vD6UTcBchnd/bOloLfoPG5WTJX+fuHWoEmn2KZrsxKYONAybYyb9Ko7pfAblFD2AeRmdkdDLggahVJyJ9Rkq5gF2plX7N0x7xVNxTecu5meIeiYzoIdL8GQcJ7v3KbWgNmrNhgrRseLDAXY9pRTSB6Z2s7UgaKaha5ICsYAs66zvEN3JVLSiqJOqW+QN847tMLbeGLkG0VHjaoKtHCEKanNkbL/RUQQ3AibU7s1NNwkGBoP/Ru2jDmA3GMU7Zal+VdBCc66MJB/5KvEntDBTOvde8ejD+hj9F2U7swKFyfEukOtrxdG0UloeIofobKFvkAEoVMjzujbA1Bf6l0fp+l/N5HAvF/j7VfDzq6CWf3bg2hsFIe+OU6BfwWVpoLQK3tdRbzJERpsHcXg+cK1t+CsMLyhzOZHfzA4yeVDf6w8g/szTAFEiMKX/e85b8BrRdEHSXhlheDr1kWbzFUoX9mXXKuWN6lYkK46VMIMs4kMY1WI40rEhKawM1/abhBm/m8fESftSlgqJS9XOKmGG94DRTT8KZUtYDhW0xpZkOKtHmubeAP4gB8NA+lncgJ2S6mE6P9Td1oOqui3LiyLSGJk3+MYTK8p6RfRtOXGnzImNTBfto+UfA9qNMu4yMlKqAa+wL1smoRYAQ3kphzH/JzeqXAlCSt4OJ/iDYNou/qdGxbSf/qydhjz49ecYDEH07PYvbh6draYIETvviXLRE/kx95HgPbetIR6RGWZrmbVtE92yVww66mV8d80e360rDkLc8sZG2hMVVS4LgbnfyCpYgfyIcsE4W5kyHZeqHr8P7aw1KiBVyJW7qyJUnHkIC0S87RwuPALC8OtQp6ewoJQ6YG8dNpgqVk4LMq+auWGptnV/ulCCXlxynlIj3FTyPcgPkFXL0UWI1bWVrRjn7H/zCZSguNETU1fE2Jv6rsZ0a2tflDmmyvXTL0MuJzkYhLr+LyieoxAM/H+SeUL23478ch9bTJhV2sBrcYNmHjdWqCvLTSjKGMoYXVWaf3CEQdaJWSeGRJgGpJV9srBUU6axjCxn/BRekmBxaT1pUKfC/tMEZYMeRRxnt4NiKyrCsyt7j7t+PJZ/aP5z7RDe9pAy+hCSOm5Pc1Ez2oqPSAL5ktqM+TZWWf40i+O50uS1499HI0OB8hSlxdIrZnxmugYoJE70XZoKOrWZEbIPWq5z5odHVAGx1de6/ApduRVbR6A/FihWoJ/p3abfPNgBoTUmIY2i018h4krMjjkERWFaS8F/DQzPCfmC7QzX4fniMBE48feqIgkdLfvjndmRBRkHEf7ClGnreQ+grl3iOE/vxlREoaKasnWkJivOGchNBGzt3eiwW1TjWxpihBSmFeYRpCTtCzvOPuL5v726VaigliwxgJ5Jt6UobZgUB/CBXDh6CAxoVgMoCYVi+l0xGRCHr5F0cidSszv5qHhmKOMOaUrWAhXHUeXsUP139PGkLnf7xtFtvXEWVBp X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a01ffffb-3980-401c-1e81-08da5a225145 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:26.7718 (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: MlfB2JDheNzkkPXSqMARO5T/f0KhYBxWmhF25O6W1MtiIugY+bsp1uGgYHKtjodWFf7uPb/xU6g9gHhmq7prow== 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 mlxlogscore=818 suspectscore=0 mlxscore=0 phishscore=0 malwarescore=0 adultscore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206290078 X-Proofpoint-ORIG-GUID: Tvn0GXuCGQxZ835g2ncrOWdWyViEjZQ_ X-Proofpoint-GUID: Tvn0GXuCGQxZ835g2ncrOWdWyViEjZQ_ ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656543301; 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=tzNjiQC2Kh52nvj/IA2iScjKaJFJxuA0Ek6TWDJoEic=; b=H6cnJH0GlyjBAQxsxW+5jVrQiRIpZCMm3t/hD7/E0R4DaKHUO99IB3jO+r+b2K8p+Gz9EY fbvoW9fJwbVwMDd/hk6cgEXjreD5GI9Wl8hNeQyD5hzCkr4k3TChUCuzp/TApwCqD63yQk 0s/cKHm9t6D1czmjXc5hj93JjQb7QtA= ARC-Authentication-Results: i=2; imf17.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2021-07-09 header.b=MnXcqcHe; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=aSUFzGe2; dmarc=pass (policy=none) header.from=oracle.com; spf=none (imf17.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=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1656543301; a=rsa-sha256; cv=pass; b=i3lWHX5Tf9FXU7Y9MITQLyljpinS1GM/KU+TiZzQ/EpEkei6ySnocKT5qP2Arz4YS6/t3h 2QvONHIUYjufaaE1HM4hQkt+DNcgzdB3+mOuV9eou1JXM0EjgzAy3pFZitqlY1TA5qypo5 YH5JuUs0tCgvaS9ZH/auYC+NrCNaVf0= X-Rspamd-Queue-Id: EBDB740039 Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2021-07-09 header.b=MnXcqcHe; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=aSUFzGe2; dmarc=pass (policy=none) header.from=oracle.com; spf=none (imf17.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=pass ("microsoft.com:s=arcselector9901:i=1") X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: 5dpn4pyzceezmpyaerx9oucazdudke94 X-HE-Tag: 1656543300-988034 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: Add a bit to vm_flags to indicate a vma shares PTEs with others. Add a function to determine if a vma shares PTE by checking this flag. This is to be used to find the shared page table entries on page fault for vmas sharing PTE. Signed-off-by: Khalid Aziz Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/mm.h | 8 ++++++++ include/trace/events/mmflags.h | 3 ++- mm/internal.h | 5 +++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index bc8f326be0ce..0ddc3057f73b 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -310,11 +310,13 @@ extern unsigned int kobjsize(const void *objp); #define VM_HIGH_ARCH_BIT_2 34 /* bit only usable on 64-bit architectures */ #define VM_HIGH_ARCH_BIT_3 35 /* bit only usable on 64-bit architectures */ #define VM_HIGH_ARCH_BIT_4 36 /* bit only usable on 64-bit architectures */ +#define VM_HIGH_ARCH_BIT_5 37 /* bit only usable on 64-bit architectures */ #define VM_HIGH_ARCH_0 BIT(VM_HIGH_ARCH_BIT_0) #define VM_HIGH_ARCH_1 BIT(VM_HIGH_ARCH_BIT_1) #define VM_HIGH_ARCH_2 BIT(VM_HIGH_ARCH_BIT_2) #define VM_HIGH_ARCH_3 BIT(VM_HIGH_ARCH_BIT_3) #define VM_HIGH_ARCH_4 BIT(VM_HIGH_ARCH_BIT_4) +#define VM_HIGH_ARCH_5 BIT(VM_HIGH_ARCH_BIT_5) #endif /* CONFIG_ARCH_USES_HIGH_VMA_FLAGS */ #ifdef CONFIG_ARCH_HAS_PKEYS @@ -356,6 +358,12 @@ extern unsigned int kobjsize(const void *objp); # define VM_MTE_ALLOWED VM_NONE #endif +#ifdef CONFIG_ARCH_USES_HIGH_VMA_FLAGS +#define VM_SHARED_PT VM_HIGH_ARCH_5 +#else +#define VM_SHARED_PT 0 +#endif + #ifndef VM_GROWSUP # define VM_GROWSUP VM_NONE #endif diff --git a/include/trace/events/mmflags.h b/include/trace/events/mmflags.h index e87cb2b80ed3..30e56cbac99b 100644 --- a/include/trace/events/mmflags.h +++ b/include/trace/events/mmflags.h @@ -194,7 +194,8 @@ IF_HAVE_VM_SOFTDIRTY(VM_SOFTDIRTY, "softdirty" ) \ {VM_MIXEDMAP, "mixedmap" }, \ {VM_HUGEPAGE, "hugepage" }, \ {VM_NOHUGEPAGE, "nohugepage" }, \ - {VM_MERGEABLE, "mergeable" } \ + {VM_MERGEABLE, "mergeable" }, \ + {VM_SHARED_PT, "sharedpt" } \ #define show_vma_flags(flags) \ (flags) ? __print_flags(flags, "|", \ diff --git a/mm/internal.h b/mm/internal.h index c0f8fbe0445b..3f2790aea918 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -861,4 +861,9 @@ struct folio *try_grab_folio(struct page *page, int refs, unsigned int flags); DECLARE_PER_CPU(struct per_cpu_nodestat, boot_nodestats); +static inline bool vma_is_shared(const struct vm_area_struct *vma) +{ + return vma->vm_flags & VM_SHARED_PT; +} + #endif /* __MM_INTERNAL_H */