Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp496086pxk; Thu, 24 Sep 2020 10:32:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwktdABfV8sk4t2CMa3fXAkGO5bYvyt1vFNBz9uIJmGX7rpUNrV2QH6PUlyqayfKhH8Dm9g X-Received: by 2002:a05:6402:10c9:: with SMTP id p9mr1122909edu.156.1600968753956; Thu, 24 Sep 2020 10:32:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600968753; cv=none; d=google.com; s=arc-20160816; b=aMBXZLPzMRmzPcneaL+GWEaRxrIZ1wdljw4tnopGVAYElqV6lPGrFIiMjY+OAAN8RJ VYetpyIWttkKcEn6Oye5Sgxvu/F2ElijjGkfMij0bRpW3ETJreGmv2yKkcpUI3SjNPyS eB69rq3LpgvOOCl/S4EzqEnRsUHDemcK3EY8ASrycPoJHh+OfSjGy8zFptHgUVi3rPlJ U01r3p22REjflL4zeWIEcYnrZJzqvtmZqwXmvwF3F2JTpgNI/clavXRPcfXAYlWcthBc yOa+UnrTe1jHjvJSMA90WRUS2r4mM0Vge4K0YFGNcXBUBTavNzQKscX7eL36CyMsPR4O xrtg== 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=1Rj2Ks53EYaHscbbljFejwCf3ZpdNdZ5OllPTvKUc/0=; b=u1K3fkoADAAUrsHdeafF6RQiIS32wXRv8kw1W4H0Q5gSkhymEv7SdMZ8AQKiphuqY+ 4oqV9UxJ/n6IJ7Ekn9qPCNrTzQs0FxC5XUqqsKpamwBhC6cIPH+A0mStKTL8Ej5hpX8B LhkxEcUbgHGmp+7vXjSae64KtjHqu+XX0kOy6d2FUq0G3kTqF2N6HQM3Sq2Bajq3zUFj QWitRherYNX97J1vODBO0LixWH7XYn4Q1lW33fLybzbAhIY/JtLv9rm6I8PHqL4VGMyR Tyl+zAYQUMOv1wOETX8pBY6A1q5Y+tiCQkB2nutHbFaelnniF7I5NjRv+WTCiXsL7N1i rlnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Woov+o1k; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y19si110333ejf.251.2020.09.24.10.32.09; Thu, 24 Sep 2020 10:32:33 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=Woov+o1k; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728662AbgIXR3l (ORCPT + 99 others); Thu, 24 Sep 2020 13:29:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727687AbgIXR3l (ORCPT ); Thu, 24 Sep 2020 13:29:41 -0400 Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE922C0613CE for ; Thu, 24 Sep 2020 10:29:40 -0700 (PDT) Received: by mail-ed1-x541.google.com with SMTP id i1so4225506edv.2 for ; Thu, 24 Sep 2020 10:29:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1Rj2Ks53EYaHscbbljFejwCf3ZpdNdZ5OllPTvKUc/0=; b=Woov+o1kw1EK1aSaUuoL3PVlebOvnRY6f+pfbBElcTMbl75/r4kyVtBUDsnkeX7/Io wm6iheIreC2XmElF2f++bs4mxq2Jo5oPsatSG8Rq9ndJBvPxTqpepT+yrWgwj57PI/+a +LZLT4EJ8uM+Sfo1bfA869fgW7IUB9fZK/CS36Gr5qX/YbovR8YQppw88Cq7PEVm+gL+ 9nM8eBWxKo2HfaOLXoOHicT5lFIBAgya71JW7Q+8q8tDqMZfhzhlz8axcUVFuNHnSz6d iDyJR5X1ZI8hqZpXg7R/EK5tsCN0e+zsCTj+Lm8ftwZWlSPybyIhZNE4yjX8f5ua3FZd zbnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1Rj2Ks53EYaHscbbljFejwCf3ZpdNdZ5OllPTvKUc/0=; b=ZlhQdPqJM29J00hs1zrxS8U8J2YK6kSd4kPqWY5nFeZ1YgfV1X1Z6Hcsqc1s5o3qM+ 9joOmHI9Rq2Kjn7qIcrVEdx0kZHYzYwKY7cUuF7cMGU4atCAsFfvxrTqfFBShET8kros 6AyJOB5BYZUgL3AS6yOgGrnSSiv0hcAUU7byVq74qAWdpDdGypnOLe9GfbgimiVKSlLd AVjiQYwib0HUveu4OQEoKuDifV6V6BhetTX5QF3qdcrH1xz+10zd9YlN7s5JeG+Ca3gh o7jnD7B/Ug18aVZubFLiwslhVX+Qpis3rZc+aupM8R9PzWkG+55UhNDnjbfQxZmZjhiG zVug== X-Gm-Message-State: AOAM533AdONu5+ADwiIiWVIqVbmdc9hTasSUlAtqw7TsrmjSi2ktfqHR wbnk676rDfvTZIrlhQD38IdMA/wrYQk0ezWXBxw= X-Received: by 2002:aa7:cf05:: with SMTP id a5mr1047406edy.313.1600968579647; Thu, 24 Sep 2020 10:29:39 -0700 (PDT) MIME-Version: 1.0 References: <20200921211744.24758-1-peterx@redhat.com> <20200921212031.25233-1-peterx@redhat.com> <20200922120505.GH8409@ziepe.ca> <20200923152409.GC59978@xz-x1> <20200924154750.GG79898@xz-x1> In-Reply-To: <20200924154750.GG79898@xz-x1> From: Yang Shi Date: Thu, 24 Sep 2020 10:29:27 -0700 Message-ID: Subject: Re: [PATCH 5/5] mm/thp: Split huge pmds/puds if they're pinned when fork() To: Peter Xu Cc: Jason Gunthorpe , Linux MM , Linux Kernel Mailing List , Linus Torvalds , Michal Hocko , Kirill Shutemov , Jann Horn , Oleg Nesterov , Kirill Tkhai , Hugh Dickins , Leon Romanovsky , Jan Kara , John Hubbard , Christoph Hellwig , Andrew Morton , Andrea Arcangeli Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 24, 2020 at 8:47 AM Peter Xu wrote: > > On Wed, Sep 23, 2020 at 09:07:49AM -0700, Yang Shi wrote: > > For tmpfs map, the pmd split just clears the pmd entry without > > reinstalling ptes (oppositely anonymous map would reinstall ptes). It > > looks this patch intends to copy at pte level by splitting pmd. But > > I'm afraid this may not work for tmpfs mappings. > > IIUC that's exactly what we want. > > We only want to make sure the pinned tmpfs shared pages will be kept there in > the parent. It's not a must to copy the pages to the child, as long as they > can be faulted in later correctly. Aha, got your point. Yes, they can be refaulted in later. This is how the file THP pmd split was designed. > > -- > Peter Xu >