]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
4 years agomm/mmap: Change do_mas_align_munmap() to static
Liam R. Howlett [Mon, 22 Feb 2021 00:55:52 +0000 (19:55 -0500)]
mm/mmap: Change do_mas_align_munmap() to static

Add static to the declaration as reported by sparse

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agolib/maple_tree: Fix rcu annotations
Matthew Wilcox (Oracle) [Sun, 21 Feb 2021 04:46:45 +0000 (23:46 -0500)]
lib/maple_tree: Fix rcu annotations

Add all the missing __rcu annotations reported by sparse.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agomm/mmap: Lock maple tree when using mas_store_gfp()
Liam R. Howlett [Sat, 20 Feb 2021 17:56:07 +0000 (12:56 -0500)]
mm/mmap: Lock maple tree when using mas_store_gfp()

When storing to the maple tree, take the write lock to avoid
entering/exiting the use of RCU during a write operation.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agolib/maple_tree: Fix mas_pop_node() zeroing.
Liam R. Howlett [Sat, 20 Feb 2021 17:52:56 +0000 (12:52 -0500)]
lib/maple_tree: Fix mas_pop_node() zeroing.

When using a single allocation in the node, zero out slot 0 of the node
being returned.

Also, small whitespace fix in mas_push

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/ksm: Fix compile warning and whitespace for 3fd77bfa4f25fa
Liam R. Howlett [Thu, 18 Feb 2021 14:51:08 +0000 (09:51 -0500)]
mm/ksm: Fix compile warning and whitespace for 3fd77bfa4f25fa

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agolib/maple_tree: Fix mas_store_gfp() on spanning store.
Liam R. Howlett [Thu, 18 Feb 2021 14:27:48 +0000 (09:27 -0500)]
lib/maple_tree: Fix mas_store_gfp() on spanning store.

Spanning store detection needs to be more robust than checking if it spans the end of
a node.  Fix the detection by using mas_is_span_wr().  Also ensure it's not MAS_NONE.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agolib/maple_tree: Add check for dead nodes in mt_validate()
Liam R. Howlett [Thu, 18 Feb 2021 14:26:45 +0000 (09:26 -0500)]
lib/maple_tree: Add check for dead nodes in mt_validate()

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: __insert_vm_struct() only needs to mas_reset()
Liam R. Howlett [Thu, 18 Feb 2021 14:26:07 +0000 (09:26 -0500)]
mm/mmap: __insert_vm_struct() only needs to mas_reset()

vma_mas_store() will set the range again.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mprotect: Use vma_next() of prev.
Liam R. Howlett [Thu, 18 Feb 2021 14:24:49 +0000 (09:24 -0500)]
mm/mprotect: Use vma_next() of prev.

The linked list used to use prev->next.  the maple state may be invalidated
by the mprotect_fixup call which may alter the tree.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mprotect: Use vma_next() instead of mas_next().
Liam R. Howlett [Wed, 17 Feb 2021 22:15:37 +0000 (17:15 -0500)]
mm/mprotect: Use vma_next() instead of mas_next().

mas is in the wrong state and would potentially return the current vma twice.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Fix mmap_region() maple tree store.
Liam R. Howlett [Wed, 17 Feb 2021 22:03:35 +0000 (17:03 -0500)]
mm/mmap: Fix mmap_region() maple tree store.

mas_set_range() before vma_mas_link() as the address may have changed
as commented above in the code.

Do the same in the error path.

This forces a reset of the mas->node to MA_START.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: ULONG_MAX in exit_mmap
Liam R. Howlett [Wed, 17 Feb 2021 14:19:55 +0000 (09:19 -0500)]
mm/mmap: ULONG_MAX in exit_mmap

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: ULONG_MAX in do_brk_munmap
Liam R. Howlett [Wed, 17 Feb 2021 14:19:38 +0000 (09:19 -0500)]
mm/mmap: ULONG_MAX in do_brk_munmap

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: ULONG_MAX in detach_range
Liam R. Howlett [Wed, 17 Feb 2021 14:19:25 +0000 (09:19 -0500)]
mm/mmap: ULONG_MAX in detach_range

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: ULONG_MAX in remove_mt
Liam R. Howlett [Wed, 17 Feb 2021 14:19:08 +0000 (09:19 -0500)]
mm/mmap: ULONG_MAX in remove_mt

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mprotect: Change do_mprotect_pkey() -1 to ULONG_MAX
Liam R. Howlett [Wed, 17 Feb 2021 14:17:40 +0000 (09:17 -0500)]
mm/mprotect: Change do_mprotect_pkey()  -1 to ULONG_MAX

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomempolicy: Fix mbind_range -1 to ULONG_MAX
Liam R. Howlett [Wed, 17 Feb 2021 14:16:52 +0000 (09:16 -0500)]
mempolicy: Fix mbind_range -1 to ULONG_MAX

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agokernel/sched/fair: Change -1 to ULONG_MAX
Liam R. Howlett [Wed, 17 Feb 2021 14:16:24 +0000 (09:16 -0500)]
kernel/sched/fair: Change -1 to ULONG_MAX

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agokernel/acct: Change -1 to ULONG_MAX
Liam R. Howlett [Wed, 17 Feb 2021 14:16:07 +0000 (09:16 -0500)]
kernel/acct: Change -1 to ULONG_MAX

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agotask_mmu: Change -1 to ULONG_MAX
Liam R. Howlett [Wed, 17 Feb 2021 14:15:53 +0000 (09:15 -0500)]
task_mmu: Change -1 to ULONG_MAX

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agoppc book3s32: Change -1 to ULONG_MAX
Liam R. Howlett [Wed, 17 Feb 2021 14:15:37 +0000 (09:15 -0500)]
ppc book3s32: Change -1 to ULONG_MAX

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agolib/maple_tree: Reset request_count to 0 of old head on push
Liam R. Howlett [Tue, 16 Feb 2021 18:33:24 +0000 (13:33 -0500)]
lib/maple_tree: Reset request_count to 0 of old head on push

Just to be safe

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Add validate_mm() to __vma_adjust() start
Liam R. Howlett [Tue, 16 Feb 2021 15:49:09 +0000 (10:49 -0500)]
mm/mmap: Add validate_mm() to __vma_adjust() start

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mprotect: Fix adcfbd7698558a linked list removal
Liam R. Howlett [Wed, 10 Feb 2021 14:33:59 +0000 (09:33 -0500)]
mm/mprotect: Fix adcfbd7698558a linked list removal

Use mas_find() in do_mprotect_pkey to find the next vma to better align
with what happened with the old API

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agokernel/sched/fair: Fix linked list fallout 4acb2b9560cd8f
Liam R. Howlett [Wed, 10 Feb 2021 14:30:51 +0000 (09:30 -0500)]
kernel/sched/fair: Fix linked list fallout 4acb2b9560cd8f

When searching for the vma, use mas_find, not mas_walk() to better do what was happening before

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mempolicy: fix adcfbd7698558a
Liam R. Howlett [Tue, 9 Feb 2021 19:37:24 +0000 (14:37 -0500)]
mm/mempolicy: fix adcfbd7698558a

When removing the linked list, a bug was introduced in maple state
iterator used for the mbind_range() function.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: do_brk_munmap() whitespace fix
Liam R. Howlett [Tue, 9 Feb 2021 14:45:09 +0000 (09:45 -0500)]
mm/mmap: do_brk_munmap() whitespace fix

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: use ma_is_root() in mas_replace().
Liam R. Howlett [Tue, 9 Feb 2021 00:34:00 +0000 (19:34 -0500)]
maple_tree: use ma_is_root() in mas_replace().

Instead of using mte_is_root(), use ma_is_root() directly since the maple node
is known already.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Find next vma in do_brk_munmap() prior to updating tree.
Liam R. Howlett [Tue, 9 Feb 2021 00:33:02 +0000 (19:33 -0500)]
mm/mmap: Find next vma in do_brk_munmap() prior to updating tree.

The tree update may invalidate the location and cause a longer search if the VMA does not
preceed a NULL entry

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Fix do_brk_munmap() when munmapping an entire VMA or more
Liam R. Howlett [Tue, 9 Feb 2021 00:31:53 +0000 (19:31 -0500)]
mm/mmap: Fix do_brk_munmap() when munmapping an entire VMA or more

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Add more validate_mm() calls
Liam R. Howlett [Tue, 9 Feb 2021 00:24:58 +0000 (19:24 -0500)]
mm/mmap: Add more validate_mm() calls

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm: Return a bool from anon_vma_interval_tree_verify()
Liam R. Howlett [Sun, 7 Feb 2021 00:47:59 +0000 (19:47 -0500)]
mm: Return a bool from anon_vma_interval_tree_verify()

Added to allow printing which vma has the issue

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: expand_upwards() shouldn't call validate_mm()
Liam R. Howlett [Sun, 7 Feb 2021 00:47:17 +0000 (19:47 -0500)]
mm/mmap: expand_upwards() shouldn't call validate_mm()

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: mmap_region() fixes for when expanding vma as well as anon
Liam R. Howlett [Sun, 7 Feb 2021 00:46:38 +0000 (19:46 -0500)]
mm/mmap: mmap_region() fixes for when expanding vma as well as anon

When expanding a vma, call khugepaged_enter_vma_merge() with correct vma.

Also, set the vm_pgoff to the correct value when adding an anon mapping.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Fix detach_range() and do_mas_align_munmap()
Liam R. Howlett [Sun, 7 Feb 2021 00:44:50 +0000 (19:44 -0500)]
mm/mmap: Fix detach_range() and do_mas_align_munmap()

When searching for the first entry overlapp in do_mas_align_munmap(), the mas->last
will be modified if one is found, and if the maple state isn't reset for splitting,
then the wrong end will be past to detach_range() in the maple state.

detach_range() no longer needs both vma and vm_area_struct last, so make that change
too.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: vma_expand() Cleanup code a bit
Liam R. Howlett [Sun, 7 Feb 2021 00:41:29 +0000 (19:41 -0500)]
mm/mmap: vma_expand() Cleanup code a bit

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Fix linked list damage from e40a951e09ed0e
Liam R. Howlett [Thu, 4 Feb 2021 19:23:45 +0000 (14:23 -0500)]
mm/mmap: Fix linked list damage from e40a951e09ed0e

Drop unnecessary while() after mas_for_each()

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agofs/proc/task_mmu: Fix linked list damage from c4e6b1dfcb6f99
Liam R. Howlett [Thu, 4 Feb 2021 19:20:09 +0000 (14:20 -0500)]
fs/proc/task_mmu: Fix linked list damage from c4e6b1dfcb6f99

Fix reset of mas and initialize vma_start.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/ksm: Fix error introduced in 3fd77bfa4f25fa
Liam R. Howlett [Thu, 4 Feb 2021 19:06:58 +0000 (14:06 -0500)]
mm/ksm: Fix error introduced in 3fd77bfa4f25fa

mm may be uninitialized during the first loop.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Set next to NULL in mmap_region()
Liam R. Howlett [Thu, 4 Feb 2021 18:59:30 +0000 (13:59 -0500)]
mm/mmap: Set next to NULL in mmap_region()

When following cannot_expand goto, next would not be set

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Remove validate from expand() as the lock isn't held.
Liam R. Howlett [Thu, 4 Feb 2021 01:15:18 +0000 (20:15 -0500)]
mm/mmap: Remove validate from expand() as the lock isn't held.

Add validate_mm() to many other locations.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Don't reset ma_neighbour in brk() as it won't be used
Liam R. Howlett [Thu, 4 Feb 2021 01:13:38 +0000 (20:13 -0500)]
mm/mmap: Don't reset ma_neighbour in brk() as it won't be used

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Fix alignment mess of gap searching
Liam R. Howlett [Thu, 4 Feb 2021 01:07:37 +0000 (20:07 -0500)]
mm/mmap: Fix alignment mess of gap searching

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Assert lock is held before running validate_mm()
Liam R. Howlett [Thu, 4 Feb 2021 01:06:44 +0000 (20:06 -0500)]
mm/mmap: Assert lock is held before running validate_mm()

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Drop unused ma_lock from remap_file_pages
Liam R. Howlett [Wed, 3 Feb 2021 15:41:25 +0000 (10:41 -0500)]
mm/mmap: Drop unused ma_lock from remap_file_pages

The variable is not used.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Fix error path not checking anon_vma for null
Liam R. Howlett [Wed, 3 Feb 2021 15:28:44 +0000 (10:28 -0500)]
mm/mmap: Fix error path not checking anon_vma for null

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Rework mas_replace()
Liam R. Howlett [Wed, 3 Feb 2021 14:35:43 +0000 (09:35 -0500)]
maple_tree: Rework mas_replace()

Drop ma_set_slot() and mte_set_slot() in favour of just setting the slot
value in the parent.  This is the only function using those two
functions and they are not necessary.

Drop check for replacing the node with itself as that doesn't happen -
confirmed by running the test suite with a BUG_ON instead of the swap.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mempolicy: Fix mas_for_each() loop
Liam R. Howlett [Wed, 3 Feb 2021 01:21:11 +0000 (20:21 -0500)]
mm/mempolicy: Fix mas_for_each() loop

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agolib/maple_tree: Fix allocation walk iterators.
Liam R. Howlett [Tue, 2 Feb 2021 14:19:43 +0000 (09:19 -0500)]
lib/maple_tree: Fix allocation walk iterators.

Do not reset mas->node or mas->offset and advance the slot on
continuing.

This also drops mas_rev_awalk() and instead pulls it into
mas_empty_area_rev().

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Fix exit_mmap() maple state.
Liam R. Howlett [Tue, 2 Feb 2021 14:17:16 +0000 (09:17 -0500)]
mm/mmap: Fix exit_mmap() maple state.

Do not reset the maple state prior to unmap_vmas().

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Fux do_mas_align_munmap() search for vma.
Liam R. Howlett [Tue, 2 Feb 2021 14:16:20 +0000 (09:16 -0500)]
mm/mmap: Fux do_mas_align_munmap() search for vma.

Use find instead of walk to search for the VMA to ensure a VMA is found
if the start does not fall on a VMA

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Change gap calculations
Liam R. Howlett [Tue, 2 Feb 2021 14:14:41 +0000 (09:14 -0500)]
mm/mmap: Change gap calculations

When calculating the gaps, make sure the alignment is okay.

This needs further analysis.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/memory: Fix zap_page_range
Liam R. Howlett [Tue, 2 Feb 2021 14:12:34 +0000 (09:12 -0500)]
mm/memory: Fix zap_page_range

Use mas_for_each to avoid calling unmap_single_vma for the start VMA twice.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/memory: Whitespace fix
Liam R. Howlett [Tue, 2 Feb 2021 14:11:59 +0000 (09:11 -0500)]
mm/memory: Whitespace fix

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Fix validate_mm() warning
Liam R. Howlett [Mon, 1 Feb 2021 19:25:38 +0000 (14:25 -0500)]
mm/mmap: Fix validate_mm() warning

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Remove rb and vma_link() comment on bug.
Liam R. Howlett [Mon, 1 Feb 2021 19:02:47 +0000 (14:02 -0500)]
mm/mmap: Remove rb and vma_link() comment on bug.

This bug does not exist for maple tree

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Use mtree_init() in mt_destroy_walk()
Liam R. Howlett [Mon, 1 Feb 2021 18:48:20 +0000 (13:48 -0500)]
mm/mmap: Use mtree_init() in mt_destroy_walk()

Don't use MTREE_INIT()

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Use mtree_init() in do_mas_align_munmap()
Liam R. Howlett [Mon, 1 Feb 2021 18:47:49 +0000 (13:47 -0500)]
mm/mmap: Use mtree_init() in do_mas_align_munmap()

Don't use MTREE_INIT()

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Convert __insert_vm_struct to use mas, convert vma_link to use vma_mas_link() howlett/maple_spf/20210129
Liam R. Howlett [Mon, 4 Jan 2021 18:55:29 +0000 (13:55 -0500)]
mm/mmap: Convert __insert_vm_struct to use mas, convert vma_link to use vma_mas_link()

Drop unused vma_store()

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm: Remove vma linked list.
Liam R. Howlett [Mon, 4 Jan 2021 20:15:50 +0000 (15:15 -0500)]
mm: Remove vma linked list.

The vma linked list has been replaced by the maple tree iterators and
vma_next() vma_prev() functions.

A part of this change is also the iterators free_pgd_range(),
zap_page_range(), and unmap_single_vma()

The internal _vma_next() has been dropped.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/util: Remove __vma_link_list() and __vma_unlink_list()
Liam R. Howlett [Mon, 4 Jan 2021 20:10:54 +0000 (15:10 -0500)]
mm/util: Remove __vma_link_list() and __vma_unlink_list()

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/nommu: Stop inserting into the vma linked list
Liam R. Howlett [Mon, 4 Jan 2021 20:10:18 +0000 (15:10 -0500)]
mm/nommu: Stop inserting into the vma linked list

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/swapfile: Use maple tree iterator instead of vma linked list
Liam R. Howlett [Mon, 4 Jan 2021 20:07:11 +0000 (15:07 -0500)]
mm/swapfile: Use maple tree iterator instead of vma linked list

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/pagewalk: Use vma_next() instead of vma linked list
Liam R. Howlett [Mon, 4 Jan 2021 20:06:47 +0000 (15:06 -0500)]
mm/pagewalk: Use vma_next() instead of vma linked list

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/oom_kill: Use maple tree iterators instead of vma linked list
Liam R. Howlett [Mon, 4 Jan 2021 20:06:25 +0000 (15:06 -0500)]
mm/oom_kill: Use maple tree iterators instead of vma linked list

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/nommu: Use maple tree iterators instead of vma linked list
Liam R. Howlett [Mon, 4 Jan 2021 20:04:42 +0000 (15:04 -0500)]
mm/nommu: Use maple tree iterators instead of vma linked list

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/msync: Use vma_next() instead of vma linked list
Liam R. Howlett [Mon, 4 Jan 2021 20:04:14 +0000 (15:04 -0500)]
mm/msync: Use vma_next() instead of vma linked list

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mremap: Use vma_next() instead of vma linked list
Liam R. Howlett [Mon, 4 Jan 2021 20:03:49 +0000 (15:03 -0500)]
mm/mremap: Use vma_next() instead of vma linked list

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mprotect: Use maple tree navigation instead of vma linked list
Liam R. Howlett [Mon, 4 Jan 2021 20:02:28 +0000 (15:02 -0500)]
mm/mprotect: Use maple tree navigation instead of vma linked list

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mlock: Use maple tree iterators instead of vma linked list
Liam R. Howlett [Mon, 4 Jan 2021 20:00:14 +0000 (15:00 -0500)]
mm/mlock: Use maple tree iterators instead of vma linked list

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mempolicy: Use maple tree iterators instead of vma linked list
Liam R. Howlett [Mon, 4 Jan 2021 19:59:52 +0000 (14:59 -0500)]
mm/mempolicy: Use maple tree iterators instead of vma linked list

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/memcontrol: Stop using mm->highest_vm_end
Liam R. Howlett [Mon, 4 Jan 2021 19:59:05 +0000 (14:59 -0500)]
mm/memcontrol: Stop using mm->highest_vm_end

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/madvise: Use vma_next instead of vma linked list
Liam R. Howlett [Mon, 4 Jan 2021 19:58:35 +0000 (14:58 -0500)]
mm/madvise: Use vma_next instead of vma linked list

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/ksm: Use maple tree iterators instead of vma linked list
Liam R. Howlett [Mon, 4 Jan 2021 19:58:11 +0000 (14:58 -0500)]
mm/ksm: Use maple tree iterators instead of vma linked list

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/khugepaged: Use maple tree iterators instead of vma linked list
Liam R. Howlett [Mon, 4 Jan 2021 19:57:47 +0000 (14:57 -0500)]
mm/khugepaged: Use maple tree iterators instead of vma linked list

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/huge_memory: Use vma_next() instead of vma linked list
Liam R. Howlett [Mon, 4 Jan 2021 19:56:58 +0000 (14:56 -0500)]
mm/huge_memory: Use vma_next() instead of vma linked list

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/gup: Use maple tree navigation instead of linked list
Liam R. Howlett [Mon, 4 Jan 2021 19:56:20 +0000 (14:56 -0500)]
mm/gup: Use maple tree navigation instead of linked list

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agokernel/sys: Use maple tree iterators instead of linked list
Liam R. Howlett [Mon, 4 Jan 2021 19:54:49 +0000 (14:54 -0500)]
kernel/sys: Use maple tree iterators instead of linked list

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agokernel/sched/fair: Use maple tree iterators instead of linked list
Liam R. Howlett [Mon, 4 Jan 2021 19:54:07 +0000 (14:54 -0500)]
kernel/sched/fair: Use maple tree iterators instead of linked list

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agokernel/events/uprobes: Use maple tree iterators instead of linked list
Liam R. Howlett [Mon, 4 Jan 2021 19:53:01 +0000 (14:53 -0500)]
kernel/events/uprobes: Use maple tree iterators instead of linked list

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agokernel/events/core: Use maple tree iterators instead of linked list
Liam R. Howlett [Mon, 4 Jan 2021 19:52:39 +0000 (14:52 -0500)]
kernel/events/core: Use maple tree iterators instead of linked list

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agokernel/acct: Use maple tree iterators instead of linked list
Liam R. Howlett [Mon, 4 Jan 2021 19:52:15 +0000 (14:52 -0500)]
kernel/acct: Use maple tree iterators instead of linked list

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agoipc/shm: Stop using the vma linked list
Liam R. Howlett [Mon, 4 Jan 2021 19:51:19 +0000 (14:51 -0500)]
ipc/shm: Stop using the vma linked list

When searching for a VMA, a maple state can be used instead of the linked list in
the mm_struct

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agofs/userfaultfd: Stop using vma linked list.
Liam R. Howlett [Mon, 4 Jan 2021 19:49:47 +0000 (14:49 -0500)]
fs/userfaultfd: Stop using vma linked list.

Don't use the mm_struct linked list or the vma->vm_next in prep for removal

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agofs/proc/task_mmu: Stop using linked list and highest_vm_end
Liam R. Howlett [Mon, 4 Jan 2021 19:47:48 +0000 (14:47 -0500)]
fs/proc/task_mmu: Stop using linked list and highest_vm_end

Remove references to mm_struct linked list and highest_vm_end for when they are removed

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agofs/proc/base: Use maple tree iterators in place of linked list
Liam R. Howlett [Mon, 4 Jan 2021 19:46:23 +0000 (14:46 -0500)]
fs/proc/base: Use maple tree iterators in place of linked list

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agofs/exec: Use vma_next() instead of linked list
Liam R. Howlett [Mon, 4 Jan 2021 19:45:37 +0000 (14:45 -0500)]
fs/exec: Use vma_next() instead of linked list

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agofs/coredump: Use maple tree iterators in place of linked list
Liam R. Howlett [Mon, 4 Jan 2021 19:44:45 +0000 (14:44 -0500)]
fs/coredump: Use maple tree iterators in place of linked list

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agofs/binfmt_elf: Use maple tree iterators for fill_files_note()
Liam R. Howlett [Mon, 4 Jan 2021 19:44:16 +0000 (14:44 -0500)]
fs/binfmt_elf: Use maple tree iterators for fill_files_note()

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agodrivers/tee/optee: Use maple tree iterators for __check_mem_type()
Liam R. Howlett [Mon, 4 Jan 2021 19:43:36 +0000 (14:43 -0500)]
drivers/tee/optee: Use maple tree iterators for __check_mem_type()

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agodrivers/oprofile: Lookup address in tree instead of linked list.
Liam R. Howlett [Mon, 4 Jan 2021 19:42:37 +0000 (14:42 -0500)]
drivers/oprofile: Lookup address in tree instead of linked list.

Use the vma interface to find the vma if one exists instead of the linked list

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agodrivers/misc/cxl: Use maple tree iterators for cxl_prefault_vma()
Liam R. Howlett [Mon, 4 Jan 2021 19:31:50 +0000 (14:31 -0500)]
drivers/misc/cxl: Use maple tree iterators for cxl_prefault_vma()

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agoarch/xtensa: Use maple tree iterators for unmapped area
Liam R. Howlett [Mon, 4 Jan 2021 19:30:59 +0000 (14:30 -0500)]
arch/xtensa: Use maple tree iterators for unmapped area

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agoarch/x86: Use maple tree iterators for vdso/vma
Liam R. Howlett [Mon, 4 Jan 2021 19:30:25 +0000 (14:30 -0500)]
arch/x86: Use maple tree iterators for vdso/vma

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agoarch/um: Use maple tree iterators instead of linked list
Liam R. Howlett [Mon, 4 Jan 2021 19:29:56 +0000 (14:29 -0500)]
arch/um: Use maple tree iterators instead of linked list

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agoarch/s390: Use maple tree iterators instead of linked list.
Liam R. Howlett [Mon, 4 Jan 2021 19:29:19 +0000 (14:29 -0500)]
arch/s390: Use maple tree iterators instead of linked list.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agoarch/powerpc: Optimize cell spu task sync.
Liam R. Howlett [Mon, 4 Jan 2021 19:28:48 +0000 (14:28 -0500)]
arch/powerpc: Optimize cell spu task sync.

Use the vma api to look up the spu reference instead of walking the linked list.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agoarch/powerpc: Remove mmap linked list from mm/book2s32/subpage_prot
Liam R. Howlett [Mon, 4 Jan 2021 19:26:34 +0000 (14:26 -0500)]
arch/powerpc: Remove mmap linked list from mm/book2s32/subpage_prot

Start using the maple tree

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agoarch/powerpc: Remove mmap linked list from mm/book2s32/tlb
Liam R. Howlett [Mon, 4 Jan 2021 19:25:54 +0000 (14:25 -0500)]
arch/powerpc: Remove mmap linked list from mm/book2s32/tlb

Start using the maple tree

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agoarch/parsic: Remove mmap linked list from kernel/cache
Liam R. Howlett [Mon, 4 Jan 2021 19:25:19 +0000 (14:25 -0500)]
arch/parsic: Remove mmap linked list from kernel/cache

Start using the maple tree

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>