13255 Commits

Author SHA1 Message Date
Andrew Chant
a6ed537986 Revert "mm, oom: check LMK enabled for pagefault_out_of_memory()"
This reverts commit 94c0e1ab2c.

We will not use in-kernel LMK any longer so do not
make divergent from upstream unnecessary.

Bug: 129765516
Change-Id: I2cb3d156de1305ba517e9544679634b2e7fe0fc5
Signed-off-by: Andrew Chant <achant@google.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:48 +05:30
Ashwini Oruganti
f9d4d4f4d7 Revert "mm: oom_kill: reap memory of a task that receives SIGKILL"
This reverts commit 724adb4433.

Reason for revert: The changes introduced in this commit are causing an
undesirable SELinux denial as a side-effect. Additionally, it appears
(http://b/130391762) that we do not enable the functionality that this
commit adds. Reverting the commit fixes the SELinux denial bug.

Bug: 138594811
Change-Id: Ie440e290dc89b72c46de2194da0275910c03a66d
Signed-off-by: Ashwini Oruganti <ashfall@google.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:48 +05:30
Wilson Sung
0bb4673953 Revert "mm: reduce the time spend by killed tasks in alloc path"
This reverts commit c31eadb2f7.

Bug: 128591321
Bug: 128639903
Bug: 127924739
Change-Id: I4c022958a52cf6e82130a1dc87bc73210ad53245
Signed-off-by: Wilson Sung <wilsonsung@google.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:48 +05:30
Jaewon Kim
855f819cdb BACKPORT: mm/vmscan: count layzfree pages and fix nr_isolated_* mismatch
Fix an nr_isolate_* mismatch problem between cma and dirty lazyfree pages.

If try_to_unmap_one is used for reclaim and it detects a dirty lazyfree
page, then the lazyfree page is changed to a normal anon page having
SwapBacked by commit 802a3a92ad ("mm: reclaim MADV_FREE pages").  Even
with the change, reclaim context correctly counts isolated files because
it uses is_file_lru to distinguish file.  And the change to anon is not
happened if try_to_unmap_one is used for migration.  So migration context
like compaction also correctly counts isolated files even though it uses
page_is_file_lru insted of is_file_lru.  Recently page_is_file_cache was
renamed to page_is_file_lru by commit 9de4f22a60f7 ("mm: code cleanup for
MADV_FREE").

But the nr_isolate_* mismatch problem happens on cma alloc.  There is
reclaim_clean_pages_from_list which is being used only by cma.  It was
introduced by commit 02c6de8d75 ("mm: cma: discard clean pages during
contiguous allocation instead of migration") to reclaim clean file pages
without migration.  The cma alloc uses both reclaim_clean_pages_from_list
and migrate_pages, and it uses page_is_file_lru to count isolated files.
If there are dirty lazyfree pages allocated from cma memory region, the
pages are counted as isolated file at the beginging but are counted as
isolated anon after finished.

Mem-Info:
Node 0 active_anon:3045904kB inactive_anon:611448kB active_file:14892kB inactive_file:205636kB unevictable:10416kB isolated(anon):0kB isolated(file):37664kB mapped:630216kB dirty:384kB writeback:0kB shmem:42576kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no

Like log above, there were too much isolated files, 37664kB, which
triggers too_many_isolated in reclaim even when there is no actually
isolated file in system wide.  It could be reproducible by running two
programs, writing on MADV_FREE page and doing cma alloc, respectively.
Although isolated anon is 0, I found that the internal value of isolated
anon was the negative value of isolated file.

Fix this by compensating the isolated count for both LRU lists.  Count
non-discarded lazyfree pages in shrink_page_list, then compensate the
counted number in reclaim_clean_pages_from_list.

Reported-by: Yong-Taek Lee <ytk.lee@samsung.com>
Suggested-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Jaewon Kim <jaewon31.kim@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Minchan Kim <minchan@kernel.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Michal Nazarewicz <mina86@mina86.com>
Cc: Shaohua Li <shli@fb.com>
Link: http://lkml.kernel.org/r/20200426011718.30246-1-jaewon31.kim@samsung.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Minchan Kim <minchan@google.com>
(cherry picked from commit 1f318a9b0dc3990490e98eef48f21e6f15185781)
Bug: 169151810
Change-Id: Iefa0d8ab819d9297167d1a47bcf1e38c7dc91c69
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:48 +05:30
Christoph Hellwig
5ec87c529c block: add a poll_fn callback to struct request_queue
That we we can also poll non blk-mq queues.  Mostly needed for
the NVMe multipath code, but could also be useful elsewhere.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:45 +05:30
Minchan Kim
aeae075284 mm: allow __GFP_MOVABLE to use CMA memory
There was some report many 0-order page allocation failure[2] from zsmalloc.
It happened even though we have enough available free pages but yes, they are
mostly CMA area.

zsmalloc has supported migration so it should be no problem to use CMA memory.
That was the reason I made non-lru page migration[3] in MM. However, QC added
[1] to increase CMA memory utilization and breaks the rule that MIGRATE_MOVABLE
is inherently movable pages.

This patch restores __GFP_MOVABLE allocation from CMA memory.

[1] 2c0f71c8aac9, mm: add cma pcp list
[2] page allocation failure
[3] https://lwn.net/Articles/685231/

12-26 17:45:40.782 10133  8079  8079 W sync-preprocess: page allocation failure: order:0, mode:0x240000a(GFP_NOIO|__GFP_HIGHMEM|__GFP_MOVABLE)
12-26 17:45:40.782 10133  8079  8079 W Call trace:
12-26 17:45:40.782 10133  8079  8079 W         : [<ffffff86ec5d1a0c>] dump_backtrace+0x0/0x4
12-26 17:45:40.782 10133  8079  8079 W         : [<ffffff86eb2dc098>] dump_stack+0xcc/0x104
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf0ceb8>] warn_alloc+0xd4/0x15c
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf0b880>] __alloc_pages_nodemask+0xf5c/0xf6c
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eafa7e80>] zs_malloc+0x240/0x7c0
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eb7af48c>] zram_bvec_rw+0x28c/0xf3c
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eb7aeef4>] zram_rw_page+0xc0/0x1c4
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eb0252fc>] bdev_write_page+0x88/0x1b4
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf7bf38>] __swap_writepage+0x64/0x630
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf7bec8>] swap_writepage+0x90/0x9c
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf28240>] shrink_page_list+0x940/0x1418
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf26a48>] shrink_inactive_list+0x728/0xc8c
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf2544c>] shrink_node_memcg+0x3b8/0xb88
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf24a0c>] shrink_node+0x258/0x48c
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf2c304>] do_try_to_free_pages+0x270/0x328
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf2becc>] try_to_free_pages+0x894/0xa5c
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf0af8c>] __alloc_pages_nodemask+0x668/0xf6c
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf19780>] __do_page_cache_readahead+0x150/0x42c
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf19c6c>] ondemand_readahead+0x210/0x3c0
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eaf02930>] generic_file_read_iter+0x1a0/0xda4
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eafb0e70>] __vfs_read+0x104/0x1a4
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eafb0cd4>] vfs_read+0xa0/0x138
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eb164ce0>] sdcardfs_read+0x20/0x44
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eafb0db8>] __vfs_read+0x4c/0x1a4
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eafb0cd4>] vfs_read+0xa0/0x138
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eafb2b0c>] SyS_read+0x9c/0x12c
12-26 17:45:40.783 10133  8079  8079 W         : [<ffffff86eac8425c>] __sys_trace_return+0x0/0x4
12-26 17:45:40.783 10133  8079  8079 W warn_alloc_show_mem: 1 callbacks suppressed
12-26 17:45:40.783 10133  8079  8079 W Mem-Info:
12-26 17:45:40.783 10133  8079  8079 W active_anon: 47148 inactive_anon:47161 isolated_anon:0
12-26 17:45:40.783 10133  8079  8079 W active_file: 285389 inactive_file:90997 isolated_file:0
12-26 17:45:40.783 10133  8079  8079 W unevictable: 43387 dirty:27 writeback:220 unstable:0
12-26 17:45:40.783 10133  8079  8079 W slab_reclaimable: 14386 slab_unreclaimable:42885
12-26 17:45:40.783 10133  8079  8079 W mapped  : 89490 shmem:469 pagetables:14675 bounce:0
12-26 17:45:40.783 10133  8079  8079 W free    : 24795 free_pcp:1566 free_cma:22288 zspages: 63866
12-26 17:45:40.783 10133  8079  8079 W ion_heap: 120822 ion_heap_pool:255
12-26 17:45:40.783 10133  8079  8079 W         : Node 0 active_anon:188592kB inactive_anon:188644kB active_file:1141556kB inactive_file:363988kB unevictable:173548kB isolated(anon):0kB isolated(file):0kB mapped:357960kB dirty:108kB writeback:880kB shmem:1876kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no
12-26 17:45:40.783 10133  8079  8079 W DMA free: 92380kB min:3400kB low:16376kB high:17224kB active_anon:79144kB inactive_anon:74504kB active_file:513412kB inactive_file:170572kB unevictable:84192kB writepending:752kB present:1804896kB managed:1691308kB mlocked:84192kB slab_reclaimable:21488kB slab_unreclaimable:67072kB kernel_stack:23696kB pagetables:20552kB bounce:0kB free_pcp:3544kB local_pcp:100kB free_cma:89152kB
12-26 17:45:40.783 10133  8079  8079 W Normal free: 6800kB min:4000kB low:19272kB high:20272kB active_anon:109872kB inactive_anon:113656kB active_file:627396kB inactive_file:194108kB unevictable:89356kB writepending:236kB present:2067200kB managed:1990540kB mlocked:89356kB slab_reclaimable:36056kB slab_unreclaimable:104468kB kernel_stack:22400kB pagetables:38148kB bounce:0kB free_pcp:2720kB local_pcp:80kB free_cma:0kB
12-26 17:45:40.783 10133  8079  8079 W DMA     : 66*4kB (H) 2665*8kB (CH) 1492*16kB (CH) 529*32kB (CH) 307*64kB (CH) 72*128kB (CH) 4*256kB (C) 0*512kB 0*1024kB 0*2048kB 0*4096kB = 92272kB
12-26 17:45:40.783 10133  8079  8079 W         : 653 pages in swap cache
12-26 17:45:40.783 10133  8079  8079 W         : Swap cache stats: add 1169372, delete 1168719, find 72740/436693
12-26 17:45:40.783 10133  8079  8079 W         : Free swap  = 172kB

Bug: 134689899
Bug: 123392992
Change-Id: I9d792f58d958bc86da340e7d49c23b08f8997b34
Signed-off-by: Minchan Kim <minchan@google.com>
(cherry picked from commit 127b34ddc60fa317d1da062ce579033b52b61bf4)
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:41 +05:30
Jaewon Kim
922f62df8c page_alloc: fix invalid watermark check on a negative value
There was a report that a task is waiting at the
throttle_direct_reclaim. The pgscan_direct_throttle in vmstat was
increasing.

This is a bug where zone_watermark_fast returns true even when the free
is very low. The commit f27ce0e14088 ("page_alloc: consider highatomic
reserve in watermark fast") changed the watermark fast to consider
highatomic reserve. But it did not handle a negative value case which
can be happened when reserved_highatomic pageblock is bigger than the
actual free.

If watermark is considered as ok for the negative value, allocating
contexts for order-0 will consume all free pages without direct reclaim,
and finally free page may become depleted except highatomic free.

Then allocating contexts may fall into throttle_direct_reclaim. This
symptom may easily happen in a system where wmark min is low and other
reclaimers like kswapd does not make free pages quickly.

Handle the negative case by using MIN.

Link: https://lkml.kernel.org/r/20220725095212.25388-1-jaewon31.kim@samsung.com
Fixes: f27ce0e14088 ("page_alloc: consider highatomic reserve in watermark fast")
Signed-off-by: Jaewon Kim <jaewon31.kim@samsung.com>
Reported-by: GyeongHwan Hong <gh21.hong@samsung.com>
Acked-by: Mel Gorman <mgorman@techsingularity.net>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Baoquan He <bhe@redhat.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Yong-Taek Lee <ytk.lee@samsung.com>
Cc: <stable@vger.kerenl.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Change-Id: If9dd5b1f9a06e75b641a753aa3dc72e5b4d4e049
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:41 +05:30
Tim Murray
df0213cd42 mm: skip swap readahead when process is exiting
It's possible for a user fault to be triggered during task exit that
results in swap readahead, which is not useful. Skip swap readahead
if the current process is exiting.

Change-Id: I5fad20ebdcc616af732254705726d395eb118cbe
Signed-off-by: Tim Murray <timmurray@google.com>

I know swap is not used with my kernel.
Just picking for future references.

Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:35 +05:30
Sultan Alsawaf
3090996b1f treewide: Suppress overly verbose log spam
This tames quite a bit of the log spam and makes dmesg readable.

Uses work from Danny Lin <danny@kdrag0n.dev>.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:35 +05:30
freak07
8b20e80a6e mm: vmstat: Use more power efficient workingqueues
Change-Id: Id8b5d1ef9b1851ab4dbc5f28a06ee5a04ac154d4
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:33 +05:30
Matthew Wilcox
41f984a2d4 UPSTREAM: mm: combine LRU and main union in struct page
This gives us five words of space in a single union in struct page.  The
compound_mapcount moves position (from offset 24 to offset 20) on 64-bit
systems, but that does not seem likely to cause any trouble.

Link: http://lkml.kernel.org/r/20180518194519.3820-11-willy@infradead.org
Change-Id: I5e59a5294d539b231656c5bd9847dde855150f76
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Jérôme Glisse <jglisse@redhat.com>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2025-10-02 18:28:36 -07:00
Matthew Wilcox
49c6cc8a41 UPSTREAM: mm: move lru union within struct page
Since the LRU is two words, this does not affect the double-word alignment
of SLUB's freelist.

Link: http://lkml.kernel.org/r/20180518194519.3820-10-willy@infradead.org
Change-Id: Ibcb2c34650e8cf4262eb797cbdea0890ff9fc185
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Jérôme Glisse <jglisse@redhat.com>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2025-10-02 18:28:36 -07:00
Matthew Wilcox
bada463bb8 UPSTREAM: mm: move 'private' union within struct page
By moving page->private to the fourth word of struct page, we can put the
SLUB counters in the same word as SLAB's s_mem and still do the
cmpxchg_double trick.  Now the SLUB counters no longer overlap with the
mapcount or refcount so we can drop the call to page_mapcount_reset() and
simplify set_page_slub_counters() to a single line.

Link: http://lkml.kernel.org/r/20180518194519.3820-6-willy@infradead.org
Change-Id: I4e5cf42b0af8de3f19eda9d16bff9bd1323682f7
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Jérôme Glisse <jglisse@redhat.com>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2025-10-02 18:28:36 -07:00
Matthew Wilcox
1e1a980f35 UPSTREAM: mm: switch s_mem and slab_cache in struct page
This will allow us to store slub's counters in the same bits as slab's
s_mem.  slub now needs to set page->mapping to NULL as it frees the page,
just like slab does.

Link: http://lkml.kernel.org/r/20180518194519.3820-5-willy@infradead.org
Change-Id: I841baf3a3b9a0e90c9baf7b0f99d4efa9c9f801a
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Acked-by: Christoph Lameter <cl@linux.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Jérôme Glisse <jglisse@redhat.com>
Cc: "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2025-10-02 18:28:35 -07:00
Matthew Wilcox
20b9fd03f1 UPSTREAM: mm: split page_type out from _mapcount
We're already using a union of many fields here, so stop abusing the
_mapcount and make page_type its own field.  That implies renaming some of
the machinery that creates PageBuddy, PageBalloon and PageKmemcg; bring
back the PG_buddy, PG_balloon and PG_kmemcg names.

As suggested by Kirill, make page_type a bitmask.  Because it starts out
life as -1 (thanks to sharing the storage with _mapcount), setting a page
flag means clearing the appropriate bit.  This gives us space for probably
twenty or so extra bits (depending how paranoid we want to be about
_mapcount underflow).

Link: http://lkml.kernel.org/r/20180518194519.3820-3-willy@infradead.org
Change-Id: I8804ac88e4c2c772df02ae1a3b07e0e87cc5e05e
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Christoph Lameter <cl@linux.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Jérôme Glisse <jglisse@redhat.com>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2025-10-02 18:28:35 -07:00
Souptick Joarder
0b8072e3d0 UPSTREAM: mm: change return type to vm_fault_t
Use new return type vm_fault_t for fault handler in struct
vm_operations_struct.  For now, this is just documenting that the
function returns a VM_FAULT value rather than an errno.  Once all
instances are converted, vm_fault_t will become a distinct type.

See commit 1c8f422059ae ("mm: change return type to vm_fault_t")

Link: http://lkml.kernel.org/r/20180512063745.GA26866@jordon-HP-15-Notebook-PC
Change-Id: Ib16ec7d9a34c73d98fe673b8ce6e9241ad3255b8
Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Joe Perches <joe@perches.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2025-10-02 18:28:35 -07:00
Kirill A. Shutemov
00c898ef13 BACKPORT: mm: consolidate page table accounting
Currently, we account page tables separately for each page table level,
but that's redundant -- we only make use of total memory allocated to
page tables for oom_badness calculation.  We also provide the
information to userspace, but it has dubious value there too.

This patch switches page table accounting to single counter.

mm->pgtables_bytes is now used to account all page table levels.  We use
bytes, because page table size for different levels of page table tree
may be different.

The change has user-visible effect: we don't have VmPMD and VmPUD
reported in /proc/[pid]/status.  Not sure if anybody uses them.  (As
alternative, we can always report 0 kB for them.)

OOM-killer report is also slightly changed: we now report pgtables_bytes
instead of nr_ptes, nr_pmd, nr_puds.

Apart from reducing number of counters per-mm, the benefit is that we
now calculate oom_badness() more correctly for machines which have
different size of page tables depending on level or where page tables
are less than a page in size.

The only downside can be debuggability because we do not know which page
table level could leak.  But I do not remember many bugs that would be
caught by separate counters so I wouldn't lose sleep over this.

[akpm@linux-foundation.org: fix mm/huge_memory.c]
Link: http://lkml.kernel.org/r/20171006100651.44742-2-kirill.shutemov@linux.intel.com
Change-Id: Iaede03b89e74d4b23f90cfb72e2fe9b4cc8c3b79
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Michal Hocko <mhocko@suse.com>
[kirill.shutemov@linux.intel.com: fix build]
  Link: http://lkml.kernel.org/r/20171016150113.ikfxy3e7zzfvsr4w@black.fi.intel.com
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2025-10-02 18:28:33 -07:00
Kirill A. Shutemov
864d162aad BACKPORT: mm: introduce wrappers to access mm->nr_ptes
Let's add wrappers for ->nr_ptes with the same interface as for nr_pmd
and nr_pud.

The patch also makes nr_ptes accounting dependent onto CONFIG_MMU.  Page
table accounting doesn't make sense if you don't have page tables.

It's preparation for consolidation of page-table counters in mm_struct.

Link: http://lkml.kernel.org/r/20171006100651.44742-1-kirill.shutemov@linux.intel.com
Change-Id: I50ec0423b481e72aca4ea2c7c244b585b064ea53
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2025-10-02 18:28:33 -07:00
Kirill A. Shutemov
48374e5053 BACKPORT: mm: account pud page tables
On a machine with 5-level paging support a process can allocate
significant amount of memory and stay unnoticed by oom-killer and memory
cgroup.  The trick is to allocate a lot of PUD page tables.  We don't
account PUD page tables, only PMD and PTE.

We already addressed the same issue for PMD page tables, see commit
dc6c9a35b6 ("mm: account pmd page tables to the process").
Introduction of 5-level paging brings the same issue for PUD page
tables.

The patch expands accounting to PUD level.

[kirill.shutemov@linux.intel.com: s/pmd_t/pud_t/]
  Link: http://lkml.kernel.org/r/20171004074305.x35eh5u7ybbt5kar@black.fi.intel.com
[heiko.carstens@de.ibm.com: s390/mm: fix pud table accounting]
  Link: http://lkml.kernel.org/r/20171103090551.18231-1-heiko.carstens@de.ibm.com
Link: http://lkml.kernel.org/r/20171002080427.3320-1-kirill.shutemov@linux.intel.com
Change-Id: Ib817f1cae9968dcfbd9800824ff54d2b6ce5eae1
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Acked-by: Rik van Riel <riel@redhat.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2025-10-02 18:28:33 -07:00
Shakeel Butt
0fb2165376 UPSTREAM: cgroup: memcg: net: do not associate sock with unrelated cgroup
[ Upstream commit e876ecc67db80dfdb8e237f71e5b43bb88ae549c ]

We are testing network memory accounting in our setup and noticed
inconsistent network memory usage and often unrelated cgroups network
usage correlates with testing workload. On further inspection, it
seems like mem_cgroup_sk_alloc() and cgroup_sk_alloc() are broken in
irq context specially for cgroup v1.

mem_cgroup_sk_alloc() and cgroup_sk_alloc() can be called in irq context
and kind of assumes that this can only happen from sk_clone_lock()
and the source sock object has already associated cgroup. However in
cgroup v1, where network memory accounting is opt-in, the source sock
can be unassociated with any cgroup and the new cloned sock can get
associated with unrelated interrupted cgroup.

Cgroup v2 can also suffer if the source sock object was created by
process in the root cgroup or if sk_alloc() is called in irq context.
The fix is to just do nothing in interrupt.

WARNING: Please note that about half of the TCP sockets are allocated
from the IRQ context, so, memory used by such sockets will not be
accouted by the memcg.

The stack trace of mem_cgroup_sk_alloc() from IRQ-context:

CPU: 70 PID: 12720 Comm: ssh Tainted:  5.6.0-smp-DEV #1
Hardware name: ...
Call Trace:
 <IRQ>
 dump_stack+0x57/0x75
 mem_cgroup_sk_alloc+0xe9/0xf0
 sk_clone_lock+0x2a7/0x420
 inet_csk_clone_lock+0x1b/0x110
 tcp_create_openreq_child+0x23/0x3b0
 tcp_v6_syn_recv_sock+0x88/0x730
 tcp_check_req+0x429/0x560
 tcp_v6_rcv+0x72d/0xa40
 ip6_protocol_deliver_rcu+0xc9/0x400
 ip6_input+0x44/0xd0
 ? ip6_protocol_deliver_rcu+0x400/0x400
 ip6_rcv_finish+0x71/0x80
 ipv6_rcv+0x5b/0xe0
 ? ip6_sublist_rcv+0x2e0/0x2e0
 process_backlog+0x108/0x1e0
 net_rx_action+0x26b/0x460
 __do_softirq+0x104/0x2a6
 do_softirq_own_stack+0x2a/0x40
 </IRQ>
 do_softirq.part.19+0x40/0x50
 __local_bh_enable_ip+0x51/0x60
 ip6_finish_output2+0x23d/0x520
 ? ip6table_mangle_hook+0x55/0x160
 __ip6_finish_output+0xa1/0x100
 ip6_finish_output+0x30/0xd0
 ip6_output+0x73/0x120
 ? __ip6_finish_output+0x100/0x100
 ip6_xmit+0x2e3/0x600
 ? ipv6_anycast_cleanup+0x50/0x50
 ? inet6_csk_route_socket+0x136/0x1e0
 ? skb_free_head+0x1e/0x30
 inet6_csk_xmit+0x95/0xf0
 __tcp_transmit_skb+0x5b4/0xb20
 __tcp_send_ack.part.60+0xa3/0x110
 tcp_send_ack+0x1d/0x20
 tcp_rcv_state_process+0xe64/0xe80
 ? tcp_v6_connect+0x5d1/0x5f0
 tcp_v6_do_rcv+0x1b1/0x3f0
 ? tcp_v6_do_rcv+0x1b1/0x3f0
 __release_sock+0x7f/0xd0
 release_sock+0x30/0xa0
 __inet_stream_connect+0x1c3/0x3b0
 ? prepare_to_wait+0xb0/0xb0
 inet_stream_connect+0x3b/0x60
 __sys_connect+0x101/0x120
 ? __sys_getsockopt+0x11b/0x140
 __x64_sys_connect+0x1a/0x20
 do_syscall_64+0x51/0x200
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

The stack trace of mem_cgroup_sk_alloc() from IRQ-context:
Fixes: 2d75807383 ("mm: memcontrol: consolidate cgroup socket tracking")
Fixes: d979a39d72 ("cgroup: duplicate cgroup reference when cloning sockets")
Change-Id: I8872313e1e69d0809cbffdf96549f0dc3edfacda
Signed-off-by: Shakeel Butt <shakeelb@google.com>
Reviewed-by: Roman Gushchin <guro@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-02 18:28:19 -07:00
Rick Edgecombe
f3acfb8c97 UPSTREAM: mm/vmalloc: Add flag for freeing of special permsissions
Add a new flag VM_FLUSH_RESET_PERMS, for enabling vfree operations to
immediately clear executable TLB entries before freeing pages, and handle
resetting permissions on the directmap. This flag is useful for any kind
of memory with elevated permissions, or where there can be related
permissions changes on the directmap. Today this is RO+X and RO memory.

Although this enables directly vfreeing non-writeable memory now,
non-writable memory cannot be freed in an interrupt because the allocation
itself is used as a node on deferred free list. So when RO memory needs to
be freed in an interrupt the code doing the vfree needs to have its own
work queue, as was the case before the deferred vfree list was added to
vmalloc.

For architectures with set_direct_map_ implementations this whole operation
can be done with one TLB flush when centralized like this. For others with
directmap permissions, currently only arm64, a backup method using
set_memory functions is used to reset the directmap. When arm64 adds
set_direct_map_ functions, this backup can be removed.

When the TLB is flushed to both remove TLB entries for the vmalloc range
mapping and the direct map permissions, the lazy purge operation could be
done to try to save a TLB flush later. However today vm_unmap_aliases
could flush a TLB range that does not include the directmap. So a helper
is added with extra parameters that can allow both the vmalloc address and
the direct mapping to be flushed during this operation. The behavior of the
normal vm_unmap_aliases function is unchanged.

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Suggested-by: Andy Lutomirski <luto@kernel.org>
Suggested-by: Will Deacon <will.deacon@arm.com>
Change-Id: I914f605f3601bde21f194069dd31e658c9a22fcd
Signed-off-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: <akpm@linux-foundation.org>
Cc: <ard.biesheuvel@linaro.org>
Cc: <deneen.t.dock@intel.com>
Cc: <kernel-hardening@lists.openwall.com>
Cc: <kristen@linux.intel.com>
Cc: <linux_dti@icloud.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Nadav Amit <nadav.amit@gmail.com>
Cc: Rik van Riel <riel@surriel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20190426001143.4983-17-namit@vmware.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2025-10-02 18:28:16 -07:00
Nadav Amit
c8bfa9f62f RELAND: hugetlbfs: flush TLBs correctly after huge_pmd_unshare
commit a4a118f2eead1d6c49e00765de89878288d4b890 upstream.

When __unmap_hugepage_range() calls to huge_pmd_unshare() succeed, a TLB
flush is missing.  This TLB flush must be performed before releasing the
i_mmap_rwsem, in order to prevent an unshared PMDs page from being
released and reused before the TLB flush took place.

Arguably, a comprehensive solution would use mmu_gather interface to
batch the TLB flushes and the PMDs page release, however it is not an
easy solution: (1) try_to_unmap_one() and try_to_migrate_one() also call
huge_pmd_unshare() and they cannot use the mmu_gather interface; and (2)
deferring the release of the page reference for the PMDs page until
after i_mmap_rwsem is dropeed can confuse huge_pmd_unshare() into
thinking PMDs are shared when they are not.

Fix __unmap_hugepage_range() by adding the missing TLB flush, and
forcing a flush when unshare is successful.

Fixes: 24669e5847 ("hugetlb: use mmu_gather instead of a temporary linked list for accumulating pages)" # 3.6

[Jebaitedneko: move tlb_flush_pmd_range() into mmu_gather.c]

Change-Id: Ic0b2a2b47792a24ee2ea4112c34152b0d263009a
Signed-off-by: Nadav Amit <namit@vmware.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Co-authored-by: Jebaitedneko <Jebaitedneko@gmail.com>
2025-07-22 00:48:13 -04:00
Peter Zijlstra
0293879b59 BACKPORT: mm/memory: Move mmu_gather and TLB invalidation code into its own file
In preparation for maintaining the mmu_gather code as its own entity,
move the implementation out of memory.c and into its own file.

Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@suse.com>
Change-Id: Ia925c303703e188a89bd3e66e6cc7302cb651826
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
[cyberknight777: Backport to msm-4.14 & move tlb_remove_table_sync_one() to mmu_gather.c]
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
2025-07-22 00:48:12 -04:00
Cyber Knight
afcc18b5be Revert "hugetlbfs: flush TLBs correctly after huge_pmd_unshare"
This reverts commit 7bf1f5cb51 to reapply it with changes in accordance with an upcoming commit that moves the TLB flushing logic into mmu_gather.c.

Change-Id: I706c51a56b083669f70822d6ad148f2d6f91d8bf
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
2025-07-22 00:48:12 -04:00
Will Deacon
333630cb1c UPSTREAM: asm-generic/tlb: Track which levels of the page tables have been cleared
It is common for architectures with hugepage support to require only a
single TLB invalidation operation per hugepage during unmap(), rather than
iterating through the mapping at a PAGE_SIZE increment. Currently,
however, the level in the page table where the unmap() operation occurs
is not stored in the mmu_gather structure, therefore forcing
architectures to issue additional TLB invalidation operations or to give
up and over-invalidate by e.g. invalidating the entire TLB.

Ideally, we could add an interval rbtree to the mmu_gather structure,
which would allow us to associate the correct mapping granule with the
various sub-mappings within the range being invalidated. However, this
is costly in terms of book-keeping and memory management, so instead we
approximate by keeping track of the page table levels that are cleared
and provide a means to query the smallest granule required for invalidation.

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Nicholas Piggin <npiggin@gmail.com>
Change-Id: Ifb486381b6e71f4e05c9d38a246bf82de2d224ac
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
2025-07-22 00:48:12 -04:00
Nicholas Piggin
f403f1bba8 UPSTREAM: mm: mmu_notifier fix for tlb_end_vma
The generic tlb_end_vma does not call invalidate_range mmu notifier, and
it resets resets the mmu_gather range, which means the notifier won't be
called on part of the range in case of an unmap that spans multiple
vmas.

ARM64 seems to be the only arch I could see that has notifiers and uses
the generic tlb_end_vma.  I have not actually tested it.

[ Catalin and Will point out that ARM64 currently only uses the
  notifiers for KVM, which doesn't use the ->invalidate_range()
  callback right now, so it's a bug, but one that happens to
  not affect them.  So not necessary for stable.  - Linus ]

Change-Id: Id7b31c8a84be494b2f6341beb3be23485b5dd6bb
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
2025-07-22 00:48:11 -04:00
Minchan Kim
6f94c2ac8a Revert "mm: introduce CONFIG_SPECULATIVE_PAGE_FAULT"
This reverts commit c679e340a7.

Conflicts:
	mm/Kconfig

Bug: 128240262
Change-Id: I2d5961521043932a767f828432f28e3418d7a77f
Signed-off-by: Minchan Kim <minchan@google.com>
2025-07-22 00:48:11 -04:00
Minchan Kim
11f6a10306 Revert "mm: prepare for FAULT_FLAG_SPECULATIVE"
This reverts commit 544f86ff0a.

Bug: 128240262
Change-Id: I362db97f606279ce66add0b6c3726438e80a597f
Signed-off-by: Minchan Kim <minchan@google.com>
2025-07-22 00:48:11 -04:00
Minchan Kim
f1d948d589 Revert "mm: introduce pte_spinlock for FAULT_FLAG_SPECULATIVE"
This reverts commit b17c74805d.

Bug: 128240262
Change-Id: Ie3d9a7f340ae93ef13475c41cbcb2b52f2ac720c
Signed-off-by: Minchan Kim <minchan@google.com>
2025-07-22 00:48:11 -04:00
Minchan Kim
0fcdeafe27 Revert "mm: make pte_unmap_same compatible with SPF"
This reverts commit 52bf7a902f.

Bug: 128240262
Change-Id: Ifdf06b5394bcfb111468fd7f220434a343fb48e8
Signed-off-by: Minchan Kim <minchan@google.com>
2025-07-22 00:48:11 -04:00
Minchan Kim
578b0e5de2 Revert "mm: introduce INIT_VMA()"
This reverts commit f98b74c615.

Bug: 128240262
Change-Id: Ia6ca7bfc525b9e238d49df4812e1b66307674198
Signed-off-by: Minchan Kim <minchan@google.com>
2025-07-22 00:48:11 -04:00
Minchan Kim
f005ca2488 Revert "mm: VMA sequence count"
This reverts commit 184ccc18de.

Bug: 128240262
Change-Id: I7293939d08e6b9603d82464f4538a573b3407a88
Signed-off-by: Minchan Kim <minchan@google.com>
2025-07-22 00:48:10 -04:00
Minchan Kim
1fe3771a2c Revert "mm: protect VMA modifications using VMA sequence count"
This reverts commit 4153099359.

Bug: 128240262
Change-Id: If31a4c81badd891e6ca5740dbd022b5edbe47254
Signed-off-by: Minchan Kim <minchan@google.com>
2025-07-22 00:48:10 -04:00
Minchan Kim
10e72457dd Revert "mm: protect mremap() against SPF hanlder"
This reverts commit f831a42848.

Bug: 128240262
Change-Id: Ida9fb7e41a7905755470e20f5c72867bb3dad03f
Signed-off-by: Minchan Kim <minchan@google.com>
2025-07-22 00:48:10 -04:00
Minchan Kim
d4e1acfdb1 Revert "mm: protect SPF handler against anon_vma changes"
This reverts commit 39bb6bae67.

Bug: 128240262
Change-Id: I317785d46d335aab974e194e5ea0d744513baecd
Signed-off-by: Minchan Kim <minchan@google.com>
2025-07-22 00:48:10 -04:00
Minchan Kim
cc0fe73284 Revert "mm: cache some VMA fields in the vm_fault structure"
This reverts commit 896469ccd8.

Conflicts:
	mm/memory.c

Bug: 128240262
Change-Id: Iea60ab5360ae83ca0efcbb47a101b3870691a93f
Signed-off-by: Minchan Kim <minchan@google.com>
2025-07-22 00:48:10 -04:00
Minchan Kim
8a72383e46 Revert "mm/migrate: Pass vm_fault pointer to migrate_misplaced_page()"
This reverts commit 53fc4df45c.

Bug: 128240262
Change-Id: I21a63bb3e600beb422a8fc5240a4c3bed611fadc
Signed-off-by: Minchan Kim <minchan@google.com>
2025-07-22 00:48:10 -04:00
Minchan Kim
6f60f11d1f Revert "mm: introduce __lru_cache_add_active_or_unevictable"
This reverts commit 34e57df243.

Bug: 128240262
Change-Id: I54aa09970c5967cfa7a93deca52f28773e27c041
Signed-off-by: Minchan Kim <minchan@google.com>
2025-07-22 00:48:09 -04:00
Minchan Kim
6e8b4c7384 Revert "mm: introduce __page_add_new_anon_rmap()"
This reverts commit 3db290da0d.

Bug: 128240262
Change-Id: Ia5a417e52de006fba4f8b1b51d9ae4db36fd9035
Signed-off-by: Minchan Kim <minchan@google.com>
2025-07-22 00:48:09 -04:00
Minchan Kim
6da98bf051 Revert "mm: introduce __vm_normal_page()"
This reverts commit feb3e8b60b.

Bug: 128240262
Change-Id: Iadc1c38e82431020b79194aff4bb25e7d9d66125
Signed-off-by: Minchan Kim <minchan@google.com>
2025-07-22 00:48:09 -04:00
Minchan Kim
366199bdae Revert "mm: protect mm_rb tree with a rwlock"
This reverts commit eba2eb1ba0.

Conflicts:
	include/linux/mm_types.h

Bug: 128240262
Change-Id: I210789054d394b929de6d9444040f1d2aac14917
Signed-off-by: Minchan Kim <minchan@google.com>
2025-07-22 00:48:09 -04:00
Minchan Kim
abf8e52d68 Revert "mm: provide speculative fault infrastructure"
This reverts commit ce37f07c6b.

Conflicts:
	include/linux/mm.h

Bug: 128240262
Change-Id: I1060d8e43cebca1826a489fa3271279501c8647c
Signed-off-by: Minchan Kim <minchan@google.com>
2025-07-22 00:48:09 -04:00
Minchan Kim
1267810252 Revert "mm: adding speculative page fault failure trace events"
This reverts commit 9a54b72086.

Bug: 128240262
Change-Id: I96fe4f7e02f5d6716e20b1f8bc03b686dd189f09
Signed-off-by: Minchan Kim <minchan@google.com>
2025-07-22 00:48:09 -04:00
Minchan Kim
0498ac7065 Revert "mm: speculative page fault handler return VMA"
This reverts commit 697615066a.

Bug: 128240262
Change-Id: Icc3edff62de261aee10658b1567b85ff7b5d58dd
Signed-off-by: Minchan Kim <minchan@google.com>
2025-07-22 00:48:08 -04:00
Minchan Kim
1373183ecb Revert "mm: add speculative page fault vmstats"
This reverts commit 726581778c.

Bug: 128240262
Change-Id: I3ba5c0ab739af15061dd376fcb15366e9644ed4f
Signed-off-by: Minchan Kim <minchan@google.com>
2025-07-22 00:48:08 -04:00
Minchan Kim
2418e4d009 Revert "mm: don't do swap readahead during speculative page fault"
This reverts commit 20c1549583.

Bug: 128240262
Change-Id: Ide6a3bb060fd1792c1ac5880cfc2298931ad07ed
Signed-off-by: Minchan Kim <minchan@google.com>
2025-07-22 00:48:08 -04:00
Minchan Kim
046ba3c9e6 Revert "mm: flush TLB once pages are copied when SPF is on"
This reverts commit 3511974da2.
Bug: 128240262
Signed-off-by: Minchan Kim <minchan@google.com>

Change-Id: Icac913fd3851b436a75a605a5c3896ec8b4607ae
2025-07-22 00:48:08 -04:00
Alexander Winkowski
30342b9ba8 Revert "ANDROID: mm: skip pte_alloc during speculative page fault"
This reverts commit 863387c4ee.

Change-Id: I0891749da9dc05c7f9a3ad909a9d054e74a45e2b
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2025-07-22 00:48:07 -04:00
Alexander Winkowski
6d7f47b825 Revert "ANDROID: mm: prevent speculative page fault handling for in do_swap_page()"
This reverts commit e1048e3f99.

Change-Id: I3deaf837842423b91b1cca32ec974d9612c882b7
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2025-07-22 00:48:07 -04:00
Alexander Winkowski
cd3ed07ff9 Revert "ANDROID: mm: prevent reads of unstable pmd during speculation"
This reverts commit 757e0e1082.

Change-Id: I3a896b78e77f9db5a52bcf261a35c3ec4afefb9c
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2025-07-22 00:48:07 -04:00