<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/proc/page.c, branch linux-6.15.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-03-18T05:06:47Z</updated>
<entry>
<title>fs/proc/page: remove per-page mapcount dependency for /proc/kpagecount (CONFIG_NO_PAGE_MAPCOUNT)</title>
<updated>2025-03-18T05:06:47Z</updated>
<author>
<name>David Hildenbrand</name>
</author>
<published>2025-03-03T16:30:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ae4192b7691cbd18aa6e286f4ccaf5ab574fc9cf'/>
<id>urn:sha1:ae4192b7691cbd18aa6e286f4ccaf5ab574fc9cf</id>
<content type='text'>
Let's implement an alternative when per-page mapcounts in large folios are
no longer maintained -- soon with CONFIG_NO_PAGE_MAPCOUNT.

For large folios, we'll return the per-page average mapcount within the
folio, whereby we round to the closest integer when calculating the
average: however, we'll always return at least 1 if the folio is mapped.

So assuming a folio with 512 pages, the average would be:
* 0 if not pages are mapped
* 1 if there are 1 .. 767 per-page mappings
* 2 if there are 767 .. 1279 per-page mappings
...

For hugetlb folios and for large folios that are fully mapped into all
address spaces, there is no change.

We'll make use of this helper in other context next.

As an alternative, we could simply return 0 for non-hugetlb large folios,
or disable this legacy interface with CONFIG_NO_PAGE_MAPCOUNT.

But the information exposed by this interface can still be valuable, and
frequently we deal with fully-mapped large folios where the average
corresponds to the actual page mapcount.  So we'll leave it like this for
now and document the new behavior.

Note: this interface is likely not very relevant for performance.  If ever
required, we could try doing a rather expensive rmap walk to collect
precisely how often this folio page is mapped.

Link: https://lkml.kernel.org/r/20250303163014.1128035-17-david@redhat.com
Signed-off-by: David Hildenbrand &lt;david@redhat.com&gt;
Cc: Andy Lutomirks^H^Hski &lt;luto@kernel.org&gt;
Cc: Borislav Betkov &lt;bp@alien8.de&gt;
Cc: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Jann Horn &lt;jannh@google.com&gt;
Cc: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Cc: Jonathan Corbet &lt;corbet@lwn.net&gt;
Cc: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Cc: Lance Yang &lt;ioworker0@gmail.com&gt;
Cc: Liam Howlett &lt;liam.howlett@oracle.com&gt;
Cc: Lorenzo Stoakes &lt;lorenzo.stoakes@oracle.com&gt;
Cc: Matthew Wilcow (Oracle) &lt;willy@infradead.org&gt;
Cc: Michal Koutn &lt;mkoutny@suse.com&gt;
Cc: Muchun Song &lt;muchun.song@linux.dev&gt;
Cc: tejun heo &lt;tj@kernel.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Cc: Zefan Li &lt;lizefan.x@bytedance.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>x86: remove PG_uncached</title>
<updated>2024-09-04T04:15:46Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
</author>
<published>2024-08-21T19:34:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7a87225ae2c6c317c7b80cf599e5cf0eee699196'/>
<id>urn:sha1:7a87225ae2c6c317c7b80cf599e5cf0eee699196</id>
<content type='text'>
Convert x86 to use PG_arch_2 instead of PG_uncached and remove
PG_uncached.

Link: https://lkml.kernel.org/r/20240821193445.2294269-11-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm: rename PG_mappedtodisk to PG_owner_2</title>
<updated>2024-09-04T04:15:45Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
</author>
<published>2024-08-21T19:34:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=02e1960aafac33721401dcd92e915325fdb524b2'/>
<id>urn:sha1:02e1960aafac33721401dcd92e915325fdb524b2</id>
<content type='text'>
This flag has similar constraints to PG_owner_priv_1 -- it is ignored by
core code, and is entirely for the use of the code which allocated the
folio.  Since the pagecache does not use it, individual filesystems can
use it.  The bufferhead code does use it, so filesystems which use the
buffer cache must not use it for another purpose.

Link: https://lkml.kernel.org/r/20240821193445.2294269-10-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm: remove PG_error</title>
<updated>2024-09-02T03:26:05Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
</author>
<published>2024-08-07T19:35:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=09022bc196d23484a7a5d48cf373f8583e3fcf23'/>
<id>urn:sha1:09022bc196d23484a7a5d48cf373f8583e3fcf23</id>
<content type='text'>
The PG_error bit is now unused; delete it and free up a bit in
page-&gt;flags.

Link: https://lkml.kernel.org/r/20240807193528.1865100-2-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>kpageflags: detect isolated KPF_THP folios</title>
<updated>2024-07-12T22:52:21Z</updated>
<author>
<name>Ran Xiaokai</name>
</author>
<published>2024-07-05T10:43:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4c8763e84aae4d04d94b35aca9f7db6a8930ad77'/>
<id>urn:sha1:4c8763e84aae4d04d94b35aca9f7db6a8930ad77</id>
<content type='text'>
When folio is isolated, the PG_lru bit is cleared.  So the PG_lru check in
stable_page_flags() will miss this kind of isolated folios.  Use
folio_test_large_rmappable() instead to also include isolated folios.

Since pagecache supports large folios and the introduction of mTHP, the
semantics of KPF_THP have been expanded, now it indicates not only
PMD-sized THP.  Update related documentation to clearly state that KPF_THP
indicates multiple order THPs.

[ran.xiaokai@zte.com.cn: directly use is_zero_folio(), per David]
  Link: https://lkml.kernel.org/r/20240708062601.165215-1-ranxiaokai627@163.com
Link: https://lkml.kernel.org/r/20240705104343.112680-1-ranxiaokai627@163.com
Signed-off-by: Ran Xiaokai &lt;ran.xiaokai@zte.com.cn&gt;
Acked-by: David Hildenbrand &lt;david@redhat.com&gt;
Cc: Andrei Vagin &lt;avagin@google.com&gt;
Cc: Jonathan Corbet &lt;corbet@lwn.net&gt;
Cc: Muhammad Usama Anjum &lt;usama.anjum@collabora.com&gt;
Cc: Ryan Roberts &lt;ryan.roberts@arm.com&gt;
Cc: Svetly Todorov &lt;svetly.todorov@memverge.com&gt;
Cc: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Cc: Zi Yan &lt;ziy@nvidia.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fs/proc: move page_mapcount() to fs/proc/internal.h</title>
<updated>2024-07-04T02:30:06Z</updated>
<author>
<name>David Hildenbrand</name>
</author>
<published>2024-06-07T12:23:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cdd9a571b7d8465353fe2e2d8d1edd8a58d82021'/>
<id>urn:sha1:cdd9a571b7d8465353fe2e2d8d1edd8a58d82021</id>
<content type='text'>
...  and rename it to folio_precise_page_mapcount().  fs/proc is the last
remaining user, and that should stay that way.

While at it, cleanup kpagecount_read() a bit: there are still some legacy
leftovers -- when the interface was introduced it returned the page
refcount, but was changed briefly afterwards to return the page mapcount. 
Further, some simple folio conversion.

Once we stop using the per-page mapcounts of large folios, all
folio_precise_page_mapcount() users will have to implement an alternative
way to achieve what they are trying to achieve, possibly in a less precise
way.

[dan.carpenter@linaro.org: fix uninitialized variable in pagemap_pmd_range()]
  Link: https://lkml.kernel.org/r/9d6eaba7-92f8-4a70-8765-38a519680a87@moroto.mountain
Link: https://lkml.kernel.org/r/20240607122357.115423-6-david@redhat.com
Signed-off-by: David Hildenbrand &lt;david@redhat.com&gt;
Signed-off-by: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: Jonathan Corbet &lt;corbet@lwn.net&gt;
Cc: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Cc: Lance Yang &lt;ioworker0@gmail.com&gt;
Cc: Oscar Salvador &lt;osalvador@suse.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm: add is_huge_zero_folio()</title>
<updated>2024-04-26T03:56:18Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
</author>
<published>2024-03-26T20:28:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5beaee54a324ba1fe307e341ec825d5d099f4091'/>
<id>urn:sha1:5beaee54a324ba1fe307e341ec825d5d099f4091</id>
<content type='text'>
This is the folio equivalent of is_huge_zero_page().  It doesn't add any
efficiency, but it does prevent the caller from passing a tail page and
getting confused when the predicate returns false.

Link: https://lkml.kernel.org/r/20240326202833.523759-3-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Reviewed-by: David Hildenbrand &lt;david@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>proc: rewrite stable_page_flags()</title>
<updated>2024-04-26T03:56:15Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
</author>
<published>2024-03-26T17:10:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dee3d0bef2b00772be430425832ead6aa9d707f9'/>
<id>urn:sha1:dee3d0bef2b00772be430425832ead6aa9d707f9</id>
<content type='text'>
Reduce the usage of PageFlag tests and reduce the number of
compound_head() calls.

For multi-page folios, we'll now show all pages as having the flags that
apply to them, e.g.  if it's dirty, all pages will have the dirty flag set
instead of just the head page.  The mapped flag is still per page, as is
the hwpoison flag.

[willy@infradead.org: fix up some bits vs masks]
  Link: https://lkml.kernel.org/r/20240403173112.1450721-1-willy@infradead.org
[willy@infradead.org: fix warnings]
  Link: https://lkml.kernel.org/r/ZhBPtCYfSuFuUMEz@casper.infradead.org
Link: https://lkml.kernel.org/r/20240326171045.410737-11-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Reviewed-by: Svetly Todorov &lt;svetly.todorov@memverge.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm: support page_mapcount() on page_has_type() pages</title>
<updated>2024-04-25T02:34:26Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
</author>
<published>2024-03-21T14:24:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fd1a745ce03e37945674c14833870a9af0882e2d'/>
<id>urn:sha1:fd1a745ce03e37945674c14833870a9af0882e2d</id>
<content type='text'>
Return 0 for pages which can't be mapped.  This matches how page_mapped()
works.  It is more convenient for users to not have to filter out these
pages.

Link: https://lkml.kernel.org/r/20240321142448.1645400-5-willy@infradead.org
Fixes: 9c5ccf2db04b ("mm: remove HUGETLB_PAGE_DTOR")
Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Reviewed-by: David Hildenbrand &lt;david@redhat.com&gt;
Acked-by: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Cc: Miaohe Lin &lt;linmiaohe@huawei.com&gt;
Cc: Muchun Song &lt;muchun.song@linux.dev&gt;
Cc: Oscar Salvador &lt;osalvador@suse.de&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm, pagemap: remove SLOB and SLQB from comments and documentation</title>
<updated>2023-03-29T08:32:11Z</updated>
<author>
<name>Vlastimil Babka</name>
</author>
<published>2023-02-28T10:07:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d88e2a2bd20562048a263ca6a0f939c2695ffb2e'/>
<id>urn:sha1:d88e2a2bd20562048a263ca6a0f939c2695ffb2e</id>
<content type='text'>
SLOB has been removed and SLQB never merged, so remove their mentions
from comments and documentation of pagemap.

In stable_page_flags() also correct an outdated comment mentioning that
PageBuddy() means a page-&gt;_refcount of -1, and remove compound_head()
from the PageSlab() call, as that's already implicitly there thanks to
PF_NO_TAIL.

Signed-off-by: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Acked-by: Lorenzo Stoakes &lt;lstoakes@gmail.com&gt;
Acked-by: Mike Rapoport (IBM) &lt;rppt@kernel.org&gt;
</content>
</entry>
</feed>
