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 X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F4F2C433F5 for ; Fri, 24 Sep 2021 01:33:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C973261108 for ; Fri, 24 Sep 2021 01:33:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C973261108 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 236E96B006C; Thu, 23 Sep 2021 21:33:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1E5A0900002; Thu, 23 Sep 2021 21:33:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0D4886B0073; Thu, 23 Sep 2021 21:33:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0248.hostedemail.com [216.40.44.248]) by kanga.kvack.org (Postfix) with ESMTP id EE8FE6B006C for ; Thu, 23 Sep 2021 21:33:10 -0400 (EDT) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 9BE08181F24C1 for ; Fri, 24 Sep 2021 01:33:10 +0000 (UTC) X-FDA: 78620743740.31.CD138E2 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf13.hostedemail.com (Postfix) with ESMTP id 4C373102EE1F for ; Fri, 24 Sep 2021 01:33:10 +0000 (UTC) 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: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 4C373102EE1F X-Stat-Signature: h6hpubyffkzitbs4sa61yoa1w35s4d9j Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=njjlVgK7; spf=none (imf13.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-HE-Tag: 1632447190-253495 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 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.