From patchwork Sat Dec 31 21:45:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13086174 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 BF9BFC4167B for ; Sat, 31 Dec 2022 21:46:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BB4F78E000B; Sat, 31 Dec 2022 16:46:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B3F9A8E0001; Sat, 31 Dec 2022 16:46:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9B9088E000B; Sat, 31 Dec 2022 16:46:16 -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 6480B8E0001 for ; Sat, 31 Dec 2022 16:46:16 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 3892F1A05A5 for ; Sat, 31 Dec 2022 21:46:16 +0000 (UTC) X-FDA: 80303935152.01.213DB4C Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf29.hostedemail.com (Postfix) with ESMTP id AA7A8120003 for ; Sat, 31 Dec 2022 21:46:13 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=i57N+Hwh; spf=none (imf29.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=1672523173; 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=77H6Q4dt+ZUoMQWD1/PUeQ/kdsC/FLd3rz8yD/J+ef/rRbIPVPsy/+wuRW+Nu3rRHQdh5U xEURaJzUjGmJYPLz6YVTrwjQucoueAUHnf0unaE/76yFgjWf5JhJpHk4EBqEsftm4DoLEh BWhek30w/An2UfcrbPHPEl2YgwbLhtY= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=i57N+Hwh; spf=none (imf29.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=1672523173; a=rsa-sha256; cv=none; b=c/mD96FaVAxSRI2zIhGwScAv3K+BULTzPhCU1vG68HzPuU4JzE9zQ5EqlxGHQlr9W1tK6a xcJzVzZwEZ0orPnjzi7nJ1Ybp9ttnKE+8XQOk6Gp4nu5ti9didFxrB4nv/mFGgzeUtDg0D ilsU6XlOimD4bE03o4W33jKKjhvsj2I= 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=i57N+Hwh8G7gZw4PSLejBH0ZDd EQc/mMknBgINjjrvGOydPCiMXLYzP3dHou2IQ/C9w+4J08fsBP2l6wZt5y7OAqIcWnYUqiRDk0koY 9RL3xo3st0GTcu+BTgB3rNwSJkRL1fTeHX6txX1gFPKMszx0nSU7Jq2+8df6ScROs4mz7njMRqXDX wNrSozQIF+LC/VfaEk9kTC021IDuzsCPYg4+a2dT94w3IMrSDcBibuzn30pIsovIyeDbdlzttdRet 4JdyvP0kl2Ucew4zyLz6Fi1k3Giqq9um2ZZLUQgNAT0xW9lX0VmuQAy87BXJbh8AcCdppVpMgOqwF UIPVRTPw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pBjgC-00BkaX-UT; Sat, 31 Dec 2022 21:46:12 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, Hugh Dickins Subject: [PATCH 03/22] doc: Clarify refcount section by referring to folios & pages Date: Sat, 31 Dec 2022 21:45:51 +0000 Message-Id: <20221231214610.2800682-4-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221231214610.2800682-1-willy@infradead.org> References: <20221231214610.2800682-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: AA7A8120003 X-Stat-Signature: hmzzntarnb5psrag3g44btp8461ptunz X-Rspam-User: X-HE-Tag: 1672523173-489429 X-HE-Meta: U2FsdGVkX18WJFvFYQgnCi52ve+8l+LjpqERuZWxkVXelVA3bUylE3nHJSXV1sB4ceBNFzchiZt4qBMLVDPXLjnH3m/pU2TR7WXsmU38hyeb54HYi/BxhGw8oq0wiXc+bEXjqxGpdnQcz8omjMBFTAkDukVGSquIYozPgleCw6FuHBn4rIZ3peYKy5NuuKlagTNcn0i6letv8uyzXUB8HrXTgKwfh2yXSuQ9YQSU/Mo7V+teQHWNUeJzdqg27gCDp+LO96gZACxTbYertoe/D3cPyR12p8FT3qd1W6S4IozfWnR9YUoUbqUunH/9Qby7eru2QpF75b4HBNbSqwHmzQnu2vOlB3I+wOJl0d9Ipa/b9kFXUnKfTMC/TIHTXt3d6TS0sS5VH/J2IyF4tOfmGCUIe5hFZcF38qmJF6w3dS9Np9wxyIThX8xB8vm8ZvAbyFZnHt65oZLmQwQVv8nCyUODuSk1jzNUMOK5NAdL/hpUGdOYvTcbI8f4BcZ/VY/9cUkI/e/tothshudRufdjFg3c2L8kvhC0VylYJa2G6F0p+wIneMvf5onC7nTQWSfUeX4fFFbkE4K5vHgLnzaHBXuHpNUnCW17MnWxxPR5iCIvMt42ftKAsucKvxa8lQ4Uh3jxujBMnAONjZF3Z82jEtTzx3M9OSxsIxECPiF5dc0a+KIv6FeWxKgeCFykkTQ/ZVyP4Y+Hf6Ku/g5Erp4C/sjirYZKxA6G0HIso+SeyI/lDGsSfM7Xqs6eg8MPWQiEPRc+tWTmqHHdXOFRCN+a7OG7T1Q7uKCmavrgWPtM+D7jzi8/KtrXbrY0mP1+9KDpSmwam38enUCWRGNefAlaDKA2zGuraTnLKR9dqzVKBPHSIuoCeA8DMSBbxOdWzfO3 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