From mboxrd@z Thu Jan 1 00:00:00 1970 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 BE0B2C433FE for ; Wed, 16 Nov 2022 22:02:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1E4286B0072; Wed, 16 Nov 2022 17:02:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 16D868E0001; Wed, 16 Nov 2022 17:02:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F28E16B0074; Wed, 16 Nov 2022 17:02:22 -0500 (EST) 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 DDB666B0072 for ; Wed, 16 Nov 2022 17:02:22 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id A8A2B120879 for ; Wed, 16 Nov 2022 22:02:22 +0000 (UTC) X-FDA: 80140679724.28.0E7A44F Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf18.hostedemail.com (Postfix) with ESMTP id 1009A1C000F for ; Wed, 16 Nov 2022 22:02:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668636141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BY9O302VhdNnvghm5TlpWtvjP2cBGB1kArLY14MpKJo=; b=homPiDZjRk9l7cq6Dbf7rfXcuT6BpUnSriqhfO4epQp3TKWU+B0/vT61ClKgLCL9ORheXT FPHwtU/oVCCJehMCO/09mlp4anWoQXJFcUJpZzBumZp03ewh0lnqqtLM+AljAov00BxCZd bVNTsIvu5E6TWqBQa0cyFUlDRpVLBsI= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-646-66Vv-jlxN4yv1fucopu60w-1; Wed, 16 Nov 2022 17:02:20 -0500 X-MC-Unique: 66Vv-jlxN4yv1fucopu60w-1 Received: by mail-qv1-f72.google.com with SMTP id on28-20020a056214449c00b004bbf12d7976so14432719qvb.18 for ; Wed, 16 Nov 2022 14:02:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=BY9O302VhdNnvghm5TlpWtvjP2cBGB1kArLY14MpKJo=; b=6EUcsBaH3y5xx7Gz/YgvaswM+5CrZei0Vg+mnj5SCw01hMzjscB7+8LPGjRLvmq47b XqgSyU0cT45ZFMaY6n/hOZiKWXlwau5HpWd/SRLQi5P0MTm220RQnqyXtWOc86pPkAdi IZdp2OC5fKH5PtVAU4INSStOzSFul9ybygLtsG9Ss6z5TPLwNTxJzsdMqtUpReo4vjRh It/5uUPT0GYI2mtfyrM0DJ0/h5qfgGAboRBeS0c9wa6Yciglo0/Xqox2axsM3y3C0OUm NiOxZBglZ9R7E20yodyMJPxvO3p6D4kIYwYI3Nqfd0j4zWYSccKKVMPlSWlIY4XZeHrL tZTQ== X-Gm-Message-State: ANoB5pl5Nf7auaHU9jDvuCzL60w6S0cp9MKw9MXhNbl89XpEbPxo+Iez JqV9Sv4IUFCojP6CH8daZNMYVCJegC+PzSky8AQfDEcMwhNbmR0m628ZDFg2OsXmkirQe+rHSGB XOmT7NgOZqko= X-Received: by 2002:a05:622a:4d0b:b0:39c:44cd:34a9 with SMTP id fd11-20020a05622a4d0b00b0039c44cd34a9mr22807410qtb.220.1668636139504; Wed, 16 Nov 2022 14:02:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf4s3cQI/U2jAJJCBABw7M2A/48iWaBEFWkG0fZ/T9P/Nw67+2nSYaaDK3z0I2utu787UrL2bw== X-Received: by 2002:a05:622a:4d0b:b0:39c:44cd:34a9 with SMTP id fd11-20020a05622a4d0b00b0039c44cd34a9mr22807371qtb.220.1668636139042; Wed, 16 Nov 2022 14:02:19 -0800 (PST) Received: from x1n (bras-base-aurron9127w-grc-46-70-31-27-79.dsl.bell.ca. [70.31.27.79]) by smtp.gmail.com with ESMTPSA id s1-20020a05620a29c100b006faeecef56fsm10884101qkp.68.2022.11.16.14.02.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 14:02:18 -0800 (PST) Date: Wed, 16 Nov 2022 17:02:17 -0500 From: Peter Xu To: James Houghton Cc: Mike Kravetz , Muchun Song , 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 12/47] hugetlb: add hugetlb_hgm_walk and hugetlb_walk_step Message-ID: References: <20221021163703.3218176-1-jthoughton@google.com> <20221021163703.3218176-13-jthoughton@google.com> MIME-Version: 1.0 In-Reply-To: <20221021163703.3218176-13-jthoughton@google.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668636142; a=rsa-sha256; cv=none; b=HkfgUF1ammrwoCzYIOMC7N57snxSA6LHoE0hwgCFRJDRCbMBrphdE09hRGv6/bcSPFEWye RykyZK+iJOl45B8gRHCqEpznbEjCdhKJy/dG2ee+HspD9IH27M73TqJ0co2+0oalwW3TmW ELni37knteFianK72Jo/v+UxxwOypW0= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=homPiDZj; spf=pass (imf18.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668636142; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=BY9O302VhdNnvghm5TlpWtvjP2cBGB1kArLY14MpKJo=; b=DGJ8B/PQLX49qu49kBDrIw559/kkVmOStMaUOIFKAdsou7ivBkaUx6SpAkrL36A/TWpQjQ c08YBIoSFifxT4Nf1avT+qC+bjTULAqGD+V/CJmT4pbN4r9xW2ihqyzj4pAf2DG/c6KwcU ZyJUfuZOhoX5m5OAcrMP3xn+8x9PC1A= X-Stat-Signature: yw9qcmqrp46hhxy4kdwcp31s9oj69enc X-Rspamd-Queue-Id: 1009A1C000F Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=homPiDZj; spf=pass (imf18.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1668636141-992747 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: On Fri, Oct 21, 2022 at 04:36:28PM +0000, James Houghton wrote: > +/* hugetlb_hgm_walk - walks a high-granularity HugeTLB page table to resolve > + * the page table entry for @addr. > + * > + * @hpte must always be pointing at an hstate-level PTE (or deeper). > + * > + * This function will never walk further if it encounters a PTE of a size > + * less than or equal to @sz. > + * > + * @stop_at_none determines what we do when we encounter an empty PTE. IIUC it is not about empty PTE but swap-or-empty pte? I'm not sure whether it'll be more straightforward to have "bool alloc" just to show whether the caller would like to allocate pgtables when walking the sub-level pgtable until the level specified. In final version of the code I also think we should drop all the "/* stop_at_pte */" comments in the callers. Maybe that already means the meaning of the bool is confusing so we always need a hint. -- Peter Xu