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 403B8C433EF for ; Mon, 27 Jun 2022 20:32:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4A4038E0002; Mon, 27 Jun 2022 16:32:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4548D8E0001; Mon, 27 Jun 2022 16:32:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 342BF8E0002; Mon, 27 Jun 2022 16:32:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 25C228E0001 for ; Mon, 27 Jun 2022 16:32:09 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id E951F80FE7 for ; Mon, 27 Jun 2022 20:32:08 +0000 (UTC) X-FDA: 79625162736.15.1C245B7 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by imf11.hostedemail.com (Postfix) with ESMTP id 338EA4002A for ; Mon, 27 Jun 2022 20:32:08 +0000 (UTC) Received: by mail-pl1-f172.google.com with SMTP id b2so2201598plx.7 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=NXRl63ZdqFDzfIdUcaAfNiz0DUw3APOJ5mFxoLGZlXGuaAjpzyk0ZFLHLnl1EzM1Lf XWLOFag2Je3VZUahQDWYsrmyBpvgiMsXF8BvY3nDCprQjo6xSguy4qqhDmTm+bdgeQeT Bc5eikN8XIDNzcnv9yT+kjmMLKjTInkISuETURk84pmQQuzW5isLX1QCRxMV/agLv8jA BM5AYU3dN+Nro8sv5mBJB6lvk8KrrMIbvtBT9oXtnqDvhfpvRbx7jSPH4cx0k51CSIjO mc8A19BZhGHRQr+WSqMB3mRh3DbCNJIHU2ZS/ipMAOS6mIHuUYthkqYMxre/01waVGAI DSlQ== X-Gm-Message-State: AJIora948C8hU8QsgLBWvFscXBrcDXF8BKCC+M/UKXVcOsVXiO2M9WeF W6n7ngnT5FIxlqxKoSdeIAAzWiE1b89KSMQYWGUyMg== X-Google-Smtp-Source: AGRyM1tL3m0Ue3Q02NUf5oLxUMDrlnFmH2h/VNVw51AhvJZgkgIrzjV2QPv0tm5I6IupzaASk3eP5iJpRAPtCRDk3rE= 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" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656361928; a=rsa-sha256; cv=none; b=g2VrNvBLeAMwchlTCzdN5WS6GMx/ncn+f8BkT+VfY0xIeoW5PMXwOBGOLmDfYPCqJ4DauL z0vn5AMxKdxC6cBPiYocaFHLBgDLDyB+Ms/8to6G+/H78rK/hVFWKHMfJ3D1ZIGEZN8IXb +bUi/6sSMtlABU2WTsRmHkUPH5QV15I= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=s6Yj535x; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf11.hostedemail.com: domain of jthoughton@google.com designates 209.85.214.172 as permitted sender) smtp.mailfrom=jthoughton@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656361928; 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=xOTqt2NzbHzxCcIdb/5dVCyc4Y5XKzKcuV2da4Pe3sU=; b=0irVSezvuXULACqlcxdcp0wizWeQyPsDnjsGvhahMmfqoSZRd1trdJ9VTpQA77iKGcnqHk tqqbzO0X0S8vRQowTEPYi4Gaf4Wjl521kL5cbnxqkCZ06lBIGpVbXyXtPcpWC2fC50F8El T5YgZi9JqezdDSw4/ndAzSgnkWp/6Bc= X-Rspam-User: X-Stat-Signature: kkwe89i34jmqz37g6bjm7o74ptr1a3dh X-Rspamd-Queue-Id: 338EA4002A Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=s6Yj535x; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf11.hostedemail.com: domain of jthoughton@google.com designates 209.85.214.172 as permitted sender) smtp.mailfrom=jthoughton@google.com X-Rspamd-Server: rspam03 X-HE-Tag: 1656361928-851479 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 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 >