Received: by 2002:a19:771d:0:0:0:0:0 with SMTP id s29csp1276640lfc; Wed, 1 Jun 2022 13:57:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDuw0gKXyU1qNuJ1dE5GF2rGTKSUq3MgLh3ULruWoYx+bAeW0JuyIF4ZSS9E6SFRmqT8xx X-Received: by 2002:a17:90b:1e0a:b0:1e3:5e2:2def with SMTP id pg10-20020a17090b1e0a00b001e305e22defmr17293313pjb.26.1654117028268; Wed, 01 Jun 2022 13:57:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1654117028; cv=pass; d=google.com; s=arc-20160816; b=D/Cz2DCfixQmsBv4I9i/GKBtSl/o3s5bHBjJ/85Faagkd+yEbbwegUqAHNHsge4TUc WLkW5wE7P1VGv5gbx8nrQYndlazobssS7ceJipDg8tnl5X6w/m42xjgnNt5wbgz/HSLM A0E6z0nbXMig5YeH54lgZhF6yztvcd/lfZ7guOHoj6vlPnraVwXYgotRg1JjpIKF59PN VBq9jVhKeQDvAJwLu9MX/uBpe8s3YTF5QdLJ06W4PlFkoJ7JbxU9q4VmcrSGqVRbhQNy R/a/ib51QhYgYEKU8FkTTIT9f8rSmmHkvUNuIcAqsMU+VYZQ+TcNEw8CrITLp8orFdNf xydQ== 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=VMQaIG/OBhriPNPriL+sop9nTgThCzE9RiCZit7ucjs=; b=IzUDrMQjVqlfI8nMu+XljP1p4yA+fuNBB6rRUVGy0zLcZD1H8e58kSxkd/P5iI6xrN bRsH4lk2gttks4MWQucyclVnuRc84+2mx08wZWZ4WLujrH/oQpjtjU+JeAWB9qLn4boK E4l9r8p7+3Y/FXxJunPvQd0JrAmLEshuDSTBi3R6GekgKpbMpHVwEDWiR7aJoyWdRUGm QOfcPiv2eFH/+JXgDj/D5jNehFlV8rXVRNxdP6gOIxbQxokg1VYwGgQ4R5tpKh2G2og8 K3qf4NlpEKQntRwchFRqn2G5GKnR9kK+EumN2OV+RFrAw+37Nu/gtJRNqWzT+qpxhEvA EgfQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b=KtjzP4ee; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="mtRFF/uT"; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id q22-20020a63cc56000000b003aafa34cbf1si3363938pgi.642.2022.06.01.13.57.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 13:57:08 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b=KtjzP4ee; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="mtRFF/uT"; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 34C4F2162A6; Wed, 1 Jun 2022 12:58:11 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344226AbiEaRAx (ORCPT + 99 others); Tue, 31 May 2022 13:00:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242838AbiEaRAv (ORCPT ); Tue, 31 May 2022 13:00:51 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CA6869CF5 for ; Tue, 31 May 2022 10:00:50 -0700 (PDT) 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 24VFuxpr000309; Tue, 31 May 2022 17:00:28 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=VMQaIG/OBhriPNPriL+sop9nTgThCzE9RiCZit7ucjs=; b=KtjzP4eefhWUQivcgl6mVDGLdPCR/33Z3gJXeVk4/5rYt9VFRy/fDxKo8hZGC4nSjz59 WipbsG//3jDj2IDkUZN4Ei2OSK4R0K2y+DnYnbL/Ub53RW8x1GXHEVdNFIna8RJ6rcLY tnqIumxcG34DyHI8X94o2HFkuVwTLoiUdW8te4yQ+aG//WEgpyejatkBr/2quoxKiyJ0 YNPzWpkcAsdtVtwgqADV3j4zaQdxuot1Sc/rcAMb4nbgSJ8Kjov8e0jtoYD703R8df8b gAv95L8fv32oFxQ8Wc/CDNVOikGsUnmwf3rHunyTzWaZu3wCJOWyVB5C3G1Sylu6izgD Fg== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3gbgwm5br4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 31 May 2022 17:00:28 +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 24VGpbRu009460; Tue, 31 May 2022 17:00:26 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2177.outbound.protection.outlook.com [104.47.56.177]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com with ESMTP id 3gc8kf5kff-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 31 May 2022 17:00:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bkgyV27ywH7X8FhwigLZx4a90j+7F6hl9ka86oCe2xzpfF8pmacOHEIy7HDEYjVS1Ad6oKcH62Xzyu9AeO3KqK7XQCPUy4YgeN3SrjmNWDp62csOJF1rpW4Tk+oVvgNqr8VoHia1A2aKz7U5hb+UlnQ6Kvsmc8Si3edvhCnwfJXO1+pnl16uccZuP4iey4V0xTOtBL5hWOEm22sbwMDLqh/tfjJb420DN8/8rmKIhjINqbqDgINBiQHneI4BGzI57IFq6xEOsYsmA4kAkmOKJ5BB7sZxVhacjCV8Lkf+BGeF+7O5PhOdi+VssHASx0OvdONfVzTCJNAooB3sFALfRg== 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=VMQaIG/OBhriPNPriL+sop9nTgThCzE9RiCZit7ucjs=; b=ZWBSDNVJijZSbObRTuwifT1Es31H+qOIBn6l3g8JAdRtyZmbTth9hLnW6tZl86tUi4mCTTbp+CiZ2J1tJvq8qWhQZ4fql9q24heqnYDPFsmQvSxxmWiDWpgCkqTo57gctxdhTv29UpdBpas0y3OjS5XINV/+hXEISLJyLte/hP1GkWEcyjjgpXCXyvansoL0h4Wx2pD4LxhkkfnquT9l6Stm/uiPn2EHgGHjrIqntBxt7JO23EYEUa6gwjUaWWcQ92GFOUNaRRaWBa72gE2Z9yLs9B2YWuYgacKAoXJTOec/P+k241pOHTrW54YnWhJrM3rZ/iWcFFt8I6yOyXhyPw== 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=VMQaIG/OBhriPNPriL+sop9nTgThCzE9RiCZit7ucjs=; b=mtRFF/uTHQvh5SUpkA4KBRiY5Xu4m6p1S61PbL20n3UEd8epZl+RfmB8a07K5uwUsT5kqdxXVHEBf8yl+RIdZAtTjoGvsG61d2UuN0UadkmZCjEU4w7cO0yeF9vH9loEkeZqwgYlbOx8kZ3U+rbPuJXP8rCG8/BSfKH7ElYtxs8= Received: from BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) by CO1PR10MB4468.namprd10.prod.outlook.com (2603:10b6:303:6c::24) 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:00: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:00:24 +0000 Message-ID: Date: Tue, 31 May 2022 10:00: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: Peter Xu Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Muchun Song , 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: CO2PR05CA0007.namprd05.prod.outlook.com (2603:10b6:102:2::17) 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: ae3e85a8-1f68-45dd-96a1-08da43270ddc X-MS-TrafficTypeDiagnostic: CO1PR10MB4468: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: jARIKEGVDcRnlDUloFEIB+JgMp6hzYmMbZIa/gvtUR5TMWCmrWOuHIQhTIOfj/sbWFl6gtnAzuJ5FL47p8to7OSY/q7ARTyIF6Hqp6n7egPuFeOSfbI7Dc46nrkXZmoXkhPSbupXi6Q0BSjUzgoT9Jgnqv/ARpl6Mk8z0tAffGLl8BQK7bvLFIyALryBeUudueMBTu8dX7a70KxB1noJjear3tZaybTh0sg0CZ5ZXpksoC0RZ3L+vHyt3MYNmFQQCHbkIufZoWw3nqJ1IzaVz1yyyfGcwKNQf3sUNTiK2ZTIuegnVPijVTPDLNgQS522+QPDuUBXIyQwOFRraI0+1FbjrheEPWhDxoQHpWkCcDKCQqrIYBQFL2RcYFJ8NPBIDcKr+oT80ocmg5gDsQRc06IhL4RvRcpUqAd8GMJI1TgBqJrYk9ExLmCBRX3SSnoYduyxMJh2bUAeEHdeXJdyshYHovg+IL40oNTXDO/EnQWOuuF8Qryl/eNco2EfRZ6hJ+Oaq3KsVs33DRvVITAZUQSK0sMXwDQF8Rmpwy5GFX1rmnDi+zwTysw3fs6+zmkZQdRom2VIHxoFgepPktzZZeTjCQ/BlmTfdhXNk74CMuBdrwfBdZv/xSMwU688V3R9HdAxP10HreElal2dZDBTI/HNVaV2irIvSAn2/NO6Qxi/ZJFyAQbQ5Ut0noLeR/mKBMaDZmRCEeJZHmuTiPGaFx03303phHwC4lykk6FdaDWhIa4f5TJsrucyVwpcdTnOfJZi/W909BRr4c5XSd1zJg== 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)(31686004)(38350700002)(66556008)(66946007)(66476007)(86362001)(83380400001)(8676002)(4326008)(6916009)(6666004)(54906003)(38100700002)(316002)(36756003)(8936002)(186003)(6506007)(52116002)(26005)(5660300002)(31696002)(508600001)(6512007)(6486002)(7416002)(2906002)(44832011)(53546011)(2616005)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TStNelhmTC9wd2hkblZIbW9oc2FoUUl6TzdSVUlIMUJ4a3I2OTZkL2diM2NG?= =?utf-8?B?cXlGTlk3R3d6ZUI0M1owSDJXcWJVdmpHejZnbGU1dUhCdXJhTmxZZEV5QmdT?= =?utf-8?B?MGRsNWsxM3NDaU1pOFdMWlJwTHR5UUZ1QXIxZmFpUDhsWXd4QW0vYjF1TEZz?= =?utf-8?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WNudUhxQWN5emQrdkpQ?= =?utf-8?B?WWdWL1psYjRhUUlEb20rSmozcVVCa0ZZbERNVURGb090RnNkdjNZZ0ozUW9v?= =?utf-8?B?TW0wN1o1ZnlqUnkwaXVTa1BRM0lwTHYwaDErVmhWdnE3MkwzZHlzUWRnazE4?= =?utf-8?B?K1JPQXhsQ0o0bDBqN1RaMDBwRUhUakhWOFptUmVuazFEUjFSWEVuQ3RLYXRn?= =?utf-8?B?L2hiUDJaMzJ1OG9PNlc4RGg3V0E5TU40K3NFK0QyVzIrR1pCUEFXb1AxRmZT?= =?utf-8?B?VFJ5R3p3emJ5cjlnMEx6YVZ1NzVLaDgwdWNQbUovTThzQ05vT0gxUUkyNjFx?= =?utf-8?B?ckNxRDQ1QTNMUWoyNTQvVHpyY0lsbi92aU5US290cjdmZGFGc1hQam1Ub29P?= =?utf-8?Q?HzKEYSGFkDg+/J5Q=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae3e85a8-1f68-45dd-96a1-08da43270ddc 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:00:24.3254 (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: WLbTPR8hmTZIbpUk1Jac8DCmKUMdfmmfBIZ0TWdHUCuXrj00FQE/Mw3ECVfR5LOQXad7l+dR2i8OP28jNvq2kQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR10MB4468 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 adultscore=0 mlxscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2205310080 X-Proofpoint-GUID: lJKn2dSNQk85-MMeq5KuV08Cc1-aHpeh X-Proofpoint-ORIG-GUID: lJKn2dSNQk85-MMeq5KuV08Cc1-aHpeh X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 12:56, 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); > } > > ? > > This is definitely a good idea, though I'm wondering the possibility to go > one step further to make hugetlb pgtable walk just like the normal pages. > > Say, would it be non-trivial to bring some of huge_pte_offset() into the > walker functions, so that we can jump over even larger than PTRS_PER_PTE > entries (e.g. when p4d==NULL for 2m huge pages)? It's very possible I > overlooked something, though. Thanks Peter! I did think of that as well. But, I mostly wanted to throw out this simple code while the idea of optimizations for sparse address range traversing was fresh in my mind. I'll take a closer look and see if we can use those general walker routines. If we can, it would be great. -- Mike Kravetz