Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4598301imw; Tue, 12 Jul 2022 10:40:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v6gWnB/Nzy5Q5a9ekWvzWCmnJJdz7z1wORWxovlk54EWi52sOjQTmpRRUbiq9js33eVb5Y X-Received: by 2002:a17:90b:4f82:b0:1f0:95d:c029 with SMTP id qe2-20020a17090b4f8200b001f0095dc029mr5741419pjb.66.1657647641550; Tue, 12 Jul 2022 10:40:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657647641; cv=none; d=google.com; s=arc-20160816; b=AvQJCvY6eVY1HLm0NkKSroB9cZA/ks/cDS9+892RtzHlu0Gk8mruDESX+c6KQG4md3 ZwMZfwS4W6vYeC+FQ46nCj637pTn1DmdT1QwySVk8kwdjVyKktaWETEPv4x5ufGzI4VT /Cj60VkNmPcoOXYhxLO8WOQbjkkp70XhviDvHBEBuuCFDOUUu6SKNQ8uMUR5UhAz53YV dfL1K4nXUt1HhinhSHP0tJtfIUOlu67sK3FH7ltJS/OykPeml7++VKaUPZ+M8HaU9IP5 BMVf9agly7Rjb/nCq3h3PsESPaXfuPZyU+49byvE67mJFewJk6brYCtbzvEtvZGYnPlM kVxA== 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=ibrUHnlGz87syZWBzvYZCl2iDjwrLt5IxsZ/+T6H5Kk=; b=JjalM4iG3IX5OFGovB/F+sBiIRpcf2z4tGdtiJ53/yQdKbkYOYVURVSNm1sWyknFEA 0gE/UTbqeIFIYiZpS9jdopHtYY3xEha2t6wNJJTw9X5NVqfx3B6nDKqFGEveGrhSgRQk tayF6IjpWkmpLT92QhBc2czJuT5JQyw9MaYoFhY9BnAAua46QDYTeiQWk4QCM2ZdGLK6 yy2bW2LlaTEJOqzzRCLcqsk8v72cnI+XZhHFQ10apiWjY7Vab8CVgbr4LctTpp8pzZ4Z S6+Q3xEDoRtevAiEylm28PTtNNI5qH/6Tpq0OJvR37uF+pS9HvrrZkVEjGQ5eMJXxSDU QoZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="LKapj/7e"; 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 k7-20020a056a00168700b0052847a685b9si16228300pfc.245.2022.07.12.10.40.28; Tue, 12 Jul 2022 10:40:41 -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="LKapj/7e"; 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 S230185AbiGLRUR (ORCPT + 99 others); Tue, 12 Jul 2022 13:20:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229823AbiGLRUP (ORCPT ); Tue, 12 Jul 2022 13:20:15 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2B5967C81 for ; Tue, 12 Jul 2022 10:20:12 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id d12so15053255lfq.12 for ; Tue, 12 Jul 2022 10:20:12 -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=ibrUHnlGz87syZWBzvYZCl2iDjwrLt5IxsZ/+T6H5Kk=; b=LKapj/7eKcH3Ctl0xLFhsHrioyJ2DRfd8EH69UtRZl8yDlKgnJU/i5wG+H7SaVVYjF 1/+fCuNEwfB8Df87JbtOiS1YHhVYLPvwSWtdiKFDJljv4fYaR8HScOgqK1fb1svFnAUu NqoEVjX2rZPj90rE+JjAt/7BvdepDYNW7bwldQVTvpr8M4JLpSAYt42iaX+61GtVIcTa 3Od0RJSgItJlic/n5ypdpsuhC/CuT/hyexCfQGrSnw7dwoygyhRJBtA+QX9L2sZ4tG6N 01Ii3o+98GrbVlEZxHHM5WeTLsFeE+BTNFhZjap7o9NT9FpV64jK595ilhgduNMscK1C UCeg== 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=ibrUHnlGz87syZWBzvYZCl2iDjwrLt5IxsZ/+T6H5Kk=; b=MZmmbmLpXGjhPEvtErPqf6VnsSiw5rIxQZphKXH/iHEyqDPneML3JRGai6ag6p6IEC lz3/oIJx3w+w9wQJlYiOJM8yo0Z8Of+6R+ocBVqsuxqzJQVvS+tdVstVedfLFh/B53vj 82itykHu8uhR2VHARpe8itcUscIjo7Gkuzjo55HI5iu8Oz26aQZ0+rwI5KN7AhTUwVXe KTYRasgPD2eLHNfjiJYpfHdnZ3+m0GSqSzreFeII/ZsStqpRNYnzpF8uGd2x03tr0liL Jvhh5hA5i2Y73NpHROunkR1Jn8qa6oRLYbLzIU5QEEXLrY/Li1Ui7Nizd5ub7y/rOHqC gUhQ== X-Gm-Message-State: AJIora+TumHdz5nXxLXs/fh/QOdzb2adHtyB/KnmFOCyUgZTWgGbZ4q0 o0S/jpJsjg9TCbF1DoIeyvzPp4jg/3Uoo7Bia0b/uA== X-Received: by 2002:a05:6512:1523:b0:489:db27:c171 with SMTP id bq35-20020a056512152300b00489db27c171mr8262355lfb.58.1657646410942; Tue, 12 Jul 2022 10:20:10 -0700 (PDT) MIME-Version: 1.0 References: <20220624173656.2033256-1-jthoughton@google.com> <20220624173656.2033256-20-jthoughton@google.com> In-Reply-To: From: James Houghton Date: Tue, 12 Jul 2022 10:19:59 -0700 Message-ID: Subject: Re: [RFC PATCH 19/26] hugetlb: add HGM support for copy_hugetlb_page_range To: Mike Kravetz Cc: Muchun Song , Peter Xu , David Hildenbrand , David Rientjes , Axel Rasmussen , Mina Almasry , Jue Wang , Manish Mishra , "Dr . David Alan Gilbert" , 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, 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, Jul 11, 2022 at 4:41 PM Mike Kravetz wrote: > > On 06/24/22 17:36, 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. > > > > Signed-off-by: James Houghton > > --- > > mm/hugetlb.c | 74 +++++++++++++++++++++++++++++++++++++++++----------- > > 1 file changed, 59 insertions(+), 15 deletions(-) > > FYI - > With https://lore.kernel.org/linux-mm/20220621235620.291305-5-mike.kravetz@oracle.com/ > copy_hugetlb_page_range() should never be called for shared mappings. > Since HGM only works on shared mappings, code in this patch will never > be executed. > > I have a TODO to remove shared mapping support from copy_hugetlb_page_range. Thanks Mike. If I understand things correctly, it seems like I don't have to do anything to support fork() then; we just don't copy the page table structure from the old VMA to the new one. That is, as opposed to having the same bits of the old VMA being mapped in the new one, the new VMA will have an empty page table. This would slightly change how userfaultfd's behavior on the new VMA, but that seems fine to me. - James > -- > Mike Kravetz