lkml.org 
[lkml]   [2019]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RESEND PATCH 2/3] mm/vmap: add DEBUG_AUGMENT_PROPAGATE_CHECK macro
> > +#if DEBUG_AUGMENT_PROPAGATE_CHECK
> > +static void
> > +augment_tree_propagate_do_check(struct rb_node *n)
> > +{
> > + struct vmap_area *va;
> > + struct rb_node *node;
> > + unsigned long size;
> > + bool found = false;
> > +
> > + if (n == NULL)
> > + return;
> > +
> > + va = rb_entry(n, struct vmap_area, rb_node);
> > + size = va->subtree_max_size;
> > + node = n;
> > +
> > + while (node) {
> > + va = rb_entry(node, struct vmap_area, rb_node);
> > +
> > + if (get_subtree_max_size(node->rb_left) == size) {
> > + node = node->rb_left;
> > + } else {
> > + if (__va_size(va) == size) {
> > + found = true;
> > + break;
> > + }
> > +
> > + node = node->rb_right;
> > + }
> > + }
> > +
> > + if (!found) {
> > + va = rb_entry(n, struct vmap_area, rb_node);
> > + pr_emerg("tree is corrupted: %lu, %lu\n",
> > + __va_size(va), va->subtree_max_size);
> > + }
> > +
> > + augment_tree_propagate_do_check(n->rb_left);
> > + augment_tree_propagate_do_check(n->rb_right);
> > +}
> > +
> > +static void augment_tree_propagate_from_check(void)
>
> Why do you need this intermediate function?
>
> Other than that looks good to me, please free to use
> Reviewed-by: Roman Gushchin <guro@fb.com>
>
Will remove, we do not need that extra wrapper.

--
Vlad Rezki

\
 
 \ /
  Last update: 2019-04-04 17:53    [W:0.040 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site