Files
ack-tegra/include/linux
Matthew Wilcox (Oracle) d99e3140a4 mm: turn folio_test_hugetlb into a PageType
The current folio_test_hugetlb() can be fooled by a concurrent folio split
into returning true for a folio which has never belonged to hugetlbfs. 
This can't happen if the caller holds a refcount on it, but we have a few
places (memory-failure, compaction, procfs) which do not and should not
take a speculative reference.

Since hugetlb pages do not use individual page mapcounts (they are always
fully mapped and use the entire_mapcount field to record the number of
mappings), the PageType field is available now that page_mapcount()
ignores the value in this field.

In compaction and with CONFIG_DEBUG_VM enabled, the current implementation
can result in an oops, as reported by Luis. This happens since 9c5ccf2db0
("mm: remove HUGETLB_PAGE_DTOR") effectively added some VM_BUG_ON() checks
in the PageHuge() testing path.

[willy@infradead.org: update vmcoreinfo]
  Link: https://lkml.kernel.org/r/ZgGZUvsdhaT1Va-T@casper.infradead.org
Link: https://lkml.kernel.org/r/20240321142448.1645400-6-willy@infradead.org
Fixes: 9c5ccf2db0 ("mm: remove HUGETLB_PAGE_DTOR")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Reported-by: Luis Chamberlain <mcgrof@kernel.org>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218227
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-04-24 19:34:26 -07:00
..
…
…
…
2024-03-07 21:52:03 +00:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-03-27 13:17:15 +01:00
…
…
…
2024-03-11 15:37:23 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-03-07 20:37:04 +00:00
…
…
…
2024-02-20 14:22:55 -05:00
2024-02-20 14:22:51 -05:00
…
…
…
…
…
…
…
…
…
…
…
2024-03-12 23:08:29 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-02-25 12:05:08 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-03-07 09:36:08 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-02-28 19:36:39 -08:00
…
…
…
2024-03-10 14:38:04 -07:00
…
2024-02-15 23:43:48 -05:00
…
…
…
…
…
…
…
2024-02-14 11:14:40 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-02-17 16:20:41 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-03-13 18:38:13 -04:00
…
…
…
…
…
…
…
2024-03-06 13:04:18 -08:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-03-01 08:44:54 +00:00
…
…
…
…
2024-03-09 09:14:51 -05:00
…
2024-03-09 09:14:50 -05:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-03-26 11:07:20 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-03-13 12:53:53 -07:00
2024-03-13 12:53:53 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-03-08 12:05:10 +01:00
…
…
…
…
…
…
…
…
…
…
…
2024-02-15 12:17:28 -05:00
…
…
…
2024-03-03 15:06:58 -08:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-02-20 13:36:34 +01:00
2024-03-04 20:46:18 -08:00
2024-03-04 17:25:09 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-02-18 18:59:59 +01:00
…
…
…
…
…
2024-03-06 10:52:12 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2024-02-09 12:07:48 +00:00
…
…
…
…
…
…
…
…
…
…
…