[Patch 2/2] Kernel: mutex_lock_killable

2007-11-28 Thread Liam R. Howlett
Use mutex_lock_killable in vfs_readdir Signed-off-by: Liam R. Howlett [EMAIL PROTECTED] Acked-by: Matthew Wilcox [EMAIL PROTECTED] --- fs/readdir.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/fs/readdir.c b/fs/readdir.c index efe52e6..4aee2c9 100644 --- a/fs

[Patch 1/2] Kernel: mutex_lock_killable

2007-11-28 Thread Liam R. Howlett
Addition of mutex_lock_killable for mutex.c and mutex.h Signed-off-by: Liam R. Howlett [EMAIL PROTECTED] Acked-by: Matthew Wilcox [EMAIL PROTECTED] --- include/linux/mutex.h |5 + kernel/mutex.c| 36 +--- 2 files changed, 38 insertions(+), 3

Re: [RFC Patch 1/1] mm/hugetlb: Clarify OOM message on size of hugetlb and requested hugepages total

2017-09-13 Thread Liam R. Howlett
* Michal Hocko <mho...@kernel.org> [170913 08:43]: > On Mon 11-09-17 11:48:20, Liam R. Howlett wrote: > > Change the output of hugetlb_show_meminfo to give the size of the > > hugetlb in more than just Kb and add a warning message if the requested > > hugepages i

[RFC Patch 0/1] Change OOM message from hugetlb to include requested size

2017-09-11 Thread Liam R. Howlett
been removed in favour of this method. Liam R. Howlett (1): mm/hugetlb: Clarify OOM message on size of hugetlb and requested hugepages total include/linux/hugetlb.h | 1 + mm/hugetlb.c| 35 +++ 2 files changed, 32 insertions(+), 4 deletions

[RFC Patch 1/1] mm/hugetlb: Clarify OOM message on size of hugetlb and requested hugepages total

2017-09-11 Thread Liam R. Howlett
hugepages_surp=0 hugepages_size=2048kB Signed-off-by: Liam R. Howlett <liam.howl...@oracle.com> --- include/linux/hugetlb.h | 1 + mm/hugetlb.c| 35 +++ 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/include/linux/hugetlb.h b/include

Re: [Announce] LPC 2018: Testing and Fuzzing Microconference

2018-10-02 Thread Liam R. Howlett
lters easily become outdated when the application or shared library is updated. This can cause failures or security issues [ 1 ]. Other potential uses including examining binary blobs, vulnerability analysis, and debugging. Thank you, Liam R. Howlett [1] https://lwn.net/Articles/738750/

Re: [Announce] LPC 2018: Testing and Fuzzing Microconference

2018-10-03 Thread Liam R. Howlett
* Sasha Levin [181002 17:03]: > On Tue, Oct 2, 2018 at 4:44 PM Liam R. Howlett > wrote: > > > > * Dhaval Giani [180919 13:15]: > > > Hi folks, > > > > > > Sasha and I are pleased to announce the Testing and Fuzzing track at > > > LPC [ 1 ].

Out of tree module build errors since v4.20-rc1

2018-11-21 Thread Liam R. Howlett
My out of tree driver build is now reporting issues with the jump table: ./include/linux/jump_label.h: In function ‘jump_entry_code’: ./include/linux/jump_label.h:153:14: error: dereferencing pointer to incomplete type ‘const struct jump_entry’ return entry->code; ^~

Re: Out of tree module build errors since v4.20-rc1

2018-11-21 Thread Liam R. Howlett
* Nadav Amit [181121 16:12]: > > On Nov 21, 2018, at 12:56 PM, Liam R. Howlett > > wrote: > > > > > > My out of tree driver build is now reporting issues with the jump table: > > > > ./include/linux/jump_label.h: In function ‘jump_entry_code’: >

[RFC Patch 1/1] mm/hugetlb: Clarify OOM message on size of hugetlb and requested hugepages total

2017-09-11 Thread Liam R. Howlett
hugepages_surp=0 hugepages_size=2048kB Signed-off-by: Liam R. Howlett --- include/linux/hugetlb.h | 1 + mm/hugetlb.c| 35 +++ 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index b857fc8cc2ec

[RFC Patch 0/1] Change OOM message from hugetlb to include requested size

2017-09-11 Thread Liam R. Howlett
been removed in favour of this method. Liam R. Howlett (1): mm/hugetlb: Clarify OOM message on size of hugetlb and requested hugepages total include/linux/hugetlb.h | 1 + mm/hugetlb.c| 35 +++ 2 files changed, 32 insertions(+), 4 deletions

Re: [RFC Patch 1/1] mm/hugetlb: Clarify OOM message on size of hugetlb and requested hugepages total

2017-09-13 Thread Liam R. Howlett
* Michal Hocko [170913 08:43]: > On Mon 11-09-17 11:48:20, Liam R. Howlett wrote: > > Change the output of hugetlb_show_meminfo to give the size of the > > hugetlb in more than just Kb and add a warning message if the requested > > hugepages is larger than the allocated hu

[PATCH] mm/mmap: Fix Add inline munmap_vma_range() for code readability

2020-08-31 Thread Liam R. Howlett
Add missing whitespace after the function, and fix comment arguments to match arguments. Signed-off-by: Liam R. Howlett --- mm/mmap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index b59b4e5889b5c..c64f4fc410312 100644 --- a/mm/mmap.c +++ b/mm

[RESEND PATCH] mm/mmap: Fix Add inline munmap_vma_range() for code readability

2020-09-21 Thread Liam R. Howlett
Add missing whitespace after the function, and fix comment arguments to match arguments. Signed-off-by: Liam R. Howlett --- mm/mmap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index b59b4e5889b5c..c64f4fc410312 100644 --- a/mm/mmap.c +++ b/mm

[PATCH 17/28] mm/mmap: Change mmap_region to use maple tree state

2020-12-10 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 1 + mm/mmap.c| 221 --- 2 files changed, 190 insertions(+), 32 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index e5a58f4833e45..1b678ef90c05c 100644 --- a/lib

[PATCH 11/28] kernel/fork: Convert dup_mmap to use maple tree

2020-12-10 Thread Liam R. Howlett
Use the maple tree iterator to duplicate the mm_struct trees. Signed-off-by: Liam R. Howlett --- include/linux/sched/mm.h | 3 +++ kernel/fork.c| 22 +- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/include/linux/sched/mm.h b/include/linux

[PATCH 08/28] mm/mmap: Change find_vma() to use the maple tree

2020-12-10 Thread Liam R. Howlett
Start using the maple tree to find VMA entries in an mm_struct. Signed-off-by: Liam R. Howlett --- mm/mmap.c | 29 +++-- 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 6999c2bcf0496..53876d66a27ea 100644 --- a/mm/mmap.c +++ b

[PATCH 00/28] RFC mm: Introducing the Maple Tree

2020-12-10 Thread Liam R. Howlett
-256 25.08 ( 0.00%) 25.42 * -1.35%* Amean user-288 1742.33 ( 0.00%) 1739.64 * 0.15%* Amean syst-288 241.16 ( 0.00%) 256.44 * -6.34%* Amean elsp-288 25.10 ( 0.00%) 25.44 * -1.35%* Liam R. Howlett (28): radix tree test suite

[PATCH 03/28] radix tree test suite: Add support for kmem_cache_free_bulk

2020-12-10 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- tools/testing/radix-tree/linux.c | 9 + tools/testing/radix-tree/linux/slab.h | 1 + 2 files changed, 10 insertions(+) diff --git a/tools/testing/radix-tree/linux.c b/tools/testing/radix-tree/linux.c index 93f7de81fbe87..380bbc0a48d6f 100644

[PATCH 24/28] mmap: Use find_vma_intersection in do_mmap() for overlap

2020-12-10 Thread Liam R. Howlett
When detecting a conflict with MAP_FIXED_NOREPLACE, using the new interface avoids the need for a temp variable Signed-off-by: Liam R. Howlett --- mm/mmap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 4ef32ed2c34dc..48ab40a90428b 100644

[PATCH 02/28] radix tree test suite: Add support for fallthrough attribute

2020-12-10 Thread Liam R. Howlett
Add support for fallthrough on case statements. Note this does *NOT* check for missing fallthrough, but does allow compiling of code with fallthrough in case statements. Signed-off-by: Liam R. Howlett --- tools/testing/radix-tree/linux/kernel.h | 7 +++ 1 file changed, 7 insertions

[PATCH 22/28] mm/mmap: Move mmap_region() below do_munmap()

2020-12-10 Thread Liam R. Howlett
Relocation of code for the next commit. There should be no changes here. Signed-off-by: Liam R. Howlett --- mm/mmap.c | 479 +++--- 1 file changed, 240 insertions(+), 239 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 34f337a5fc31d

[PATCH 26/28] mm/mmap: Change do_brk_munmap() to use do_mas_align_munmap()

2020-12-10 Thread Liam R. Howlett
do_brk_munmap() already has aligned addresses. Signed-off-by: Liam R. Howlett --- mm/mmap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 36a6b03193eb3..284c90504b44c 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2992,12 +2992,13 @@ static int

[PATCH 09/28] mm/mmap: Change find_vma_prev() to use maple tree

2020-12-10 Thread Liam R. Howlett
Change the implementation of find_vma_prev to use the new maple tree data structure. Signed-off-by: Liam R. Howlett --- mm/mmap.c | 27 +-- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 53876d66a27ea..3a9e04df021e3 100644

[PATCH 01/28] radix tree test suite: Enhancements for Maple Tree

2020-12-10 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett Signed-off-by: Matthew Wilcox (Oracle) --- tools/testing/radix-tree/linux.c| 16 +++- tools/testing/radix-tree/linux/kernel.h | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/tools/testing/radix-tree/linux.c b/tools

[PATCH 28/28] mmap: make remove_vma_list() inline

2020-12-10 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- mm/mmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/mmap.c b/mm/mmap.c index 7a575e6f1e7df..93244389a028d 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2280,7 +2280,8 @@ EXPORT_SYMBOL_GPL(find_extend_vma); * * Called with the mm

[PATCH 20/28] mm/mmap: Change __do_munmap() to avoid unnecessary lookups.

2020-12-10 Thread Liam R. Howlett
As there is no longer a vmacache, find_vma() is more expensive and so avoid doing them Signed-off-by: Liam R. Howlett --- mm/mmap.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index c3ac4d6f970d3..15616f105d051 100644 --- a/mm

[PATCH 23/28] mm/mmap: Add do_mas_munmap() and wraper for __do_munmap()

2020-12-10 Thread Liam R. Howlett
To avoid extra tree work, it is necessary to support passing in a maple state to key functions. Start this work with __do_munmap(). Signed-off-by: Liam R. Howlett --- mm/mmap.c | 102 ++ 1 file changed, 72 insertions(+), 30 deletions(-) diff

[PATCH 21/28] mm/mmap: Change __do_munmap() to use a ma_state

2020-12-10 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- mm/mmap.c | 99 ++- 1 file changed, 47 insertions(+), 52 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 15616f105d051..34f337a5fc31d 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2562,44 +2562,6 @@ static

[PATCH 14/28] mm/mmap: Change do_brk_flags() to expand existing VMA and add do_brk_munmap()

2020-12-10 Thread Liam R. Howlett
Avoid allocating a new VMA when it is not necessary. Expand or contract the existing VMA instead. This avoids unnecessary tree manipulations and allocations. Once the VMA is known, use it directly when populating to avoid unnecessary lookup work. Signed-off-by: Liam R. Howlett --- mm/mmap.c

[PATCH 27/28] mmap: Update count_vma_pages_range() to only use one ma_state

2020-12-10 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- mm/mmap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 284c90504b44c..7a575e6f1e7df 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -483,17 +483,15 @@ static unsigned long count_vma_pages_range(struct mm_struct

[PATCH 25/28] mmap: Remove __do_munmap() in favour of do_mas_munmap()

2020-12-10 Thread Liam R. Howlett
Export new interface and use it in place of old interface. Signed-off-by: Liam R. Howlett --- include/linux/mm.h | 4 ++-- mm/mmap.c | 16 mm/mremap.c| 7 --- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/include/linux/mm.h b/include

[PATCH 12/28] mm: Remove rb tree.

2020-12-10 Thread Liam R. Howlett
Remove the RB tree and start using the maple tree for vm_area_struct tracking. Signed-off-by: Liam R. Howlett --- arch/x86/kernel/tboot.c| 1 - drivers/firmware/efi/efi.c | 1 - include/linux/mm.h | 4 - include/linux/mm_types.h | 27 +- kernel/fork.c | 8

[PATCH 10/28] mm/mmap: Change unmapped_area and unmapped_area_topdown to use maple tree

2020-12-10 Thread Liam R. Howlett
Use the new maple tree data structure to find an unmapped area. Signed-off-by: Liam R. Howlett --- mm/mmap.c | 249 ++ 1 file changed, 27 insertions(+), 222 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 3a9e04df021e3..071303779f906

[PATCH 04/28] radix tree test suite: Add keme_cache_alloc_bulk() support

2020-12-10 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- tools/testing/radix-tree/linux.c | 51 +++ tools/testing/radix-tree/linux/slab.h | 1 + 2 files changed, 52 insertions(+) diff --git a/tools/testing/radix-tree/linux.c b/tools/testing/radix-tree/linux.c index 380bbc0a48d6f

[PATCH 16/28] mm: Move find_vma_intersection to mmap.c and change implementation to maple tree.

2020-12-10 Thread Liam R. Howlett
When searching for a vma within a range, it is easier to use the maple tree interface. This means the find_vma() call changes to a special case of the find_vma_intersection(). Exported for kvm module. Signed-off-by: Liam R. Howlett --- include/linux/mm.h | 10 ++ mm/mmap.c

[PATCH 13/28] mm/gup: Expose mm_populate_vma() for use when the vma is known

2020-12-10 Thread Liam R. Howlett
When a vma is known, avoid calling mm_populate to search for the vma to populate. Signed-off-by: Liam R. Howlett --- include/linux/mm.h | 4 mm/gup.c | 20 2 files changed, 24 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index

[PATCH 06/28] mm: Start tracking VMAs with maple tree

2020-12-10 Thread Liam R. Howlett
Start tracking the VMAs with the new maple tree structure in parallel with the rb_tree. Add debug and trace events for maple tree operations and duplicate the rb_tree that is created on forks into the maple tree. Signed-off-by: Liam R. Howlett --- arch/x86/kernel/tboot.c | 1 + drivers

[PATCH 07/28] mm/mmap: Introduce unlock_range() for code cleanup

2020-12-10 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- mm/mmap.c | 37 ++--- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 5306a865e5973..6999c2bcf0496 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2993,6 +2993,20 @@ int split_vma(struct

[PATCH 15/28] mm/mmap: Change vm_brk_flags() to use mm_populate_vma()

2020-12-10 Thread Liam R. Howlett
Skip searching for the vma to populate after creating it by passing in a pointer. Signed-off-by: Liam R. Howlett --- mm/mmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index ec2e92b03f9d1..dc7a742fbe131 100644 --- a/mm/mmap.c +++ b/mm/mmap.c

[PATCH 18/28] mm/mmap: Drop munmap_vma_range()

2020-12-10 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- mm/mmap.c | 23 --- 1 file changed, 23 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index f94a5c17252f2..d7a7d01f696c1 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -475,29 +475,6 @@ static inline struct vm_area_struct *vma_next(struct

[PATCH 19/28] mm: Remove vmacache

2020-12-10 Thread Liam R. Howlett
The maple tree is able to find a VMA quick enough to no longer need the vma cache. Remove the vmacache to reduce work in keeping it up to date and code complexity. Signed-off-by: Liam R. Howlett --- fs/exec.c | 3 - fs/proc/task_mmu.c| 1 - include/linux

[PATCH] mm/mmap: Don't unlock VMAs in remap_file_pages()

2020-12-15 Thread Liam R. Howlett
do_mmap() will unlock the necessary VMAs. There is also a bug in the loop which will evaluate as false and not unlock any VMAs anyways. Signed-off-by: Liam R. Howlett --- mm/mmap.c | 19 --- 1 file changed, 19 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 5c8b4485860de

Re: [PATCH] mm/mmap: Don't unlock VMAs in remap_file_pages()

2020-12-15 Thread Liam R. Howlett
* Matthew Wilcox [201215 09:50]: > On Tue, Dec 15, 2020 at 09:13:00AM -0500, Liam R. Howlett wrote: > > @@ -3025,25 +3025,6 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, > > start, unsigned long, size, > > > > flags &= MAP_NONBLOCK; > >

[PATCH v2] mm/mmap: Don't unlock VMAs in remap_file_pages()

2020-12-15 Thread Liam R. Howlett
do_mmap() will unlock the necessary VMAs. There is also a bug in the loop which will evaluate as false and not unlock any VMAs anyways. Signed-off-by: Liam R. Howlett --- mm/mmap.c | 18 +- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c

Re: [PATCH v2] mm/mmap: Don't unlock VMAs in remap_file_pages()

2020-12-16 Thread Liam R. Howlett
Thank you for looking at this. I appreciate the scrutiny. * David Hildenbrand [201216 09:58]: > On 15.12.20 16:54, Liam R. Howlett wrote: > > do_mmap() will unlock the necessary VMAs. There is also a bug in the > > loop which will evaluate as false and not unlock a

Re: [PATCH] wimax/i2400m: fix a memory leak bug

2019-08-15 Thread Liam R. Howlett
* Wenwen Wang [190815 14:05]: > In i2400m_barker_db_init(), 'options_orig' is allocated through kstrdup() > to hold the original command line options. Then, the options are parsed. > However, if an error occurs during the parsing process, 'options_orig' is > not deallocated, leading to a memory

[PATCH 1/2] mm/mmap: Add inline vma_next() for readability of mmap code

2020-08-18 Thread Liam R. Howlett
There are three places that the next vma is required which uses the same block of code. Replace the block with a function and add comments on what happens in the case where NULL is encountered. Signed-off-by: Liam R. Howlett --- mm/mmap.c | 26 -- 1 file changed, 20

[PATCH 2/2] mm/mmap: Add inline munmap_vma_range() for code readability

2020-08-18 Thread Liam R. Howlett
There are two locations that have a block of code for munmapping a vma range. Change those two locations to use a function and add meaningful comments about what happens to the arguments, which was unclear in the previous code. Signed-off-by: Liam R. Howlett --- mm/mmap.c | 48

Re: [PATCH v2 14/70] mm/mmap: Change do_brk_flags() to expand existing VMA and add do_brk_munmap()

2021-01-13 Thread Liam R. Howlett
* Randy Dunlap [210112 16:23]: > Hi-- > > On 1/12/21 8:11 AM, Liam R. Howlett wrote: > > Avoid allocating a new VMA when it is not necessary. Expand or contract > > the existing VMA instead. This avoids unnecessary tree manipulations > > and allocations. > >

[Patch 2/2] Kernel: mutex_lock_killable

2007-11-28 Thread Liam R. Howlett
Use mutex_lock_killable in vfs_readdir Signed-off-by: Liam R. Howlett <[EMAIL PROTECTED]> Acked-by: Matthew Wilcox <[EMAIL PROTECTED]> --- fs/readdir.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/fs/readdir.c b/fs/readdir.c index efe52e6..4aee2c9 100

[Patch 1/2] Kernel: mutex_lock_killable

2007-11-28 Thread Liam R. Howlett
Addition of mutex_lock_killable for mutex.c and mutex.h Signed-off-by: Liam R. Howlett <[EMAIL PROTECTED]> Acked-by: Matthew Wilcox <[EMAIL PROTECTED]> --- include/linux/mutex.h |5 + kernel/mutex.c| 36 +--- 2 files changed, 38 inse

Out of tree module build errors since v4.20-rc1

2018-11-21 Thread Liam R. Howlett
My out of tree driver build is now reporting issues with the jump table: ./include/linux/jump_label.h: In function ‘jump_entry_code’: ./include/linux/jump_label.h:153:14: error: dereferencing pointer to incomplete type ‘const struct jump_entry’ return entry->code; ^~

Re: Out of tree module build errors since v4.20-rc1

2018-11-21 Thread Liam R. Howlett
* Nadav Amit [181121 16:12]: > > On Nov 21, 2018, at 12:56 PM, Liam R. Howlett > > wrote: > > > > > > My out of tree driver build is now reporting issues with the jump table: > > > > ./include/linux/jump_label.h: In function ‘jump_entry_code’: >

Re: [Announce] LPC 2018: Testing and Fuzzing Microconference

2018-10-02 Thread Liam R. Howlett
lters easily become outdated when the application or shared library is updated. This can cause failures or security issues [ 1 ]. Other potential uses including examining binary blobs, vulnerability analysis, and debugging. Thank you, Liam R. Howlett [1] https://lwn.net/Articles/738750/

Re: [Announce] LPC 2018: Testing and Fuzzing Microconference

2018-10-03 Thread Liam R. Howlett
* Sasha Levin [181002 17:03]: > On Tue, Oct 2, 2018 at 4:44 PM Liam R. Howlett > wrote: > > > > * Dhaval Giani [180919 13:15]: > > > Hi folks, > > > > > > Sasha and I are pleased to announce the Testing and Fuzzing track at > > > LPC [ 1 ].

[PATCH v2 11/70] kernel/fork: Convert dup_mmap to use maple tree

2021-01-12 Thread Liam R. Howlett
Use the maple tree iterator to duplicate the mm_struct trees. Signed-off-by: Liam R. Howlett --- include/linux/sched/mm.h | 3 +++ kernel/fork.c| 22 +- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/include/linux/sched/mm.h b/include/linux

[PATCH v2 00/70] RFC mm: Introducing the Maple Tree

2021-01-12 Thread Liam R. Howlett
8.07 ( 0.00%)7.92 * 1.83%* Amean Elapsed 23.46 ( 0.00%) 22.91 * 2.35%* Amean CPU 91.87 ( 0.00%) 92.33 * -0.51%* Liam R. Howlett (70): radix tree test suite: Enhancements for Maple Tree radix tree test suite: Add support

[PATCH v2 06/70] mm: Start tracking VMAs with maple tree

2021-01-12 Thread Liam R. Howlett
Start tracking the VMAs with the new maple tree structure in parallel with the rb_tree. Add debug and trace events for maple tree operations and duplicate the rb_tree that is created on forks into the maple tree. Signed-off-by: Liam R. Howlett --- arch/x86/kernel/tboot.c | 1 + drivers

[PATCH v2 13/70] mm/gup: Add mm_populate_vma() for use when the vma is known

2021-01-12 Thread Liam R. Howlett
When a vma is known, avoid calling mm_populate to search for the vma to populate. Signed-off-by: Liam R. Howlett --- include/linux/mm.h | 4 mm/gup.c | 20 2 files changed, 24 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index

[PATCH v2 27/70] mm: Introduce vma_next() and vma_prev()

2021-01-12 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- include/linux/mm.h | 35 ++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 680dcfe07dbb6..99b1dec97495a 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h

[PATCH v2 14/70] mm/mmap: Change do_brk_flags() to expand existing VMA and add do_brk_munmap()

2021-01-12 Thread Liam R. Howlett
Avoid allocating a new VMA when it is not necessary. Expand or contract the existing VMA instead. This avoids unnecessary tree manipulations and allocations. Once the VMA is known, use it directly when populating to avoid unnecessary lookup work. Signed-off-by: Liam R. Howlett --- mm/mmap.c

[PATCH v2 17/70] mm/mmap: Change mmap_region to use maple tree state

2021-01-12 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 1 + mm/mmap.c| 227 --- 2 files changed, 195 insertions(+), 33 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index c24c6f154c857..522f5fdfe5078 100644 --- a/lib

[PATCH v2 02/70] radix tree test suite: Add support for fallthrough attribute

2021-01-12 Thread Liam R. Howlett
Add support for fallthrough on case statements. Note this does *NOT* check for missing fallthrough, but does allow compiling of code with fallthrough in case statements. Signed-off-by: Liam R. Howlett --- tools/testing/radix-tree/linux/kernel.h | 7 +++ 1 file changed, 7 insertions

[PATCH v2 12/70] mm: Remove rb tree.

2021-01-12 Thread Liam R. Howlett
Remove the RB tree and start using the maple tree for vm_area_struct tracking. Signed-off-by: Liam R. Howlett --- arch/x86/kernel/tboot.c| 1 - drivers/firmware/efi/efi.c | 1 - include/linux/mm.h | 4 - include/linux/mm_types.h | 27 +- kernel/fork.c | 8

[PATCH v2 10/70] mm/mmap: Change unmapped_area and unmapped_area_topdown to use maple tree

2021-01-12 Thread Liam R. Howlett
Use the new maple tree data structure to find an unmapped area. Signed-off-by: Liam R. Howlett --- mm/mmap.c | 249 ++ 1 file changed, 27 insertions(+), 222 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index f123f9c97dfe8..3b3084ee309b7

[PATCH v2 15/70] mm/mmap: Change vm_brk_flags() to use mm_populate_vma()

2021-01-12 Thread Liam R. Howlett
Skip searching for the vma to populate after creating it by passing in a pointer. Signed-off-by: Liam R. Howlett --- mm/mmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index f500d5e490f1c..cab665a6daa05 100644 --- a/mm/mmap.c +++ b/mm/mmap.c

[PATCH v2 20/70] mm/mmap: Change __do_munmap() to avoid unnecessary lookups.

2021-01-12 Thread Liam R. Howlett
As there is no longer a vmacache, find_vma() is more expensive and so avoid doing them Signed-off-by: Liam R. Howlett --- mm/mmap.c | 115 -- 1 file changed, 59 insertions(+), 56 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index

[PATCH v2 36/70] arch/xtensa: Use maple tree iterators for unmapped area

2021-01-12 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- arch/xtensa/kernel/syscall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/xtensa/kernel/syscall.c b/arch/xtensa/kernel/syscall.c index 2c415fce6801a..26ec2e67879ad 100644 --- a/arch/xtensa/kernel/syscall.c +++ b/arch/xtensa/kernel

[PATCH v2 51/70] kernel/sys: Use maple tree iterators instead of linked list

2021-01-12 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- kernel/sys.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/sys.c b/kernel/sys.c index a730c03ee607c..fe061c54a5a46 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -1858,9 +1858,10 @@ static int prctl_set_mm_exe_file(struct

[PATCH v2 42/70] fs/exec: Use vma_next() instead of linked list

2021-01-12 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- fs/exec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/exec.c b/fs/exec.c index aa466921d6a97..6eb585ea1b841 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -712,7 +712,7 @@ static int shift_arg_pages(struct vm_area_struct *vma

[PATCH v2 21/70] mm/mmap: Move mmap_region() below do_munmap()

2021-01-12 Thread Liam R. Howlett
Relocation of code for the next commit. There should be no changes here. Signed-off-by: Liam R. Howlett --- mm/mmap.c | 490 ++ 1 file changed, 240 insertions(+), 250 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index af426972c9dd2

[PATCH v2 45/70] fs/userfaultfd: Stop using vma linked list.

2021-01-12 Thread Liam R. Howlett
Don't use the mm_struct linked list or the vma->vm_next in prep for removal Signed-off-by: Liam R. Howlett --- fs/userfaultfd.c | 24 +--- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c index 000b457ad0876..b0eac6fb3e

[PATCH v2 68/70] mm/util: Remove __vma_link_list() and __vma_unlink_list()

2021-01-12 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- mm/util.c | 40 1 file changed, 40 deletions(-) diff --git a/mm/util.c b/mm/util.c index 48c79f2784eca..74888472a0848 100644 --- a/mm/util.c +++ b/mm/util.c @@ -271,46 +271,6 @@ void *memdup_user_nul(const void __user

[PATCH v2 57/70] mm/memcontrol: Stop using mm->highest_vm_end

2021-01-12 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- mm/memcontrol.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 29459a6ce1c7a..7fe753d6a81f1 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -5892,7 +5892,7 @@ static unsigned long

[PATCH v2 63/70] mm/nommu: Use maple tree iterators instead of vma linked list

2021-01-12 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- mm/nommu.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mm/nommu.c b/mm/nommu.c index 0faf39b32cdb9..4e5cc63728b65 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -677,6 +677,7 @@ static void delete_vma(struct mm_struct *mm, struct

[PATCH v2 70/70] mm/mmap: Convert __insert_vm_struct to use mas, convert vma_link to use vma_mas_link()

2021-01-12 Thread Liam R. Howlett
Drop unused vma_store() Signed-off-by: Liam R. Howlett --- mm/mmap.c | 24 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index ce8857b9abd89..b4ed8be4899b8 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -514,21 +514,9 @@ static void

[PATCH v2 33/70] arch/s390: Use maple tree iterators instead of linked list.

2021-01-12 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- arch/s390/mm/gmap.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c index 64795d0349263..8f7ed79583b29 100644 --- a/arch/s390/mm/gmap.c +++ b/arch/s390/mm/gmap.c @@ -2502,8 +2502,9 @@ static

[PATCH v2 43/70] fs/proc/base: Use maple tree iterators in place of linked list

2021-01-12 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- fs/proc/base.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/proc/base.c b/fs/proc/base.c index b362523a9829a..0a7d4d3d6ae9b 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -2316,6 +2316,7 @@ proc_map_files_readdir(struct file

[PATCH v2 31/70] arch/powerpc: Remove mmap linked list from mm/book2s32/subpage_prot

2021-01-12 Thread Liam R. Howlett
Start using the maple tree Signed-off-by: Liam R. Howlett --- arch/powerpc/mm/book3s64/subpage_prot.c | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/mm/book3s64/subpage_prot.c b/arch/powerpc/mm/book3s64/subpage_prot.c index 60c6ea16a972a

[PATCH v2 66/70] mm/swapfile: Use maple tree iterator instead of vma linked list

2021-01-12 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- mm/swapfile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/swapfile.c b/mm/swapfile.c index d58361109066d..10e1d60ff6f89 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -2104,9 +2104,10 @@ static int unuse_mm(struct mm_struct *mm

[PATCH v2 62/70] mm/msync: Use vma_next() instead of vma linked list

2021-01-12 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- mm/msync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/msync.c b/mm/msync.c index 69c6d20295318..8100ad5b12eb8 100644 --- a/mm/msync.c +++ b/mm/msync.c @@ -100,7 +100,7 @@ SYSCALL_DEFINE3(msync, unsigned long, start, size_t, len, int

[PATCH v2 18/70] mm/mmap: Drop munmap_vma_range()

2021-01-12 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- mm/mmap.c | 23 --- 1 file changed, 23 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index d3dfea031c0d5..1cef158c31909 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -483,29 +483,6 @@ static inline struct vm_area_struct *vma_next(struct

[PATCH v2 08/70] mm/mmap: Change find_vma() to use the maple tree

2021-01-12 Thread Liam R. Howlett
Start using the maple tree to find VMA entries in an mm_struct. Signed-off-by: Liam R. Howlett --- mm/mmap.c | 29 +++-- 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 65789b188c380..ab1cb0efc4c65 100644 --- a/mm/mmap.c +++ b

[PATCH v2 19/70] mm: Remove vmacache

2021-01-12 Thread Liam R. Howlett
The maple tree is able to find a VMA quick enough to no longer need the vma cache. Remove the vmacache to reduce work in keeping it up to date and code complexity. Signed-off-by: Liam R. Howlett --- fs/exec.c | 3 - fs/proc/task_mmu.c| 1 - include/linux

[PATCH v2 04/70] radix tree test suite: Add keme_cache_alloc_bulk() support

2021-01-12 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- tools/testing/radix-tree/linux.c | 51 +++ tools/testing/radix-tree/linux/slab.h | 1 + 2 files changed, 52 insertions(+) diff --git a/tools/testing/radix-tree/linux.c b/tools/testing/radix-tree/linux.c index 380bbc0a48d6f

[PATCH v2 26/70] mmap: make remove_vma_list() inline

2021-01-12 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- mm/mmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/mmap.c b/mm/mmap.c index f750e85d4dc2c..964582c0f16ee 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2294,7 +2294,8 @@ EXPORT_SYMBOL_GPL(find_extend_vma); * * Called with the mm

[PATCH v2 30/70] arch/powerpc: Remove mmap linked list from mm/book2s32/tlb

2021-01-12 Thread Liam R. Howlett
Start using the maple tree Signed-off-by: Liam R. Howlett --- arch/powerpc/mm/book3s32/tlb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/mm/book3s32/tlb.c b/arch/powerpc/mm/book3s32/tlb.c index b6c7427daa6fe..be595b36dc4cd 100644 --- a/arch/powerpc/mm

[PATCH v2 35/70] arch/x86: Use maple tree iterators for vdso/vma

2021-01-12 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- arch/x86/entry/vdso/vma.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c index 9185cb1d13b9b..f531efb00ba35 100644 --- a/arch/x86/entry/vdso/vma.c +++ b/arch/x86/entry/vdso/vma.c

[PATCH v2 34/70] arch/um: Use maple tree iterators instead of linked list

2021-01-12 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- arch/um/kernel/tlb.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c index 61776790cd678..e40dd6deb1d21 100644 --- a/arch/um/kernel/tlb.c +++ b/arch/um/kernel/tlb.c @@ -590,21

[PATCH v2 69/70] mm: Remove vma linked list.

2021-01-12 Thread Liam R. Howlett
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() Signed-off-by: Liam R. Howlett --- include/linux/mm_types.h | 8 +- kernel/fork.c

[PATCH v2 50/70] kernel/sched/fair: Use maple tree iterators instead of linked list

2021-01-12 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- kernel/sched/fair.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index ae7ceba8fd4f2..1cb3a245ffd85 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -2723,6 +2723,7

[PATCH v2 60/70] mm/mprotect: Use maple tree navigation instead of vma linked list

2021-01-12 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- mm/mprotect.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mm/mprotect.c b/mm/mprotect.c index 56c02beb60414..a6208b872336e 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c @@ -518,6 +518,7 @@ static int do_mprotect_pkey(unsigned

[PATCH v2 59/70] mm/mlock: Use maple tree iterators instead of vma linked list

2021-01-12 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- mm/mlock.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mm/mlock.c b/mm/mlock.c index 884b1216da6a6..2c27597ebcf6b 100644 --- a/mm/mlock.c +++ b/mm/mlock.c @@ -591,6 +591,7 @@ static int apply_vma_lock_flags

[PATCH v2 67/70] mm/nommu: Stop inserting into the vma linked list

2021-01-12 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- mm/nommu.c | 4 1 file changed, 4 deletions(-) diff --git a/mm/nommu.c b/mm/nommu.c index 4e5cc63728b65..a3f97a612f16a 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -617,8 +617,6 @@ static void add_vma_to_mm(struct mm_struct *mm, struct vm_area_struct *vma

[PATCH v2 65/70] mm/pagewalk: Use vma_next() instead of vma linked list

2021-01-12 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- mm/pagewalk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/pagewalk.c b/mm/pagewalk.c index e81640d9f1770..20bd8d14d0425 100644 --- a/mm/pagewalk.c +++ b/mm/pagewalk.c @@ -408,7 +408,7 @@ int walk_page_range(struct mm_struct *mm

[PATCH v2 41/70] fs/coredump: Use maple tree iterators in place of linked list

2021-01-12 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- fs/coredump.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/fs/coredump.c b/fs/coredump.c index c6acfc694f658..a69f281a08afb 100644 --- a/fs/coredump.c +++ b/fs/coredump.c @@ -1040,10 +1040,10 @@ static unsigned long

[PATCH v2 64/70] mm/oom_kill: Use maple tree iterators instead of vma linked list

2021-01-12 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- mm/oom_kill.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 8b84661a64109..a5e2045ec2763 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -514,6 +514,7 @@ bool __oom_reap_task_mm(struct mm_struct *mm

[PATCH v2 61/70] mm/mremap: Use vma_next() instead of vma linked list

2021-01-12 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- mm/mremap.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mm/mremap.c b/mm/mremap.c index a7526a8c1fe5a..3b6e7f0324635 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -465,7 +465,7 @@ static unsigned long move_vma(struct vm_area_struct

[PATCH v2 53/70] mm/huge_memory: Use vma_next() instead of vma linked list

2021-01-12 Thread Liam R. Howlett
Signed-off-by: Liam R. Howlett --- mm/huge_memory.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index ec2bb93f74314..4005beb23daf9 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2304,12 +2304,12 @@ void

  1   2   >