Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3346366iog; Mon, 27 Jun 2022 14:10:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tfid6lYJgHl+qtacYtkcni4YD6TL8t+NViwMMNlCUpsWOkvTU7qE7zvoiVO4MnlknAzN0L X-Received: by 2002:a17:90a:1b08:b0:1ec:91a3:532b with SMTP id q8-20020a17090a1b0800b001ec91a3532bmr23744202pjq.160.1656364222523; Mon, 27 Jun 2022 14:10:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656364222; cv=none; d=google.com; s=arc-20160816; b=zm6PT1bXb5lIzp1f2o4CrixGR2xks7vo2m2/BxJpy0V5ePuIroncryUdeBy06TmNTZ nWesboaCiJwUeQ9oX8+aJ6VjnK4ykRHnydSp5aXfWaYxNiYoJzH6scYKt4Ux0uGXdAnk RsTixFcOr3/Zt1jsYUioZQAjCCpkg7txdNPtZGsjRXFBlJJNuMo58jLPx/pt8AHUIPGh 2VnIykICnUA1iNoNaENkU454LIh+ODqgeHkMrLq4bf0jbZxefIkKjeJ35dtl3J0JGSoP xiJVfYC26hcjC7vrCK2i41xdBfbp4g0f+cU1zrQETecaeyb859ApaKGu93ht2tLGmTrp jONg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=xOTqt2NzbHzxCcIdb/5dVCyc4Y5XKzKcuV2da4Pe3sU=; b=Kd5rZRlJx8vxzBuWcSIWUExzoMJv5OJp7ffBh2r4wHi4s3wcNAH9crK77aHA/jgE+q 61eZOllzwrHPn+CupmdP88lP5DjYZyY4bQe/vtzy+lNUuKAKgo+IBqixyTdMuGgl1CVm Jo2XtINAGXU6yKuWTpZhRY/og5tciIgIsd/O5/pvXhkR4wZkqFfi2XQr49G0ORG6bDko sNh+mrWJm95nd+jka9GmYXMbJM37BXjBuoIXtAgYHEkxRziMIFkBFrJXuofkxtqXaBY4 JZkuC8srZPaHLpQaMqT4XJv4yNNE0rFhGxsdHZNP5ZH3653QvppaFPQNa864OfbyBlWx UMGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=s6Yj535x; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i8-20020a17090332c800b0015d168a0c7fsi19166972plr.94.2022.06.27.14.10.10; Mon, 27 Jun 2022 14:10:22 -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=@google.com header.s=20210112 header.b=s6Yj535x; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239281AbiF0UcK (ORCPT + 99 others); Mon, 27 Jun 2022 16:32:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238087AbiF0UcI (ORCPT ); Mon, 27 Jun 2022 16:32:08 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97D8855AF for ; Mon, 27 Jun 2022 13:32:07 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id o18so9224461plg.2 for ; Mon, 27 Jun 2022 13:32:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xOTqt2NzbHzxCcIdb/5dVCyc4Y5XKzKcuV2da4Pe3sU=; b=s6Yj535xe8wTym089FUnEVMRxODSMelDXhtVan3Cukid9yH3HLh30yziKYiBDRvblu P30b4AyjS97fY9wOI4iVI1EvAGdmdwBrvqwt2DN8hgEuCtsx5hyWnaA4P+7D9S8iGkWR /bERQuxrbqvdyvXPJiMcmgsVlzmKNrrkRkrzElirfBltapCX/eJDUWGC8rin0JRfN0/j U8Ba9PsflxyFF/jXjzwhVJJbilgZOWAdpxIO2jNW4xHrF0Znf7A9rqU0/Lu7FR0RMNOx h9VNmZAuXPHKd/ll1zHtx28xlD1Iv2IaexdRsLKtx7Y0UyfLgGv7PzzrXZJMu2tLx+Yu JvzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xOTqt2NzbHzxCcIdb/5dVCyc4Y5XKzKcuV2da4Pe3sU=; b=Btdlg26QDwOq5L4zEjCE0yT2G37quqQALwlBuKqTFeAuj9S75mrC+eg8MB5frPz8EA 7e+ZdWZjsV07LCK7kxd+hnyX6TIdT/zoOEzQu3qpwUbLRqGIPoBcgCm8P6UdatHuLfXu ctpJZT+bEFtQvZeEcYBnq3uvFp9yhCJFCEturZMlWK8xYiZb3lRe+nAYpUFGtn3Btw0D LXYAyQZa8MQIfbngSwdLxNKX1emUKI4e1YXtJ8ZSge9ukl03Pv31RzLJf8dtZYq55bJD FSma2EYlsQJLRwX6vScEByqJdXf7wj2Lv06zQWAU9AcAicuZCzBwJbxy/5Nq8IetNjXh XoBQ== X-Gm-Message-State: AJIora/kEKcbrMMg018nDYIICr9fH4TXtKco/+bIMa0od2At+UxLix7m 83b7LYc1dQawzCyWSwTxI43h6si9EevkpKepdYu6xw== X-Received: by 2002:a17:903:2490:b0:168:d4d0:54da with SMTP id p16-20020a170903249000b00168d4d054damr1318632plw.42.1656361926968; Mon, 27 Jun 2022 13:32:06 -0700 (PDT) MIME-Version: 1.0 References: <20220624173656.2033256-1-jthoughton@google.com> In-Reply-To: From: James Houghton Date: Mon, 27 Jun 2022 13:31:56 -0700 Message-ID: Subject: Re: [RFC PATCH 00/26] hugetlb: Introduce HugeTLB high-granularity mapping To: "Dr. David Alan Gilbert" Cc: Matthew Wilcox , Mike Kravetz , Muchun Song , Peter Xu , David Hildenbrand , David Rientjes , Axel Rasmussen , Mina Almasry , Jue Wang , Manish Mishra , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Nadav Amit Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 Mon, Jun 27, 2022 at 10:56 AM Dr. David Alan Gilbert wrote: > > * James Houghton (jthoughton@google.com) wrote: > > On Fri, Jun 24, 2022 at 11:29 AM Matthew Wilcox wrote: > > > > > > On Fri, Jun 24, 2022 at 05:36:30PM +0000, James Houghton wrote: > > > > [1] This used to be called HugeTLB double mapping, a bad and confusing > > > > name. "High-granularity mapping" is not a great name either. I am open > > > > to better names. > > > > > > Oh good, I was grinding my teeth every time I read it ;-) > > > > > > How does "Fine granularity" work for you? > > > "sub-page mapping" might work too. > > > > "Granularity", as I've come to realize, is hard to say, so I think I > > prefer sub-page mapping. :) So to recap the suggestions I have so far: > > > > 1. Sub-page mapping > > 2. Granular mapping > > 3. Flexible mapping > > > > I'll pick one of these (or maybe some other one that works better) for > > the next version of this series. > > Just a name; SPM might work (although may confuse those > architectures which had subprotection for normal pages), and at least > we can mispronounce it. > > In 14/26 your commit message says: > > 1. Faults can be passed to handle_userfault. (Userspace will want to > use UFFD_FEATURE_REAL_ADDRESS to get the real address to know which > region they should be call UFFDIO_CONTINUE on later.) > > can you explain what that new UFFD_FEATURE does? +cc Nadav Amit to check me here. Sorry, this should be UFFD_FEATURE_EXACT_ADDRESS. It isn't a new feature, and it actually isn't needed (I will correct the commit message). Why it isn't needed is a little bit complicated, though. Let me explain: Before UFFD_FEATURE_EXACT_ADDRESS was introduced, the address that userfaultfd gave userspace for HugeTLB pages was rounded down to be hstate-size-aligned. This would have had to change, because userspace, to take advantage of HGM, needs to know which 4K piece to install. However, after UFFD_FEATURE_EXACT_ADDRESS was introduced[1], the address was rounded down to be PAGE_SIZE-aligned instead, even if the flag wasn't used. I think this was an unintended change. If the flag is used, then the address isn't rounded at all -- that was the intended purpose of this flag. Hope that makes sense. The new userfaultfd feature, UFFD_FEATURE_MINOR_HUGETLBFS_HGM, informs userspace that high-granularity CONTINUEs are available. [1] commit 824ddc601adc ("userfaultfd: provide unmasked address on page-fault") > > Dave > > -- > Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK >