Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3124949rwb; Wed, 30 Nov 2022 15:58:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf57pwvO7OurAdUX8qPPzJgXRYOMfN5bqIk9+Us26Rbp07FpRJ/J4FiT6D5QiEhqYCHlmKiR X-Received: by 2002:a05:6a00:1bce:b0:565:b4fe:de85 with SMTP id o14-20020a056a001bce00b00565b4fede85mr44307104pfw.81.1669852713823; Wed, 30 Nov 2022 15:58:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669852713; cv=none; d=google.com; s=arc-20160816; b=mn01mJn6W4EmMPMbLLvyM81LsAogAlgGhrX8EN6bz7YBSzEbSx7J+SgB3DtzR+IBLW 1QP9eLWzzU6stHuXHQ7pY83NycmRS4taAxkqP6WudBWfyxTNhEIKNk98TD9PpWpnfbOD fhcrQROG3wCrpIVNxUjiNlp2f4fCM3G17MWiwqg3pN/5y2kuda9AHtvYJJOZdCrzHUqG uIswqQV8ZPihcWjsx6ibk8Yb2aRq2KRKBCr1oU1QB9Vq6bk56weFo0JNCZ5A9XzoeqDH ZlF53E/ii2CqXPW4u8FaH/1NwtnYmcXfPfux1rBrIlo3IAu4Uoyp71iMsBzQKTvfqvn6 KmCQ== 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=a1CvzEDs24QW86WHYCJO7ldmgZffPCDkhf+BewAnOM8=; b=i0ZBFnjOZ1KfgtICFH4QjGMnwDzelGk3/LUkXPH3u0vqWzRwTQ0XAQWZvRhbKCWbNL /7k5NbezhU6otGaQp+bpiOb0cUoY+d2RlVyGH5iZwvPi9LJzFgWnuTcn3IYbGZ9FBx1g s7Ix45nXih7N+qxGvNG3Iccr2RNDsVZxjUM+g4446uRXtl+jhqyq/LKHVzWTeFhBJc+/ E+7cyjvz3OJEmqdhGtTCxfOgmWClZWTS59kJlWe1S8w00rxZA33L00+LDe+By0Rf50QA p98Ux5+g3Mej2dgweZTH22gjQuJLpQ79L7IQy4JVhC3GzKtJuaydWffuakDwr5rQ19zP KKEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=AlEZeIvg; 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 i6-20020a170902c94600b0018930cc84c0si2706110pla.574.2022.11.30.15.58.23; Wed, 30 Nov 2022 15:58:33 -0800 (PST) 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=AlEZeIvg; 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 S230064AbiK3X3R (ORCPT + 83 others); Wed, 30 Nov 2022 18:29:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229705AbiK3X24 (ORCPT ); Wed, 30 Nov 2022 18:28:56 -0500 Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com [IPv6:2607:f8b0:4864:20::b2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A28CA957A for ; Wed, 30 Nov 2022 15:19:27 -0800 (PST) Received: by mail-yb1-xb2a.google.com with SMTP id i131so23521138ybc.9 for ; Wed, 30 Nov 2022 15:19:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=a1CvzEDs24QW86WHYCJO7ldmgZffPCDkhf+BewAnOM8=; b=AlEZeIvgPBlg/GfJx3mG29SiBWRv7VIS/2hc+XrXCtCh+r8GoBIH9+a5eX0iIjzhZO O87KHkPzejAUJBhQtHeGUeFrthQWjcFYy/3cmVrf9NjPxbRELzc8H7fgYKNgosox5sqX M3/F1fTkt1R7gLR1tPSp2Tcurw5brT6yzQ1CgR59+Qk7ccfgtoJET45gMUQZPhCaQBH8 T93fNOqzbt3hjrRrDpWUKWo08dtrJqF9nVwneM/KSa5+dqRWDK7120PEGsthwKV2WYLg +X2W5Ygldc0dxwyF2LH6zc2wSF3WP2CBBH6D5RcpfRz3Ydjh2kxZfO2oW1kDe+KHhhC+ kjRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=a1CvzEDs24QW86WHYCJO7ldmgZffPCDkhf+BewAnOM8=; b=hkaBZ0LhR5EYOcb6nbXvvQHG4uOEkfj4i/wQoNUrypaD+cblrh0K60agub1YEGXoAy TCdFAIol4KEz9cUoJGBQiBqTyCK109v9CCaIDjPluXQnDnhqQVj5DwOWAa80SGHnIRdD 0WP8pETc/JwkhxwwtFH6lzMAs6zpodwE2KG9/RcRHPA4srnzvexRK35E5aa7hmPpGY0T 8Ju/wMl7552zni9cUZFFPmB5zUkIA5ksqN0EHc76xpjaPa4UuUtHH6wbY1lTjf5z8E/P O2pqGt97C8NiWuk66qkGGcG4pY7hnXO/OopBjdESDNrOOzHQ5IBfM1uJhJn65t1z79Rl u25g== X-Gm-Message-State: ANoB5pmm3XJwVOiZBnuYvdfDlceQyBqQmX5ATbk2GtnzfljVVtIvvBoT hlCvkYL5prNBTWTVu+pAmzLrzuB7fCS5hdNMP/4Kjw== X-Received: by 2002:a25:ac8:0:b0:6fa:678a:7623 with SMTP id 191-20020a250ac8000000b006fa678a7623mr4513898ybk.577.1669850333794; Wed, 30 Nov 2022 15:18:53 -0800 (PST) MIME-Version: 1.0 References: <20221021163703.3218176-1-jthoughton@google.com> <20221021163703.3218176-26-jthoughton@google.com> In-Reply-To: From: James Houghton Date: Wed, 30 Nov 2022 18:18:43 -0500 Message-ID: Subject: Re: [RFC PATCH v2 25/47] hugetlb: add HGM support for copy_hugetlb_page_range To: Peter Xu 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 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, 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 Wed, Nov 30, 2022 at 4:32 PM Peter Xu wrote: > > On Fri, Oct 21, 2022 at 04:36:41PM +0000, James Houghton wrote: > > This allows fork() to work with high-granularity mappings. The page > > table structure is copied such that partially mapped regions will remain > > partially mapped in the same way for the new process. > > > > A page's reference count is incremented for *each* portion of it that is > > mapped in the page table. For example, if you have a PMD-mapped 1G page, > > the reference count and mapcount will be incremented by 512. > > > > Signed-off-by: James Houghton > > I have a feeling that this path is not triggered. See: > > bcd51a3c679d ("hugetlb: lazy page table copies in fork()", 2022-07-17) > > It might be helpful to have it when exploring private mapping support of > hgm on page poison in the future. But the thing is if we want this to be > accepted we still need a way to test it. I just don't see how to test this > without the private support being there.. We can trigger this behavior by registering the VMA with uffd-writeprotect. I didn't include any self-tests for this though; I'll make sure to actually test this path in v1. - James > > -- > Peter Xu >