]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm: Update vma_iter_store() to use MAS_WARN_ON()
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Mon, 24 Apr 2023 20:18:41 +0000 (16:18 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Mon, 24 Apr 2023 20:20:42 +0000 (16:20 -0400)
MAS_WARN_ON() will provide more information on the maple state and can
be more useful for debugging.  Use this version of WARN_ON() in the
debugging code when storing to the tree.

Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
mm/internal.h

index 8d1a8bd00124756f7952164b09202e940c6ead92..76612a860e58e1280e9df600bdeccf4f5f035530 100644 (file)
@@ -1047,18 +1047,17 @@ static inline void vma_iter_store(struct vma_iterator *vmi,
 {
 
 #if defined(CONFIG_DEBUG_VM_MAPLE_TREE)
-       if (WARN_ON(vmi->mas.node != MAS_START && vmi->mas.index > vma->vm_start)) {
-               printk("%lu > %lu\n", vmi->mas.index, vma->vm_start);
-               printk("store of vma %lu-%lu", vma->vm_start, vma->vm_end);
-               printk("into slot    %lu-%lu", vmi->mas.index, vmi->mas.last);
-               vma_iter_dump_tree(vmi);
+       if (MAS_WARN_ON(&vmi->mas, vmi->mas.node != MAS_START &&
+                       vmi->mas.index > vma->vm_start)) {
+               printk("%lx > %lx\n", vmi->mas.index, vma->vm_start);
+               printk("store of vma %lx-%lx", vma->vm_start, vma->vm_end);
+               printk("into slot    %lx-%lx", vmi->mas.index, vmi->mas.last);
        }
-       if (WARN_ON(vmi->mas.node != MAS_START && vmi->mas.last <  vma->vm_start)) {
-               printk("%lu < %lu\n", vmi->mas.last, vma->vm_start);
-               printk("store of vma %lu-%lu", vma->vm_start, vma->vm_end);
-               printk("into slot    %lu-%lu", vmi->mas.index, vmi->mas.last);
-               mt_dump(vmi->mas.tree, mt_dump_hex);
-               vma_iter_dump_tree(vmi);
+       if (MAS_WARN_ON(&vmi->mas, vmi->mas.node != MAS_START &&
+                       vmi->mas.last <  vma->vm_start)) {
+               printk("%lx < %lx\n", vmi->mas.last, vma->vm_start);
+               printk("store of vma %lx-%lx", vma->vm_start, vma->vm_end);
+               printk("into slot    %lx-%lx", vmi->mas.index, vmi->mas.last);
        }
 #endif