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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 338FCC54EBC for ; Wed, 11 Jan 2023 14:29:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 24C8D8E000F; Wed, 11 Jan 2023 09:29:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1FE5F940009; Wed, 11 Jan 2023 09:29:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 075EA8E0010; Wed, 11 Jan 2023 09:29:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id DE8038E000F for ; Wed, 11 Jan 2023 09:29:19 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id BAD0D80C96 for ; Wed, 11 Jan 2023 14:29:19 +0000 (UTC) X-FDA: 80342750838.10.47F214C Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf06.hostedemail.com (Postfix) with ESMTP id 22B33180003 for ; Wed, 11 Jan 2023 14:29:17 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=qKNSjuF5; spf=none (imf06.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673447358; a=rsa-sha256; cv=none; b=QZtWI79ylCvsd5NxquWfZpRNwFgtlQ0aUFM5mK8PpnTgvCpehI0nJjDKSC+uYmjPv8poDs BbBtSfrzfVyLPkDIh+Tt8umnzMTiQP3rudIKi03kFgEZQ0C2LprvWfKDAabpYKeDGGlknV Aw/TOqcwMYRrvbfJLkRycwjFJGkcHaE= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=qKNSjuF5; spf=none (imf06.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673447358; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=WvVzapyi0dCw+kNmNHNzQOI1Ac8jKfCSQjkrQYngcng=; b=HKrUMkSqmxGFDq3BbbbEIpE2HIyr+oSONM6ZkYgyVjDcwEtjyCaSGgpz9K3E7/MSn82mmf /DsifRZHJndfI3hqeaTKVORMVI5vEeCL2AqrXu85dhlMWejm5jtlMZki+6Sm8+qCM0h7rK B60Z+V16CyKqQ1PjY5HGt8C3MoQX86w= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=WvVzapyi0dCw+kNmNHNzQOI1Ac8jKfCSQjkrQYngcng=; b=qKNSjuF5P+j8qQnMSSkvNbZkKJ RHmXnsAulsaJlUa7U/NHAjB8ojVPa71qiUAb4IdBLQyR/mnTotDKHSUQYp0BC1yHgc3ZT5s4DBm4s oiajxoHSweJ+L+qFx3sH8OdwFPQsjtgECv++9Cz9VIFrnUYJQ4D12r7ohB8Fvw9hOOuf5PxMae3EH ZRcPQSVGx9g4zSeuAjob2eShpJblxCZvEf6c9XDONYq27i1ZLfMGxkto93X9wI8kUbzYq/4Kr9yxh kfrmVtXXu7dLijEkuKVxDyyLuqCqsGNBjvVbYH61qeE7lnfslo6fFu8nRSy5uhU9zc/XErsZ8AUHI 6eUctIMg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pFc6O-004CXy-TE; Wed, 11 Jan 2023 14:29:16 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, Hugh Dickins Subject: [PATCH 03/28] doc: Clarify refcount section by referring to folios & pages Date: Wed, 11 Jan 2023 14:28:49 +0000 Message-Id: <20230111142915.1001531-4-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230111142915.1001531-1-willy@infradead.org> References: <20230111142915.1001531-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Queue-Id: 22B33180003 X-Rspamd-Server: rspam01 X-Stat-Signature: nu3tz1nbkm4u48fzsy94ukyeibmoz549 X-HE-Tag: 1673447357-762443 X-HE-Meta: U2FsdGVkX18e5c5xrcrSgVlCQuFVv8dU4smzvg0RGZadWWTVWDRDJTRQC5CVulTZUVjGEQW0UtfGxV0qKAY07YkLPIhxlOYy3cULKM6WQEPDquKlXzcSXTLq+5DohCoVcNuWVLRFJFX0PhRWdnI3b145U2fqB3COqeAhseqgO9XMPaNSvx3SzELaAqAynfdhd/7ya7t488YlEtaImutkYVqIxrX/ZyNZZ7X1fKQqESkvA5XFlHeHTrR21avkTfRmUJuVfdam18eXKSVBmohtRoPTEyLIEJ6w6BM8ohFq2AlVruACuuQmOGd9EHIVHeG2gMp/7x+SjsLEhrS10Ci/tEdJFW2A4RBlermXMBBWdat7crzBCOD971+oy2fH2X6jKvEYbUILYmADZEwtxVVDE2TK21VucyiOr1lOyzknZjEU3cK5I3W6D/LLD1x/12T+/95asVIufNmFEfKuuH7ee9MaavISwkP5LR8UBPvePS/gyP/wDmeAcghRP5bNl5ZMNqhVJYbG/V/bphK/Oe/QYPdgXWtsjRdztjhReOjDHWTycP9+6HTuPt5qIQu/pRDQxKHka8qm43fwUJwml+0jW0Gir0fNnX3uCZrP5sSTzP9YsQgLsrQgDLnlE1eoD5ycuXVUi1AnwanZDDcGw7Vr0Rr2xE9xy37oM24Z162cs5nocONqGSMxIHm4rpWY5Tyo1+5A4iFGrY3Bf2WDoLtXkpwd4U1/DcvAJ9x7Rw895SD4BcU1Af5saWMt80r/p0AUJXGWm+tvhLuoVd8Tq4SIaoPgk0ADJcVvy03nPC7wcCdFvjMSVohwdrM9Pguyht0FDt+ngCSUHtPXXvrJMTDlIRyE3/4r2J5ZrYiInGJ4ochV3695Rxnp5cc4HcJTaPzH 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: Include the rename of subpages_mapcount to _nr_pages_mapped. Signed-off-by: Matthew Wilcox (Oracle) --- Documentation/mm/transhuge.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Documentation/mm/transhuge.rst b/Documentation/mm/transhuge.rst index ec3dc5b04226..03bbd0a19041 100644 --- a/Documentation/mm/transhuge.rst +++ b/Documentation/mm/transhuge.rst @@ -112,20 +112,20 @@ Refcounts and transparent huge pages Refcounting on THP is mostly consistent with refcounting on other compound pages: - - get_page()/put_page() and GUP operate on head page's ->_refcount. + - get_page()/put_page() and GUP operate on the folio->_refcount. - ->_refcount in tail pages is always zero: get_page_unless_zero() never succeeds on tail pages. - - map/unmap of PMD entry for the whole compound page increment/decrement - ->compound_mapcount, stored in the first tail page of the compound page; - and also increment/decrement ->subpages_mapcount (also in the first tail) - by COMPOUND_MAPPED when compound_mapcount goes from -1 to 0 or 0 to -1. + - map/unmap of a PMD entry for the whole THP increment/decrement + folio->_entire_mapcount and also increment/decrement + folio->_nr_pages_mapped by COMPOUND_MAPPED when _entire_mapcount + goes from -1 to 0 or 0 to -1. - - map/unmap of sub-pages with PTE entry increment/decrement ->_mapcount - on relevant sub-page of the compound page, and also increment/decrement - ->subpages_mapcount, stored in first tail page of the compound page, when - _mapcount goes from -1 to 0 or 0 to -1: counting sub-pages mapped by PTE. + - map/unmap of individual pages with PTE entry increment/decrement + page->_mapcount and also increment/decrement folio->_nr_pages_mapped + when page->_mapcount goes from -1 to 0 or 0 to -1 as this counts + the number of pages mapped by PTE. split_huge_page internally has to distribute the refcounts in the head page to the tail pages before clearing all PG_head/tail bits from the page -- 2.35.1