Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1550154pxb; Thu, 4 Feb 2021 16:29:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJzMwkEG9sMGujCxBFB4Lu3oNn/5BXGutjALAaxd/XjUlCzpwHpuie05Fsj+XcGTw6gvgW57 X-Received: by 2002:a17:906:6a5b:: with SMTP id n27mr1543046ejs.81.1612484976681; Thu, 04 Feb 2021 16:29:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612484976; cv=none; d=google.com; s=arc-20160816; b=LpjQRsUyNAATyb7+Smdo3HljWyY8RvONW5MjCMDjp7wNi8f+XlWC5mY99gMYAYhBQ2 fam/lh0iJA/eN0QHSczYFu2rFQrNhD+dZZPwx20Bza9sDi5p2U56yUyE/GQb3vtR8b7z dJS+1gApTQuCvAw9ZKm8/PEsDxmRPyzoTWE6/4ikiIB9k46KICV/8ezyZHJx4SQ0seGy 36ke8ejoaTmPxDDDQvGDROw3HpPTMpM6OcbxNIUO7MOjKw+NrnwQqht4LELxilZFfzID 1dacMPx+Ps0Mfp9FOBu9EBr+FWr4wB1i6xpkJ20zoZbw3FmOFvVq1KEr1cQSpD4e7zbs Dsew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=p9V03q8GnkdefDZv70lYQwNtLWDpb3uW9mg5FD1upMQ=; b=rkDvnB2UaOS/rnLsOR6Lu13q3E8MVFC0meWTsjKb8cKECSazuRbBgDGWzrc/5R3fDi rNBv/8d6t26CZVobaykB2Ui6PyF+BXn3B/C+yV7x7riG4/etl6RyIx17M6hPwM0U5gQS e16UuqmdEBT1wfLaYGFX7xuHxqxivF+yc0opWHUDbuWVvk29/hXWYluIpkmmQROeCIJo mI2X0pfqpwFUj0zfltrDE1EsTy7enMV81JuZIBLa1blDX106Bm7eVZPSKK8bXQlpOBQW uERe+FmxEyqZC/urc0shx+bkwsBfaKXtdoGQnNwwRuIMwjSvnHnxlrpDXhzrGDCycpUL huBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=NrTUm8t6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu21si4250643edb.328.2021.02.04.16.29.12; Thu, 04 Feb 2021 16:29:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=NrTUm8t6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236786AbhBDOgx (ORCPT + 99 others); Thu, 4 Feb 2021 09:36:53 -0500 Received: from smtp-fw-6002.amazon.com ([52.95.49.90]:18701 "EHLO smtp-fw-6002.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236648AbhBDOff (ORCPT ); Thu, 4 Feb 2021 09:35:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1612449334; x=1643985334; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=p9V03q8GnkdefDZv70lYQwNtLWDpb3uW9mg5FD1upMQ=; b=NrTUm8t6LDmEC4r5fVu6uqnWIBric6BtazQA/RHQdiNIJ2S9cLZquWG8 fZnuVjIhwqpSM7OHKY5KrG94a0VYeCUOeAOEvBb2ILay4HChVKD7TNVTn 0TGgQy2wPDTsM9red2M0s7yoNBuCynwo1TlyUh45dVwNRSsRFyxqar8iL c=; X-IronPort-AV: E=Sophos;i="5.79,401,1602547200"; d="scan'208";a="82458978" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-2a-e7be2041.us-west-2.amazon.com) ([10.43.8.2]) by smtp-border-fw-out-6002.iad6.amazon.com with ESMTP; 04 Feb 2021 14:33:00 +0000 Received: from EX13D19EUB003.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-2a-e7be2041.us-west-2.amazon.com (Postfix) with ESMTPS id C11EBA066A; Thu, 4 Feb 2021 14:32:58 +0000 (UTC) Received: from 8c85908914bf.ant.amazon.com (10.43.162.124) by EX13D19EUB003.ant.amazon.com (10.43.166.69) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 4 Feb 2021 14:32:50 +0000 Subject: Re: [PATCH 0/4] mm/hugetlb: Early cow on fork, and a few cleanups To: Peter Xu , , CC: Wei Zhang , Matthew Wilcox , Linus Torvalds , Jason Gunthorpe , Christoph Hellwig , Andrea Arcangeli , Jan Kara , Kirill Shutemov , David Gibson , Mike Rapoport , Mike Kravetz , Kirill Tkhai , Jann Horn , Andrew Morton References: <20210203210832.113685-1-peterx@redhat.com> From: Gal Pressman Message-ID: Date: Thu, 4 Feb 2021 16:32:45 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <20210203210832.113685-1-peterx@redhat.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.43.162.124] X-ClientProxiedBy: EX13D24UWB004.ant.amazon.com (10.43.161.4) To EX13D19EUB003.ant.amazon.com (10.43.166.69) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/02/2021 23:08, Peter Xu wrote: > As reported by Gal [1], we still miss the code clip to handle early cow for > > hugetlb case, which is true. Again, it still feels odd to fork() after using a > > few huge pages, especially if they're privately mapped to me.. However I do > > agree with Gal and Jason in that we should still have that since that'll > > complete the early cow on fork effort at least, and it'll still fix issues > > where buffers are not well under control and not easy to apply MADV_DONTFORK. > > > > The first two patches (1-2) are some cleanups I noticed when reading into the > > hugetlb reserve map code. I think it's good to have but they're not necessary > > for fixing the fork issue. > > > > The last two patches (3-4) is the real fix. > > > > I tested this with a fork() after some vfio-pci assignment, so I'm pretty sure > > the page copy path could trigger well (page will be accounted right after the > > fork()), but I didn't do data check since the card I assigned is some random > > nic. Gal, please feel free to try this if you have better way to verify the > > series. Thanks Peter, once v2 is submitted I'll pull the patches and we'll run the tests that discovered the issue to verify it works.