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 D8963C4321E for ; Wed, 30 Nov 2022 23:18:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 70C676B0071; Wed, 30 Nov 2022 18:18:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6955C6B0073; Wed, 30 Nov 2022 18:18:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 536C66B0074; Wed, 30 Nov 2022 18:18:55 -0500 (EST) 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 43ED56B0071 for ; Wed, 30 Nov 2022 18:18:55 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 205CCA0D49 for ; Wed, 30 Nov 2022 23:18:55 +0000 (UTC) X-FDA: 80191675830.01.53ECA01 Received: from mail-yb1-f174.google.com (mail-yb1-f174.google.com [209.85.219.174]) by imf17.hostedemail.com (Postfix) with ESMTP id C69DB40012 for ; Wed, 30 Nov 2022 23:18:54 +0000 (UTC) Received: by mail-yb1-f174.google.com with SMTP id 189so22917513ybe.8 for ; Wed, 30 Nov 2022 15:18:54 -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=2W6emOl+fk8g0TLLYfaFN2DQF20Ugx4RpvJgeueZ0+17s4KvEJUcRX/8NLMvj/k2sY gI3o+6uLce5RXdYGNp7FDCaBIsqYm4rygMxilVjNw7kDf8qJeP6ulxN7Pp2RRQ27IPtL leCn+fxfW0EC7qJuxz1/D3No3v8XF2aKfxfRPg3iM6bY2sDgVDOqBjF19J0sMVlQ2aCq Ahgi7nPFbyqww/DP98KLkVRd5aKSGF7z9XpqNQ95BYuhjv8KzbVAvZSPSllWWxZH0KZQ FRhnIk8vsH4hg0oBvWK125S8IkHpKrHOP0cGFu2FGKjrXV2n3tNL4Hlba9aakmwjhVPv 0iJQ== X-Gm-Message-State: ANoB5plQcEero8fV+gGBQYQ+JfnpP5X7rPi18lxK/Bu0bHKg4aQmtzn1 cXAZY6Oj8cZoo0drCAHBvoOltZJgYw4BGRZvlHlUjw== X-Google-Smtp-Source: AA0mqf76NMMyoniYOh90z5CA0a5taAqe2MmVdbR3KHFfgjw/3MArj6SFyCuV7tbeAC+RCwIuSBZHqZb3zdR2DCa608k= 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1669850334; 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=a1CvzEDs24QW86WHYCJO7ldmgZffPCDkhf+BewAnOM8=; b=zZGymJCggRbdAPLsdZkK+BbIjfc4cgz69fL5rG9+8YuntIbMRzTQeJcgXcj9SNEvFs01l0 ZMYaZAbpw+SqvEBAF85bspbInbR6yafdxMKGUj38OuMrZIANxFfQ8epAtw3JCkLWMX1wiX 2gCvb8lnvItHUwJHdm8eZjdud+Jzhjc= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=AlEZeIvg; spf=pass (imf17.hostedemail.com: domain of jthoughton@google.com designates 209.85.219.174 as permitted sender) smtp.mailfrom=jthoughton@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1669850334; a=rsa-sha256; cv=none; b=B6+ANxoINU0qc0wo5HlXVTRLwTyHCjROP1GEyY8LMRJ8/mV2GjM7bwSMdn4J6nMcbtrsdE 0jmDYi/FNT1MB3N91QzXkAEWRL6lyOQRbqAd2CFwUKL+xKC+3DhvTdvEJ4pNPdujy/aiyt nUBENzmlAOpnYJ1UYVEfuqfdu5CByEg= X-Stat-Signature: qoajwos45xuxw6j7ztogg9ak3i54x8g9 X-Rspam-User: X-Rspamd-Queue-Id: C69DB40012 X-Rspamd-Server: rspam11 Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=AlEZeIvg; spf=pass (imf17.hostedemail.com: domain of jthoughton@google.com designates 209.85.219.174 as permitted sender) smtp.mailfrom=jthoughton@google.com; dmarc=pass (policy=reject) header.from=google.com X-HE-Tag: 1669850334-819546 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 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 >