Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5428115ioo; Wed, 1 Jun 2022 05:29:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRl4kwM/gQslNTfOlvYWeu3KBnrUe4BrmE1RnKHJgRqCEROzHVG27Y6gLxZA0tlQhjVUf4 X-Received: by 2002:a05:6402:3312:b0:42d:bf2e:1869 with SMTP id e18-20020a056402331200b0042dbf2e1869mr22495705eda.348.1654086570841; Wed, 01 Jun 2022 05:29:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1654086570; cv=pass; d=google.com; s=arc-20160816; b=pi7et/PQRbcY8N9zvAzhVHgIkyGjHSTNgRkLXSy7M7yUHhcsyrcz0K4WTm9wU5SrLk 3LBc08n+70nw6A/JWc5gsgZmpIaSykMXn7O8C7EV2LPC3XbdVNVTFT1WvyC+LQLHLGku 3BH9KPmo4HvKZxmU2FVfZEto8ZwjbTmw6LE3LoWW4obl98vwWGJcVTwQAAM4P6ZJBnYn fNCLuozzZLFaL9JAzWa6y4zbwyu1KTgeiW+gXwgKX0r0NFYwTw1YwYuqEn5bHyMrW2+J c0KHcrpqdtIBQgUGEI6smoq+REXicnm2Tav1lHwWKf8I03tKn6PmxNzhgV0LwD9ImMlD BQrQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature:dkim-signature; bh=Xiguyp3NbD6/X0Ke2hFELDlS5vee0Gh2mXk/DVfofpA=; b=HXyNPCmCPTS0TTUHlP4VXREyulJ/Zr45W6mWm8sKohmBdSVdMA4A6/dhpa9BS0Qsyk 1T3sMYmBsViBwVpkNO305bsMz/0KvUXc7R+o7iV4k5m6Z9bUAmNV17hA+aVU8UkwyCZC +5kLOcZrZSjG16qdjbXcqDm1Jo+VHkBqfT2NfSwyl3PMLgyJrc9ZbR7RFpYC4CfaYf2U PsSEI9w4bfPwXDIZTIgQcZDT1JiFwZy3gHV24bG84Ty1ED5aGDT2funvSTUGXN3QFvA+ AKdIImRlBi0PMcvPGO48Lr82l1aH1jaeHDHBB/NtZ8lFmYaO1BSjyauJDmRqMqajuIaV 8hSQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b=GIL2Vc82; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=U+yn74fN; 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 ec27-20020a0564020d5b00b0042df84a89f1si1568720edb.138.2022.06.01.05.29.04; Wed, 01 Jun 2022 05:29:30 -0700 (PDT) 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-2021-07-09 header.b=GIL2Vc82; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=U+yn74fN; 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 S1346422AbiEaRFt (ORCPT + 99 others); Tue, 31 May 2022 13:05:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346410AbiEaRFq (ORCPT ); Tue, 31 May 2022 13:05:46 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CCB88DDCC for ; Tue, 31 May 2022 10:05:45 -0700 (PDT) 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 24VFuWca007300; Tue, 31 May 2022 17:05:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=Xiguyp3NbD6/X0Ke2hFELDlS5vee0Gh2mXk/DVfofpA=; b=GIL2Vc82wdP5zGTziivLfwPhm9U1jgDR70jZwf171EHos9Vev6QVgtUP7gVXU75AhjVd pln1F4v7/x+pxpLiqcog92I3caiHzPFjtu8mVlOh/qvi4KaGiVX75/FySg0Nl4l05hY1 P/1/z9vcRIdy3p8d/5+dvOpglypKmXI26aEDX+Ll4o//R7nDyvgGUU8VT6LGKIOAv8Oy DMAejfWR/JbYZmy79nZJ2aGcgPbWkEnUwwgWfW0YEVrJqAwKGM3TzQR6R58KiuBPSgIZ P0jW6vsArC9NieHZXthEmxpyLwE0LkdJH+H1hlOuyPdQpXQ5Tzwu7eZ+OlgMTVOIgffO 2A== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3gbcauns6y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 31 May 2022 17:05:27 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 24VGpRgL036599; Tue, 31 May 2022 17:05:26 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam08lp2040.outbound.protection.outlook.com [104.47.74.40]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com with ESMTP id 3gc8jxfcmc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 31 May 2022 17:05:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rlru86Hmmo0QjqK/D+FvjCTjg9lLhfTphlNbbzHrz3NEyD5nMz4DtrpPIONSigICUYibs0ZulGdkC8Y4WJao+lhyMHmqG3D5HDpOMU6o8mT2UlR3RPzwhS+z/VA5kI3WqynS4CngViCvTdfxwTjQPtPvSBcuxuxq3mU9bH32xBb7twNnwlHmQjzB377A5DbI+hHRC4HQaBm8Mvxo6rdqLmhNZJQ/l/jgpRw1aT4/+Bb14jplfq6DSupBcHnxBB1Oe1IzmheS9VQAwTstDqzEj6HjfXVPGqkxNDN5tFEeHsJDx+TdIHGSrlFzAuNHe5htznFawGmDw9ECzSakxXqcvA== 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=Xiguyp3NbD6/X0Ke2hFELDlS5vee0Gh2mXk/DVfofpA=; b=QjTmXF758P1BGLzHUtQzt03g6gd7zLahxhcixuE6MFbW6MEpOPwGPUdKGs9JnJnEL3sRjIJlXVHnVuYm2CxuzC8DSrjA7E7PVROAMfFl3tblqC8HzP3gFun5eEEfcMa0rD6X41v21V71T4DFbLhxoo7POysrEOgmlGxxDzOjPHZnzxNQnCds4Qx6ikLqe5dY2vNo42MQAQNamLFIb5Owl5r8pgJYAMWVPBbckn6rI9gZwFd+23mv/IXC0H/yl+Cd8Chw/IkaJo3UPWiK2y0gtAcNWxhtMt1OcPdGR9aBYNbOcQAt24Mb7G3ZSqq50wgbAG0yKIfQcWcvduNkNqd0qg== 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=Xiguyp3NbD6/X0Ke2hFELDlS5vee0Gh2mXk/DVfofpA=; b=U+yn74fNb5OTvL5zk/Ua25e9+Tl3MJxNkf0FumNNNMnPtG8Qpg6iIlaubd4+LSEYBxEL62ib32FHt118CBkU2H7fwipoO4UCrhKNosj9zdx4OqpLASlSoNhOCw7WGw4oYVpHJBihOymbDfCz3hTJDIcz0Rt3vMIpZ3aIK4uxZ2I= Received: from BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) by PH0PR10MB5529.namprd10.prod.outlook.com (2603:10b6:510:106::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Tue, 31 May 2022 17:05:24 +0000 Received: from BY5PR10MB4196.namprd10.prod.outlook.com ([fe80::2125:9bb7:bfeb:81f9]) by BY5PR10MB4196.namprd10.prod.outlook.com ([fe80::2125:9bb7:bfeb:81f9%9]) with mapi id 15.20.5314.012; Tue, 31 May 2022 17:05:24 +0000 Message-ID: <95bd9375-36d2-7e34-83a8-d9eedfe70956@oracle.com> Date: Tue, 31 May 2022 10:05:21 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [RFC PATCH 1/3] hugetlb: skip to end of PT page mapping when pte not present Content-Language: en-US To: Muchun Song , Peter Xu Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Michal Hocko , Naoya Horiguchi , James Houghton , Mina Almasry , "Aneesh Kumar K . V" , Anshuman Khandual , Paul Walmsley , Christian Borntraeger , Andrew Morton References: <20220527225849.284839-1-mike.kravetz@oracle.com> <20220527225849.284839-2-mike.kravetz@oracle.com> From: Mike Kravetz In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MW2PR16CA0036.namprd16.prod.outlook.com (2603:10b6:907::49) To BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2b4be85d-6743-48ba-661f-08da4327c06d X-MS-TrafficTypeDiagnostic: PH0PR10MB5529:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FTKFEJLP8cYa4XCIrtdR+GexH90XKwXJW7p6b38ap9DH5ZmlI+F8hD/GoGmoHziP+y+n/EDJ68031drCBnK/fcemaFiSWGyNT15Oan6VJX7qb1sSHMNQBAN+ke29xmu6n5kKLNOquyOfjqbHhbXP6k/8+yKv6PR+DB785zZRRCS5svGAnNHLWfHiVoTVibSHXp709CnrzwQcPzMR9o1nZIkyxt/1T+6ofeBgfI/nbR8dXiadxsyAHFTBinUwfJNCwn0BDGszb5QvbQMkHRKQzJ8EvlOBSDMwhnlbGUj26d+GmlSimZ5D5ybH7Nlnw31UeI+eLKJfzkQ//yDv+4O8nw1KM1l+JJyq7LsxLgn+8audVS9cmk7g3keb7Hp0Nbi/euMLDysL+iLPYEXXheoVuM8fBzrG3vlhULeNMOmrd0bTjpetiosGlVWoAHKmOEv7MKiHfxCsax70vypRKXefZOfsPSTJovCdYsFdpiTzZiAe+W0OJ7hM8h9Nhe9uO4uPc+pxLKZbgJYAyDViWXygXmZ7ofo3RdXLwBj2WSuNFbPFvRyo2HOWOlm3jv5fP15xIC0/b+oea47NBXL7IXuiV6/2Nte+vbdgsRiciuVXSq/fPTUfLxauV+RwXHpKRrOFOxXY5fUBY95y6YD02VSzHNHli4VRgQZbtX+RchPbRPMCWMpC8s9/PnxNw6bpUS6YEQKMlmPE540jG2Vt4yFh1lJN/E4XQJPdLhsg8S9lTUNxnBaYS4fA3m7ueXmFhjVpcIj+3lvCZKr5RctgFWLHsA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4196.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(54906003)(66476007)(66556008)(66946007)(38100700002)(31696002)(4744005)(36756003)(7416002)(38350700002)(316002)(110136005)(2616005)(8936002)(86362001)(186003)(5660300002)(52116002)(2906002)(508600001)(4326008)(8676002)(53546011)(26005)(6506007)(6512007)(44832011)(6486002)(6666004)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VDFhaEwwQ1JVVTFSaUh4SFlZOGt6NDRZYmtiY0k0OEJVSnRyMWR2UlZlVHVu?= =?utf-8?B?Si92RkIzejFHMU1uc1ZybVlRdnhBZ0d5WStlVUdsTW1KQU9EK2tVZks0V1M3?= =?utf-8?B?bVpDOVdELzc3UlY0WnE5Uzk3R3FybDByZDkwVk1KYis0Y1hFbnBlbGU5bldp?= =?utf-8?B?bi83RnJSdkxPWGlleEh3bFdJcnZlRjVsYWJIOVpKMHJRaG1vbm1kVm1PV3kx?= =?utf-8?B?VzhzRThvci9UTUtiTGVxRGUrVEFkWG5QRVBQak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B?NFk1UDFGT0psbTdmc2l6WXh1ekhqVGxOVUZuVXNMQnhQTHMrckpNcVVUM0pM?= =?utf-8?B?dHlTOE9nK1JxVmMzbnE3S0Fod3d0WU9zZHZGRENEYTIvV3VJdjVQSlV4SkZI?= =?utf-8?B?b0o0d0YyOHVPMEEvazlCekZNYStRbk0zb1RHU3Evb0FqN2FsTkw1cGx6N3Fn?= =?utf-8?B?bnovMmJKS0wza3NzbHVDYW5TRTJFbVRWZlU3M0xVdDU0U2cwa3lWVXRxSHJE?= =?utf-8?B?OWt6K1ViWWwxcXNGOXU1c240UitUb0J3UnFaekpGQ0RQSUtSNjNZaWU4M0RS?= =?utf-8?Q?LYKq3V6BLuJWCM/8=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2b4be85d-6743-48ba-661f-08da4327c06d X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4196.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2022 17:05:23.9245 (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: Z8n+1UOPi9lXnnwfJgJamq+F5i5Yl2RwfaU4IhNbmRUUGQM3wY8EufBPFCzewcfZT69ydmmmmuI8DOAgX8nv8w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5529 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517,18.0.874 definitions=2022-05-31_07:2022-05-30,2022-05-31 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 suspectscore=0 spamscore=0 phishscore=0 malwarescore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2205310080 X-Proofpoint-ORIG-GUID: z7rcaOZ2SRZvtErotTyi53r8uauLW7dB X-Proofpoint-GUID: z7rcaOZ2SRZvtErotTyi53r8uauLW7dB X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 5/30/22 19:04, Muchun Song wrote: > On Mon, May 30, 2022 at 03:56:43PM -0400, Peter Xu wrote: >> Hi, Mike, >> >> On Fri, May 27, 2022 at 03:58:47PM -0700, Mike Kravetz wrote: >>> +unsigned long hugetlb_mask_last_hp(struct hstate *h) >>> +{ >>> + unsigned long hp_size = huge_page_size(h); >>> + >>> + if (hp_size == P4D_SIZE) >>> + return PGDIR_SIZE - P4D_SIZE; >>> + else if (hp_size == PUD_SIZE) >>> + return P4D_SIZE - PUD_SIZE; >>> + else if (hp_size == PMD_SIZE) >>> + return PUD_SIZE - PMD_SIZE; >>> + >>> + return ~(0); >>> +} >> >> How about: >> >> unsigned long hugetlb_mask_last_hp(struct hstate *h) >> { >> unsigned long hp_size = huge_page_size(h); >> >> return hp_size * (PTRS_PER_PTE - 1); >> } >> > > +1 > I like this as well, but I wonder if we should put something like the following in just to be safe. BUILD_BUG_ON(PTRS_PER_PTE != PTRS_PER_PMD); BUILD_BUG_ON(PTRS_PER_PTE != PTRS_PER_PUD); BUILD_BUG_ON(PTRS_PER_PTE != PTRS_PER_P4D); -- Mike Kravetz