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=-2.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 A39D4C433EF for ; Fri, 24 Sep 2021 03:26:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5BEC760F41 for ; Fri, 24 Sep 2021 03:26:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5BEC760F41 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id A926A6B006C; Thu, 23 Sep 2021 23:26:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A4225900002; Thu, 23 Sep 2021 23:26:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 909406B0073; Thu, 23 Sep 2021 23:26:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0072.hostedemail.com [216.40.44.72]) by kanga.kvack.org (Postfix) with ESMTP id 81FE46B006C for ; Thu, 23 Sep 2021 23:26:36 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 1906182499A8 for ; Fri, 24 Sep 2021 03:26:36 +0000 (UTC) X-FDA: 78621029592.15.ECF91F4 Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) by imf10.hostedemail.com (Postfix) with ESMTP id DAB026001983 for ; Fri, 24 Sep 2021 03:26:35 +0000 (UTC) Received: by mail-ed1-f44.google.com with SMTP id bx4so30768730edb.4 for ; Thu, 23 Sep 2021 20:26:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=18+5whvcDDqdfxVcWTrxiz/OMweHZu0w3dsMvDPd2x0=; b=QeO0RCPobSsavCWYY1RbFVToa8iXjat5Qhm4VBQxlUm8I2uKeCUnUZqnUXZPWvTP3I 3DkSgeXKY1Vt64niNrSkNlCd4fBfPVoA/UGBmSCZMmAoVvWUWiLpk4QXMB0w7kjeR4DZ 0+BsnPbGwScxAb5hvUFXNw5mAyFEP6imQdbAYvmmKMqsd7QuiLKIlkXZ0dm+Ls9Pe30H Ac1b3UVSbo2CZwTPGiDFVSTZaomfC6ERWSf88p5yWuIuC2R9FQyBOI3Vgw31py0Tun6e 3Cz2Zr0Umq4IAQIn1kMpdQPKZBuQKoeDNs12wOujkEONRU9qJoAuxbXO9D78tqXS4kCr cajA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=18+5whvcDDqdfxVcWTrxiz/OMweHZu0w3dsMvDPd2x0=; b=I5QyuiD48A9b8f81jsIhgNX4QFdeCUzq/qItZmgfUNnbkDVixsNt7CE0WayejwChRZ 84pFWFsTFIQXHHYYHr/DEiTpIRZut07y6zhsI4VwUyuY1pugEfNpQacPt4HBVA+VKzaS zTrtZrIIdXUBaS3rbuOdC9wNInYlMRBB3hPPA1tGW2emX8uHkp7r0HKgBIVHg2gfEW4v B7CwK4wopRrMbll69S3UHjAROI/Wh/otZB/dD5v0RDmtiCX0hmNGeyIDxGHn2LF950s1 dkhA8TemUrb14GbYopnEmGnp7WXBZuQa+bVMeSgYesEDo+WUzFbqIZPKUh/j+r6axgxI 6/zQ== X-Gm-Message-State: AOAM530QhqlHbqKZGAdin4O4Bf1JuJAtcez371/KT07JtSclgu/bOL0A rT1AI8MgEv7/qQmAnBrheRTPKlUjjLi1XBAY5ak= X-Google-Smtp-Source: ABdhPJyTRNRz76PPApx+1focabGvQlQuAjrXjZcFxgXozpU4UGlOYiDD19uR1USNsAf/p6R92BCFoG9sqmBxkPq4bJ4= X-Received: by 2002:a17:906:3f83:: with SMTP id b3mr2452641ejj.233.1632453994521; Thu, 23 Sep 2021 20:26:34 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: From: Yang Shi Date: Thu, 23 Sep 2021 20:26:22 -0700 Message-ID: Subject: Re: Mapcount of subpages To: Matthew Wilcox 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 Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=QeO0RCPo; spf=pass (imf10.hostedemail.com: domain of shy828301@gmail.com designates 209.85.208.44 as permitted sender) smtp.mailfrom=shy828301@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: DAB026001983 X-Stat-Signature: 8xj4mp5jtgjy3ahgh6hsyu1q64fwfs6p X-HE-Tag: 1632453995-276882 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 6:32 PM Matthew Wilcox wrote: > > 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. Yes, probably. Anyway this doesn't need _mapcount of subpages.