From patchwork Tue Mar 26 17:10:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13604738 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 E9DD4C6FD1F for ; Tue, 26 Mar 2024 17:10:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6A19A6B0099; Tue, 26 Mar 2024 13:10:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 652866B009B; Tue, 26 Mar 2024 13:10:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 51A706B009C; Tue, 26 Mar 2024 13:10:53 -0400 (EDT) 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 3E9686B0099 for ; Tue, 26 Mar 2024 13:10:53 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 138E1A100C for ; Tue, 26 Mar 2024 17:10:53 +0000 (UTC) X-FDA: 81939829986.26.25687AE Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf23.hostedemail.com (Postfix) with ESMTP id 25AAC14000C for ; Tue, 26 Mar 2024 17:10:49 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=maGghM32; spf=none (imf23.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=1711473051; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Uhj4LFxY9aLFI+gEf50yKVE/27RxcTXFlPgFk6W5CKM=; b=IeqgCGGmarxpsVebgMC3c6am9f6g36jmz2WT3pml5/Q7iLnyS7GzA1q0z3uZoiuvD+KQAa zNle7AYoDyZClkteinh/uTYdrgUkBmekkgp07XQVEvq45LhqC8SWc4Pwe/b13NE4vXJLmO 5PnpVYmwbXNJI/tXy+GgYj9ebpJ9MMg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711473051; a=rsa-sha256; cv=none; b=CTCtI8NGiUWQPSfRuAhYUbLfDWfJmiEdrLjOwTCQg/FWtwcdPpgDhc8/cQNVzDvd4XblDA pIKHWPw+RroWNmekhQvQdn/NNmWRbZixeH5PNEUxg3VImJzSejeIh/hpvx2/wNJ5jdr860 snFUPKsTEGNEA+qQFLcacnEUUFzO6g8= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=maGghM32; spf=none (imf23.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=Uhj4LFxY9aLFI+gEf50yKVE/27RxcTXFlPgFk6W5CKM=; b=maGghM32kuTdWeRz7vCjxKXeP7 8xo77I5/IXnwsep64qauhcUWU7GBeqJ63Y/LflMm1AO0ko1+BPE7tR1ao7R+RNNgcugcormMozmEW Hcbfg4Ew0QUqnB8pC0fnlDnCmQ2gffMmfGJ1bOwjdIq+vRZtMIfrABSEMHBOnpNuTm5/mXb6EohLv 9EGoX0tbLocD5wC7QReHA7d/lLDrzH0AQvVmkvSK9MFLAQslrxqCOZUh+DR8wkpborTvi0kbqmZ0J Ogf2I4RQPH7+82QnsR26sGx2ZtmYP65vyJw8a3dOGuHM3WpaeOY3uRBz5FImClNflVamuETDcOyOM c92P/MWw==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpAK0-00000001isf-2t4X; Tue, 26 Mar 2024 17:10:48 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 09/10] Remove references to page->flags in documentation Date: Tue, 26 Mar 2024 17:10:31 +0000 Message-ID: <20240326171045.410737-10-willy@infradead.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240326171045.410737-1-willy@infradead.org> References: <20240326171045.410737-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 25AAC14000C X-Rspam-User: X-Stat-Signature: 5g1nouyg8srna5cyza5a3xj5r8qtxfu5 X-Rspamd-Server: rspam03 X-HE-Tag: 1711473049-524024 X-HE-Meta: U2FsdGVkX19zIqLh1NRwCxEW5gl7gKfD/6Zu8zMMOWx7IdlOQaCW4zOQh7g0/p9Qe0MlMxOYwXqxaYe5zwzmPsJdJWe9plz55YPjKPFRykRcEyGwxdeSpAVGI1fcf+LpoFmZGW5RbZqWK6Huw9xYnyWAgAv7il1CAofr7r5cHtiWmIQFbr8L4a7VBeFlaRHNF5SeZUGbqhdv3CuhBrAo9VYXFSmtJKiEBAk1kVOqopijJ7EbhJ5Kp+g/9NA/uy95akwgWvh3qyr7edLnsehWg+s9AjXP3OE4NrOoyANUH7m62jJ0ZMeo2sO2qHgMBxPaBSqGPrLMwONWUM51pXREADW12uMZiZB+HH2sgeWqy13bqVr4LkhXIzlLg+gxNTO3OlJj2uuxn/vxQVvEQvGYmlFO9kVLKqkGW83IcT1zoczTbB3LfLo4+jziVimpDSvsjTGR/okAy4eJl3PanxDEb4VdWhaHvJ7ENDTrgmv6hov9yPod/nv5pZ2VrXOyPo5E5XoGn5McbduWx/PQtrJsxwrJaCvkWKaGDc8fg7bnyre32XVPTHIMUrNRtJldo7lwIogXaXCjOc3BhwUeBtyPjm1ho40tLR3FYCl/dvpMp+N7Fkuf6EOnyVP45KkLf8MUsyaKh8xZP8KKR4K2w51dWDdGnmd+k+6xuzAJGgC3ucPnbe5IXc0+fvytCZdL16LP8cCg2EuI23lsrSG23YzGg05VrnezzdE1nopjWLoGSY0PDNhr/RF8Ru/IsWX3Rdwzx/U5lRZk1MFEWxPZ5qVgDPlozsWL7Xfcrv/cmCC9tY41bvcgtwO96G1qk65AvKVB40/fBpAipZ11Q23ibMQV65i63rGZkmpo5gaj2KycrHzZK8JAqTemPw/IfP6w4fR5rYuIIYO9qvyIQmR95xiLBfminWKp3uvxWu5LRf2ObPs8FWBt7fxWAPOjk6OREc5S35lACh2AsCnFnoaiVVS puIE1z+U CMZFSZXyr9gr1r1PEZusO3MbtQ7O1ZVyAHaIxJIC5NKfQ1sLjK9wHwLA8HAlaHM01DgQjKB+ziopI6URsMXxxizMUYXPVYvUpB2SS5+sxymdFcgPcG/GIudBofFocXB2ruk/EcZ5sWPpi5jnvKRxmui3VIzuqONxXITi1LO16dMrbyRFwcuRqbs1dJTopmsJJQuZ9+vh9dVpsF2+8MRF1mGhcsw== 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: List-Subscribe: List-Unsubscribe: Mostly rewording, but remove entirely the copy of page_fixed_fake_head() in the documentation; we can refer people to the actual source if necessary. Signed-off-by: Matthew Wilcox (Oracle) --- .../admin-guide/cgroup-v1/memory.rst | 4 ++-- Documentation/mm/vmemmap_dedup.rst | 22 +------------------ .../translations/zh_CN/core-api/cachetlb.rst | 2 +- mm/migrate.c | 2 +- mm/rmap.c | 4 ++-- 5 files changed, 7 insertions(+), 27 deletions(-) diff --git a/Documentation/admin-guide/cgroup-v1/memory.rst b/Documentation/admin-guide/cgroup-v1/memory.rst index ca7d9402f6be..46110e6a31bb 100644 --- a/Documentation/admin-guide/cgroup-v1/memory.rst +++ b/Documentation/admin-guide/cgroup-v1/memory.rst @@ -300,14 +300,14 @@ When oom event notifier is registered, event will be delivered. Lock order is as follows:: - Page lock (PG_locked bit of page->flags) + folio_lock mm->page_table_lock or split pte_lock folio_memcg_lock (memcg->move_lock) mapping->i_pages lock lruvec->lru_lock. Per-node-per-memcgroup LRU (cgroup's private LRU) is guarded by -lruvec->lru_lock; PG_lru bit of page->flags is cleared before +lruvec->lru_lock; the folio LRU flag is cleared before isolating a page from its LRU under lruvec->lru_lock. .. _cgroup-v1-memory-kernel-extension: diff --git a/Documentation/mm/vmemmap_dedup.rst b/Documentation/mm/vmemmap_dedup.rst index 593ede6d314b..b4a55b6569fa 100644 --- a/Documentation/mm/vmemmap_dedup.rst +++ b/Documentation/mm/vmemmap_dedup.rst @@ -180,27 +180,7 @@ this correctly. There is only **one** head ``struct page``, the tail ``struct page`` with ``PG_head`` are fake head ``struct page``. We need an approach to distinguish between those two different types of ``struct page`` so that ``compound_head()`` can return the real head ``struct page`` when the -parameter is the tail ``struct page`` but with ``PG_head``. The following code -snippet describes how to distinguish between real and fake head ``struct page``. - -.. code-block:: c - - if (test_bit(PG_head, &page->flags)) { - unsigned long head = READ_ONCE(page[1].compound_head); - - if (head & 1) { - if (head == (unsigned long)page + 1) - /* head struct page */ - else - /* tail struct page */ - } else { - /* head struct page */ - } - } - -We can safely access the field of the **page[1]** with ``PG_head`` because the -page is a compound page composed with at least two contiguous pages. -The implementation refers to ``page_fixed_fake_head()``. +parameter is the tail ``struct page`` but with ``PG_head``. Device DAX ========== diff --git a/Documentation/translations/zh_CN/core-api/cachetlb.rst b/Documentation/translations/zh_CN/core-api/cachetlb.rst index b4a76ec75daa..64295c61d1c1 100644 --- a/Documentation/translations/zh_CN/core-api/cachetlb.rst +++ b/Documentation/translations/zh_CN/core-api/cachetlb.rst @@ -260,7 +260,7 @@ HyperSparc cpu就是这样一个具有这种属性的cpu。 如果D-cache别名不是一个问题,这个程序可以简单地定义为该架构上 的nop。 - 在page->flags (PG_arch_1)中有一个位是“架构私有”。内核保证, + 在folio->flags (PG_arch_1)中有一个位是“架构私有”。内核保证, 对于分页缓存的页面,当这样的页面第一次进入分页缓存时,它将清除 这个位。 diff --git a/mm/migrate.c b/mm/migrate.c index 6dc73c438717..5c546583594d 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -113,7 +113,7 @@ bool isolate_movable_page(struct page *page, isolate_mode_t mode) if (!mops->isolate_page(&folio->page, mode)) goto out_no_isolated; - /* Driver shouldn't use PG_isolated bit of page->flags */ + /* Driver shouldn't use the isolated flag */ WARN_ON_ONCE(folio_test_isolated(folio)); folio_set_isolated(folio); folio_unlock(folio); diff --git a/mm/rmap.c b/mm/rmap.c index d52759aa3ff7..5ee9e338d09b 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -23,7 +23,7 @@ * inode->i_rwsem (while writing or truncating, not reading or faulting) * mm->mmap_lock * mapping->invalidate_lock (in filemap_fault) - * page->flags PG_locked (lock_page) + * folio_lock * hugetlbfs_i_mmap_rwsem_key (in huge_pmd_share, see hugetlbfs below) * vma_start_write * mapping->i_mmap_rwsem @@ -50,7 +50,7 @@ * hugetlb_fault_mutex (hugetlbfs specific page fault mutex) * vma_lock (hugetlb specific lock for pmd_sharing) * mapping->i_mmap_rwsem (also used for hugetlb pmd sharing) - * page->flags PG_locked (lock_page) + * folio_lock */ #include