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 E5512C433EF for ; Fri, 15 Jul 2022 16:35:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7D5D1940200; Fri, 15 Jul 2022 12:35:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7865E9401FB; Fri, 15 Jul 2022 12:35:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 64DE0940200; Fri, 15 Jul 2022 12:35:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 52AB79401FB for ; Fri, 15 Jul 2022 12:35:33 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 2C53C81429 for ; Fri, 15 Jul 2022 16:35:33 +0000 (UTC) X-FDA: 79689884946.30.61E68B3 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf13.hostedemail.com (Postfix) with ESMTP id 0D2DB200C2 for ; Fri, 15 Jul 2022 16:35:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657902931; 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=hbKyrXjYLCzg3wZ9PZeUdCqdnt+jGnJCesOG5YLa6eU=; b=Fm5YNeC8EtLEu3+aidG6vskpZnQ7r9i4SAnybxUWdC+ltSUN5FKSgi5mEsmZeHDNAREGZp Xgx2T7IjKCtBHT0/nal3dOJeIqz55pazHE2UFuT0kGG+KJhapSdIjH2AvnNdfCcMENxYk+ KY5Nsb3n9jamEtTMCQRCB3dW6TL3tUc= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-648-YoqXB41yNK6A0zfKuFAYDw-1; Fri, 15 Jul 2022 12:35:30 -0400 X-MC-Unique: YoqXB41yNK6A0zfKuFAYDw-1 Received: by mail-qk1-f198.google.com with SMTP id k9-20020a05620a414900b006b58d6a89f2so3780375qko.2 for ; Fri, 15 Jul 2022 09:35:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=hbKyrXjYLCzg3wZ9PZeUdCqdnt+jGnJCesOG5YLa6eU=; b=jHpLibIlLNG+AdJvwZOnfRRWDVoS9TrbSyM9oRVguxa/QGltULHOY5ydSu81aEQudM 9lfm8g1dZ9dR4nQsdUUuxpHhzgEZwvod0L7KPmY+KqgdNlijiIVS49B2VaFK98d3J9nk QTH7hOzKOkFoP5ZRNcU8gJTK/vHcqeghRm74JvgGYJOGlYmqO2x78RGtX6V0an85ndID PsatXGV9li9E/HmjX3h8Y/1NesCY2BgbORSI/5qgp2DxJrAwiiPdfAHq5uKKW400BB8a fOcRtSjiBfIdWfImLtj8OvbP2rUzZ3qSv98pjhiAfckYLviBKaEkdpz3xANKrEeYioQ5 Lh3A== X-Gm-Message-State: AJIora/sUpIyOurJIty4lYyPrCOE3cfTZ7CL5i17CdRTKpBicvCk4QHV ZTlfjVMiTh6sx8Sc//+WbKM0tB4mUSDkqwNhEmX74S7IVEHB2obkPEJiB5zTmpTTGPHEY3NktOg ifs+aGjXcMaQ= X-Received: by 2002:a05:620a:25c6:b0:6ae:2408:6e05 with SMTP id y6-20020a05620a25c600b006ae24086e05mr9854577qko.240.1657902929678; Fri, 15 Jul 2022 09:35:29 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uM91supN2njnue234jkDW7W3Aj6JhU4hnWcoyNJTPy9B5v1i6uw/W0GfbjAR5yvUPKxUPfEA== X-Received: by 2002:a05:620a:25c6:b0:6ae:2408:6e05 with SMTP id y6-20020a05620a25c600b006ae24086e05mr9854556qko.240.1657902929352; Fri, 15 Jul 2022 09:35:29 -0700 (PDT) Received: from xz-m1.local (bras-base-aurron9127w-grc-37-74-12-30-48.dsl.bell.ca. [74.12.30.48]) by smtp.gmail.com with ESMTPSA id t13-20020ac8760d000000b0031eb5648b86sm3834603qtq.41.2022.07.15.09.35.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jul 2022 09:35:27 -0700 (PDT) Date: Fri, 15 Jul 2022 12:35:26 -0400 From: Peter Xu To: "Dr. David Alan Gilbert" Cc: Mike Kravetz , James Houghton , Muchun Song , David Hildenbrand , David Rientjes , Axel Rasmussen , Mina Almasry , Jue Wang , Manish Mishra , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 07/26] hugetlb: add hugetlb_pte to track HugeTLB page table entries Message-ID: References: <20220624173656.2033256-1-jthoughton@google.com> <20220624173656.2033256-8-jthoughton@google.com> MIME-Version: 1.0 In-Reply-To: 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=1657902932; a=rsa-sha256; cv=none; b=V5CGff3pFVY/tHFJRIoZlkTIXRWflksuHC8trbQffF3RyKS1BJhtWKfYSZRys3d4XcZsQC FNdrGxfZmDiXXQMyFXTJVOKJ3FHhlOzMwYRM6/L8ztqBdDd7IL0eZ616Krofb/NRwW/Kqe E9b/fO098IgO99k2OQiyk21A9JJDns0= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Fm5YNeC8; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf13.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=peterx@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657902932; 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=hbKyrXjYLCzg3wZ9PZeUdCqdnt+jGnJCesOG5YLa6eU=; b=McEDzdD0gExGgwyqzDVpBblce9M3bUS/1AVw99AQPujzMSDSnE5WQez66UVmpb8oxJVdbu SpjBqZ4dr6EDlFOEdjoOH4bN04YwCxNaVEgDQ6i21r1ou1utlLEZg2iy4yv8pSz8yJIyAW p14dat4/8YHI0TCrjFE4Ocn3CWClUcE= X-Stat-Signature: wuurpfm1bd8cgr3duwx4xjqc9s3qekwf X-Rspam-User: X-Rspamd-Queue-Id: 0D2DB200C2 Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Fm5YNeC8; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf13.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=peterx@redhat.com X-Rspamd-Server: rspam11 X-HE-Tag: 1657902931-397357 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 Tue, Jul 12, 2022 at 10:42:17AM +0100, Dr. David Alan Gilbert wrote: > * Mike Kravetz (mike.kravetz@oracle.com) wrote: > > On 06/24/22 17:36, James Houghton wrote: > > > After high-granularity mapping, page table entries for HugeTLB pages can > > > be of any size/type. (For example, we can have a 1G page mapped with a > > > mix of PMDs and PTEs.) This struct is to help keep track of a HugeTLB > > > PTE after we have done a page table walk. > > > > This has been rolling around in my head. > > > > Will this first use case (live migration) actually make use of this > > 'mixed mapping' model where hugetlb pages could be mapped at the PUD, > > PMD and PTE level all within the same vma? I only understand the use > > case from a high level. But, it seems that we would want to only want > > to migrate PTE (or PMD) sized pages and not necessarily a mix. > > I suspect we would pick one size and use that size for all transfers > when in postcopy; not sure if there are any side cases though. Yes, I'm also curious whether the series can be much simplified if we have a static way to do sub-page mappings, e.g., when sub-page mapping enabled we always map to PAGE_SIZE only; if not we keep the old hpage size mappings only. > > Looking to the future when supporting memory error handling/page poisoning > > it seems like we would certainly want multiple size mappings. If we treat page poisoning as very rare events anyway, IMHO it'll even be acceptable if we always split 1G pages into 4K ones but only rule out the real poisoned 4K phys page. After all IIUC the major goal is for reducing poisoned memory footprint. It'll be definitely nicer if we can keep 511 2M pages and 511 4K pages in that case so the 511 2M pages performs slightly better, but it'll be something extra to me. It can always be something worked upon a simpler version of sub-page mapping which is only PAGE_SIZE based. Thanks, -- Peter Xu