]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm: Clean up modifications
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Thu, 19 Nov 2020 17:15:05 +0000 (12:15 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 5 Jan 2021 17:31:26 +0000 (12:31 -0500)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
include/linux/mm.h
include/linux/mmdebug.h
include/linux/radix-tree.h
include/linux/xarray.h
mm/mmap.c

index 110aa7524e4b477016be4f63b242ef59767a3410..996353a0575004b429c1fc330dbfac41a8c24898 100644 (file)
@@ -2588,11 +2588,11 @@ static inline void mm_populate(unsigned long addr, unsigned long len)
        (void) __mm_populate(addr, len, 1);
 }
 extern void mm_populate_vma(struct vm_area_struct *vma, unsigned long start,
-               unsigned long end);
+                           unsigned long end);
 #else
 static inline void mm_populate(unsigned long addr, unsigned long len) {}
-extern void mm_populate_vma(struct vm_area_struct *vma, unsigned long start,
-               unsigned long end) {}
+void mm_populate_vma(struct vm_area_struct *vma, unsigned long start,
+                    unsigned long end) {}
 #endif
 
 /* These take the mm semaphore themselves */
@@ -2651,9 +2651,8 @@ extern struct vm_area_struct * find_vma_prev(struct mm_struct * mm, unsigned lon
 
 /* Look up the first VMA which intersects the interval start_addr..end_addr-1,
    NULL if none.  Assume start_addr < end_addr. */
-extern struct vm_area_struct * find_vma_intersection(struct mm_struct * mm,
-                                                    unsigned long start_addr,
-                                                    unsigned long end_addr);
+extern struct vm_area_struct *find_vma_intersection(struct mm_struct *mm,
+                    unsigned long start_addr, unsigned long end_addr);
 
 static inline unsigned long vm_start_gap(struct vm_area_struct *vma)
 {
index 9d5852b07002d08cf0d55c473d390060b2d35f1b..2ad72d2c8cc528a2103556eeadd657389f5ece35 100644 (file)
@@ -13,7 +13,7 @@ extern void dump_page(struct page *page, const char *reason);
 extern void __dump_page(struct page *page, const char *reason);
 void dump_vma(const struct vm_area_struct *vma);
 void dump_mm(const struct mm_struct *mm);
-#define CONFIG_DEBUG_VM 1
+
 #ifdef CONFIG_DEBUG_VM
 #define VM_BUG_ON(cond) BUG_ON(cond)
 #define VM_BUG_ON_PAGE(cond, page)                                     \
index 42b8fa3137d87b99e53f36c30930f6ed4e8b5f81..64ad900ac74224eeff8012d8493460078cedb25d 100644 (file)
 #include <linux/bitops.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
-#include <linux/local_lock.h>
 #include <linux/percpu.h>
 #include <linux/preempt.h>
 #include <linux/rcupdate.h>
 #include <linux/spinlock.h>
 #include <linux/types.h>
 #include <linux/xarray.h>
+#include <linux/local_lock.h>
 
 /* Keep unconverted code working */
 #define radix_tree_root                xarray
index 4e8a2f5c5d7e65fd23d0a62e4c306c3e223d2b4a..92c0160b3352314fa2d5dbdff241cf24f3706ecf 100644 (file)
@@ -169,7 +169,7 @@ static inline bool xa_is_internal(const void *entry)
        return ((unsigned long)entry & 3) == 2;
 }
 
-#define XA_ZERO_ENTRY          xa_mk_internal(259)
+#define XA_ZERO_ENTRY          xa_mk_internal(257)
 
 /**
  * xa_is_zero() - Is the entry a zero entry?
@@ -1261,32 +1261,6 @@ static inline bool xa_is_retry(const void *entry)
        return unlikely(entry == XA_RETRY_ENTRY);
 }
 
-#define XA_SKIP_ENTRY           xa_mk_internal(257)
-
-/**
- * xa_is_skip() - Is the entry a skip entry?
- * @entry: Entry retrieved from the XArray
- *
- * Return: %true if the entry is a skip entry.
- */
-static inline bool xa_is_skip(const void *entry)
-{
-       return unlikely(entry == XA_SKIP_ENTRY);
-}
-
-#define XA_DELETED_ENTRY           xa_mk_internal(258)
-
-/**
- * xa_is_deleted() - has the entry been deleted?
- * @entry: Entry retrieved from the XArray
- *
- * Return: %true if the entry has been deleted.
- */
-static inline bool xa_is_deleted(const void *entry)
-{
-       return unlikely(entry == XA_DELETED_ENTRY);
-}
-
 /**
  * xa_is_advanced() - Is the entry only permitted for the advanced API?
  * @entry: Entry to be stored in the XArray.
@@ -1295,7 +1269,7 @@ static inline bool xa_is_deleted(const void *entry)
  */
 static inline bool xa_is_advanced(const void *entry)
 {
-       return xa_is_internal(entry) && (entry < XA_ZERO_ENTRY);
+       return xa_is_internal(entry) && (entry <= XA_RETRY_ENTRY);
 }
 
 /**
index 6bbade6232eba5e6ef41cab9ecc1b8c45c76a0fc..6570953f25e8046493047b2a8802d36a9cbeb28f 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -273,9 +273,9 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
                goto out;
 
        /* Ok, looks good - let it rip. */
-       if (do_brk_flags(&mas, &brkvma, oldbrk, newbrk-oldbrk, 0) < 0) {
+       if (do_brk_flags(&mas, &brkvma, oldbrk, newbrk-oldbrk, 0) < 0)
                goto out;
-       }
+
        mm->brk = brk;
 
 success:
@@ -893,12 +893,8 @@ again:
 
        vma->vm_pgoff = pgoff;
        if (adjust_next) {
-               // maple tree erase is unnecessary as the adjusting of the vma
-               // would have overwritten the area.
                next->vm_start += adjust_next;
                next->vm_pgoff += adjust_next >> PAGE_SHIFT;
-               // the vma_store is necessary as the adjust_next may be
-               // negative and expand backwards.
                vma_mt_store(mm, next);
        }
 
@@ -3061,7 +3057,7 @@ static int do_brk_flags(struct ma_state *mas, struct vm_area_struct **brkvma,
        if (brkvma) {
                vma = *brkvma;
                /* Fast path, expand the existing vma if possible */
-               if (vma && ((vma->vm_flags & ~VM_SOFTDIRTY) == flags)){
+               if (vma && ((vma->vm_flags & ~VM_SOFTDIRTY) == flags)) {
                        vma->vm_end = addr + len;
                        mas->index = vma->vm_start;
                        mas->last = vma->vm_end - 1;