Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1103360pxb; Thu, 23 Sep 2021 18:35:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9TrUqJ2x1p3rdkKI0r/b947HcexbGdnCruNh9AX6HmBXyCDzA/4yxw5oc0ieYInvRGNi8 X-Received: by 2002:a6b:b7d6:: with SMTP id h205mr6585477iof.60.1632447311464; Thu, 23 Sep 2021 18:35:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632447311; cv=none; d=google.com; s=arc-20160816; b=VfU5vYGSWMHvRH1yyZzObHkSOX1W1frRLJpDj9lo7CUw6yTKKjvdczZAUeMtbSi55H tffjc0KQm4OJhCGamH5n7emUvniDCAH3USVFjnnPUYRU5hvwqNvHg6wXg0nWmI91cH2m P0wliWDyW1UvVEdSO9WRb1BlKDVlmkmVO48AbmehlUaQSegtBclTZryzeqTHrfYRjYoO 4ROO12DRv+O9iL3Tb7o0CwVN8JO2oyJMK9hK7j/1ME3wJDo0Svq37hizL9QujyWyO++9 yG0GhF8DUiYkDrktZG3aQ+/3rR10vkBb6a/9pLE6McHHs8VgAuN5NynqFUum5Rg7OlBS fLPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PKtymgm/rxLNbr2kgli9zC0XtF7+5z+sxIyEiEIRXc4=; b=zkP8BrW1Y1Nljflb4ag1nUoteVpAA8PQd3pzusWHlwvynfLaDYKnPAn9c8wylJCdWT L/Op+vdE9mJbl/ey0h0OikNIX5UGHmRTIw9ObQY0Hl8k8iJVeFSx2RcM9irWKN3Iej6N crfSdWiLLpMaiN0wYkahG5d6oJfqMYOqIaKxVRxRYb4FsWsTHMES/O86dsuu8q4pmm6r o5IsvbGchFOZsA/A3vWLiPSWVKeWGP6r8Cng624o5/PvGESkp6r/v4NWktG1mKlhub9/ jXkmDfiaXOu4VhU+pmVwPJ484k1S2p11qXEVUs8oqpqEm4yCol049C+zOI2m/ITKdPja nzcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=njjlVgK7; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i9si7737403ilc.6.2021.09.23.18.34.58; Thu, 23 Sep 2021 18:35:11 -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=@infradead.org header.s=casper.20170209 header.b=njjlVgK7; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243753AbhIXBec (ORCPT + 99 others); Thu, 23 Sep 2021 21:34:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243687AbhIXBeb (ORCPT ); Thu, 23 Sep 2021 21:34:31 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77C25C061574; Thu, 23 Sep 2021 18:32:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=PKtymgm/rxLNbr2kgli9zC0XtF7+5z+sxIyEiEIRXc4=; b=njjlVgK733a8eyU1LCtkUuhOsc PJQqb38DhPltPPxMKDYzkActT5FpxJwB46YEJOmzyIUHSIGfng94M5u3DWlZpGCxhF9YWp44X0S5L y7UajNjkoskF45F5/owk2lWdd06qJhelQhBMyBbFYMAU2paunIDiFixHEX4lHz/hwIfmlQkSnQrPg PjfNhGxEO80eBT1DTIw5DK6yf5bpaJrvRTuJDl9OHxrpPT9AQltF9axzFSgAIXerKnSbiq2P80ukM nKNvIBTQIHpBaKabwteqWoo61E6fVRbh5waq57mM8vyWnitZz/tSUjZQJUjzddVzf3cgs/87WwZnO a+PLLnQw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mTa3q-006m8D-Fu; Fri, 24 Sep 2021 01:31:48 +0000 Date: Fri, 24 Sep 2021 02:31:34 +0100 From: Matthew Wilcox To: Yang Shi Cc: Hugh Dickins , Zi Yan , "Kirill A. Shutemov" , Kent Overstreet , Linux FS-devel Mailing List , Linux Kernel Mailing List , Linux MM , Johannes Weiner , Linus Torvalds , Andrew Morton , "Darrick J. Wong" , Christoph Hellwig , David Howells , Mike Kravetz Subject: Re: Mapcount of subpages Message-ID: References: <20210923124502.nxfdaoiov4sysed4@box.shutemov.name> <72cc2691-5ebe-8b56-1fe8-eeb4eb4a4c74@google.com> <2A311B26-8B33-458E-B2C1-8BA2CF3484AA@nvidia.com> <77b59314-5593-1a2e-293c-b66e8235ad@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 23, 2021 at 06:11:19PM -0700, Yang Shi wrote: > On Thu, Sep 23, 2021 at 4:49 PM Hugh Dickins wrote: > > I believe Yang Shi is right insofar as the decision on whether it's worth > > queuing for deferred split is being done based on those subpage _mapcounts. > > That is a use I had not considered, and I've given no thought to how > > important or not it is. > > Anyway deferred split is anon THP specific. We don't have to worry > about this for file THP. So your suggestion about just counting total > mapcount seems feasible to me for file THP at least. But I think we probably *should* do deferred split for file THP. At the moment, when we truncate to the middle of a shmem THP, we try a few times to split it and then just give up. We should probably try once and then queue it for deferred split.