Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1870411rwb; Thu, 8 Dec 2022 16:47:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf4w089Df5Ljq3oH7oY102DtKVdKpq2VfrcUTENnv4/bkJ5VE+zsKd0VlgC57DPTM9+W2o7L X-Received: by 2002:a05:6a20:c181:b0:aa:6716:5db6 with SMTP id bg1-20020a056a20c18100b000aa67165db6mr5842858pzb.0.1670546878608; Thu, 08 Dec 2022 16:47:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1670546878; cv=pass; d=google.com; s=arc-20160816; b=lrR1GOI868GjS292cNBdyy6slOvcm7K8QZr6WO9my+wPImZ/pZUhmzLYvohw4QRLA7 yvetJPPDUbqwD4vK0Yb8uh+jDSveV9MgnSTVeW2KFCOfJ1iJ++2rNOEHRmx7F59LG1YB 9Pe1G8z4kp4tWc29l2eRTxH+TLo6LaanxKp60S0rVhwlGoU5cQUO587VkgBaw4xojm/9 VhYOZfItIxDnHPoZQffv0PHXyDByAOMtze32o1XOYRmYicEsTTELBLAJdYZJv+mb0D63 TtQNsKb4OA2YM9vQ9rIyCgAthtekmGdcfOOo5LWgDuCJEsFcgcb2jk4wkcp4lksmGWi9 v6Gg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=pzJQRi+/wd0aVIuJVqT+3vs+tfpMIp/Ju1SnbmnQwHg=; b=p2bPLFPS7E47bkZtSF0BwIkfRTwFyjMNIFNvoJOKEcqeXzlzixXihlVclPAeXyJG1F Yek4T3MavQHhSCvtNRggCnT7t2SIxawchD52ocetdlfkWN9FvgPZuD8zjQlafLYsuEUl wklP43lmi01sHWPC85Tq4rbOhROsNzTZX0V8DvFIs8ar+x5LQOcUy9rMY5GiZ8bwBQ8X GJ0D9LlOIjxMU/9lPwvvaNTDw/fdN5BzGYvr3jcV9Tn1fmuXeGZ1gcMZ1P3V/k4rpd4X gl7N1vqpraEOmg/zbCiK6uNfW0NV8OZn6XEZBJ2XUvUBu7F3ldGHlH8LQnpkYjgoBLaH G19g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=mqJSukxZ; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="QOlQ+3Y/"; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u18-20020a056a00159200b005763ac23ae3si301753pfk.171.2022.12.08.16.47.48; Thu, 08 Dec 2022 16:47:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=mqJSukxZ; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="QOlQ+3Y/"; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229606AbiLIAXh (ORCPT + 73 others); Thu, 8 Dec 2022 19:23:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229719AbiLIAXe (ORCPT ); Thu, 8 Dec 2022 19:23:34 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FC2582FAF for ; Thu, 8 Dec 2022 16:23:33 -0800 (PST) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B8MIpoO021255; Fri, 9 Dec 2022 00:23:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : mime-version; s=corp-2022-7-12; bh=pzJQRi+/wd0aVIuJVqT+3vs+tfpMIp/Ju1SnbmnQwHg=; b=mqJSukxZZ+3NqrzFlrhf8qJaNXiRMUKSyoktbiwseZ4y8HoRmkjx4oQGDEIoSL2SFGm5 TOYo9pS6GYVsLjjyLSdO1qF1NYihb6rawMo/wsV6S8x8uoCbp6ZvNyvliwFe9KfV48mX 4miC9E/W7PJDHZiEVSu0ecuBKTyGx2mORSyfUlnYpsd2/AMwcwyFSDK/oAM4Uz5iHQ9L 7We8L4A4FkPfaSDGFWSDd/2kcbrQp/dHV+8EHD5WOHwVcsxN9Pzec3ospWpiBhJuRxaL 1j4vh/ZLHIOMlsOWZ/P4EindK52hr31mhaEpOsAcqgE2I1wCK1Cq0gV561xKP6REB+jM 3Q== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3maud748f4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 00:23:03 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2B8NmHN6025454; Fri, 9 Dec 2022 00:23:01 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2172.outbound.protection.outlook.com [104.47.57.172]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3maa80f01j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 00:23:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZCaCo8IvBFnqCBNRMFTT15ersn5UsQoLmgrp04ZwK7VUnBcYcEQlXUN18VsdX6tI7L9oxzcAPXTe4tMK920Eypz5ABfpDGTM9KIYbX0MZXTTBXZUZw5AEKeL1f40mCz3MQiWCvhx93bDG6gu2jkSfPD0da3+C4BbqbuRskFj+oPFKbOAnVRgU5UffsqJ8tNgqJgVyG9MZCEZiQcT77SQPG1eLLHZ4r/aCabpfstl96Xn62UqdrpyyUlqvn9Ur3NPGGW3xavoMOlfGLiTg6+U6sxcxpznW0vs6a5O3hSPkq2wLVM9ods+wi6FViV3S3RU185p1XV2cKFkNQq8UulLog== 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=pzJQRi+/wd0aVIuJVqT+3vs+tfpMIp/Ju1SnbmnQwHg=; b=O7aF9hlMEEY3p4Qdn/uPXi+QxPvmBl4HLNffMMsx2xuOl/6SqM1go80uBSroGOOQRnRqNwZjez/jphhIW4Hhzwlpe6mCEIzi8OJqqIsK3VAPwL/T4WgLlEb10zBbT41ERfSyPMIhVW388ddX3G02gnEIBuMRYvs1wQpT61brK0mMVQcFIJW8R8CAdAbhvKv3G3eeK83/liysFHt+tYPSb+tJN6/5AzcaMamUbBbfFOex82JoOXMim6eZQIx34X4l8CkcIhuR0EcwN569BlGcDELLor259hyro6DFeoCCS44Sz2MiIJRFv+PheBVB+7PDJoMArzYJJ6+LT5rnqWWfhA== 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=pzJQRi+/wd0aVIuJVqT+3vs+tfpMIp/Ju1SnbmnQwHg=; b=QOlQ+3Y/5s2tV+d1Ll/WPM3VuoTwKi8JX1p03z3W0CYketRk7yq4g9Gl6WiENTZzSEdYn9VzUE4Js0fWgqhHok4xxssCzNmjH89S2ZYO/M/Nlfp/I1RZyVTq2WqtXD2Rj8IeQ1/ahMLg2O7FVY640D4gGggemd1Uy5rFn7pZ3P8= Received: from DM6PR10MB4201.namprd10.prod.outlook.com (2603:10b6:5:216::10) by SJ1PR10MB5979.namprd10.prod.outlook.com (2603:10b6:a03:45e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Fri, 9 Dec 2022 00:22:59 +0000 Received: from DM6PR10MB4201.namprd10.prod.outlook.com ([fe80::4786:1191:c631:99da]) by DM6PR10MB4201.namprd10.prod.outlook.com ([fe80::4786:1191:c631:99da%4]) with mapi id 15.20.5880.014; Fri, 9 Dec 2022 00:22:59 +0000 Date: Thu, 8 Dec 2022 16:22:55 -0800 From: Mike Kravetz To: James Houghton Cc: Muchun Song , Peter Xu , David Hildenbrand , David Rientjes , Axel Rasmussen , Mina Almasry , Zach O'Keefe , Manish Mishra , Naoya Horiguchi , "Dr . David Alan Gilbert" , "Matthew Wilcox (Oracle)" , Vlastimil Babka , Baolin Wang , Miaohe Lin , Yang Shi , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v2 04/47] hugetlb: only adjust address ranges when VMAs want PMD sharing Message-ID: References: <20221021163703.3218176-1-jthoughton@google.com> <20221021163703.3218176-5-jthoughton@google.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221021163703.3218176-5-jthoughton@google.com> X-ClientProxiedBy: MW4PR04CA0174.namprd04.prod.outlook.com (2603:10b6:303:85::29) To DM6PR10MB4201.namprd10.prod.outlook.com (2603:10b6:5:216::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4201:EE_|SJ1PR10MB5979:EE_ X-MS-Office365-Filtering-Correlation-Id: a93c5944-2839-4b7e-6203-08dad97b8660 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UgcBB24649rMPcKkSrsak07Lcuroye4n8qZioE9qSh5wop26cAqYqEOYt1tS0nSfgH9BnCWyBz8MhLt5LohwAB1XQdscgBvXWTmNFrEmt9caOObIOCTplhGOIE6E04NLFG0cQYZFcubbca6S/XQTFwrbd0FRM+GzeF0rbwH7dzUP2srSypvYd4U3MVXcYfFI/PKNS5tp6voQmHlt8T29Mle2V/xkRIrAHyQqNrpwjBjLoZKKhktaZEmyJZ0JlZIWAAz6Myr9qgyblNVUFGzEGtQKj5s28ID6l7CgmYqwYTrAsNlm/DQMOfBg6YiThgSl9dPICorNCB9SV6ibuhSp9mzskLPSFO15QH8VMjleuMrIexs7xY+oHm7ySwGCpnr+SYWmZTljuGjB6lZuQl/6TmTlRjTaciFn+83KFOAeMUrZfkl6uPqsnbt38Ci8ana8UUlMCLxRDdszfla6UbGTp6OuBRih7NK2/V/HV9UrcW751tO2cTRUCr5EraIG7Md6aOg34rn8ah58zSxXiF4HAsBDP/6CU6hBh29T5rVB7ar7o1bRtIZGhZeGcEGoWCVlV6O8yafb67mN4z5HcnhlJXuwrUNU+RSo5A3Zw5i1O6/BOOjBUDz5MkrRF1BtZlTPjt9l+p8tbo9jYm3zZpddRQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR10MB4201.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(7916004)(376002)(396003)(366004)(346002)(39860400002)(136003)(451199015)(66946007)(66556008)(66476007)(8676002)(5660300002)(7416002)(4744005)(4326008)(6666004)(2906002)(44832011)(8936002)(316002)(6916009)(41300700001)(6512007)(478600001)(6486002)(54906003)(26005)(9686003)(6506007)(53546011)(83380400001)(33716001)(186003)(86362001)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?uu8Iz+NKeI4eOXGDC3VyZBlWveUuyRvfTGpfMU0BgiByAsjjxP1QPSIhEVso?= =?us-ascii?Q?rn7xsW5JagU8jwZtSD+S/d4jB7sw1FGzirl7Kr18jg2uI5onfddvFOIuJ1+7?= =?us-ascii?Q?0fcj5AJ8reN9fXeQjFH7w/kuIR32vl2xcd82shuHn8KMjybXn1z0N0wIz7ra?= =?us-ascii?Q?EP9jQ2IeDdVJptpYPBg3VsEHhkc/CrPOap0LoyuwKpp6nEshJelZ6J8Bwz0p?= =?us-ascii?Q?JWrkjJrLGFxhYXKamSPs2nZMdU3xMvJM98iPqNA0FEewwdAJvpmHy8jxr7C2?= =?us-ascii?Q?HTiw2xIDoVFMOSgimVfgIe/cFBrDkOw5Jn38JFBetfxCXTNnTFbTYzVUaLJm?= =?us-ascii?Q?kJLW8MUnn7lCigzo7uj5/IedmZZjRCLKcKQ6EZ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H4u28C+OFhlt4QNyRxjODQ7D/3dgFLzLy5ol0c+mkrHYutk7mEPyzm?= =?us-ascii?Q?Yj6pb+ZAZaw0trgJZWzKDv3XsV3b4BcbNug48nyF8Tf/wGMChBh+RGU8h3ux?= =?us-ascii?Q?W6h7J1PDMDMBZ0uAJ5pxqtfmLM74MVMHFCP728wAsSphpuvypAMpkVLQhuU5?= =?us-ascii?Q?0odaMAlgwzElXgmtQdPhoY6zJ6tZOM2x/n2x5rvXPUR1bPDj5X41hqd2jktq?= =?us-ascii?Q?LxDRr5uc6m6PCVpgAiu6+/MvhvFgKWWBNFyOe44hxnhaCgq+rVF4ZyYcBzRi?= =?us-ascii?Q?JBe3Zf2wOl6zXv3otlOo0P89d/w+evI3yL7AfqeVkP9ncRPVW1DMpuc/Er1b?= =?us-ascii?Q?wg=3D=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a93c5944-2839-4b7e-6203-08dad97b8660 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4201.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2022 00:22:59.0638 (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: 0aA40ZXM/vbfQQ7YbFDhNDDoPrkdkAaH25WAPtdAMuF2/tA4VcKSDWNHPYtVmotzhzaMOiHq+OJOoadFk9A4Pg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR10MB5979 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-08_12,2022-12-08_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 spamscore=0 adultscore=0 suspectscore=0 mlxlogscore=901 malwarescore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212090001 X-Proofpoint-GUID: R-dm8ness_-HkrrA-k9eOf2rxhTFvOW5 X-Proofpoint-ORIG-GUID: R-dm8ness_-HkrrA-k9eOf2rxhTFvOW5 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/21/22 16:36, James Houghton wrote: > Currently this check is overly aggressive. For some userfaultfd VMAs, > VMA sharing is disabled, yet we still widen the address range, which is > used for flushing TLBs and sending MMU notifiers. Yes, the userfaultfd check is missing in the code today. > This is done now, as HGM VMAs also have sharing disabled, yet would > still have flush ranges adjusted. Overaggressively flushing TLBs and > triggering MMU notifiers is particularly harmful with lots of > high-granularity operations. > > Signed-off-by: James Houghton > --- > mm/hugetlb.c | 21 +++++++++++++++------ > 1 file changed, 15 insertions(+), 6 deletions(-) Thanks, Reviewed-by: Mike Kravetz -- Mike Kravetz