|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v3] xmalloc: add support for checking the pool integrity
>>> On 10.12.14 at 13:13, <mdontu@xxxxxxxxxxxxxxx> wrote:
> +#define xmem_pool_check_locked(pool) __xmem_pool_check_locked(__FILE__,
> __LINE__, pool)
> +static bool_t __xmem_pool_check_locked(const char *file, int line, const
> struct xmem_pool *pool)
Long lines.
> +{
> + int i;
unsigned int
> + static bool_t once = 1;
> +
> + if ( !once )
> + goto out;
> + for ( i = 0; i < REAL_FLI; i++ )
> + {
> + int fl = (pool->fl_bitmap & (1 << i)) ? i : -1;
> +
> + if ( fl >= 0 )
> + {
> + int j;
unsigned int
> +
> + if ( !pool->sl_bitmap[fl] )
> + {
> + printk(XENLOG_ERR
> + "xmem_pool: %s: the TLSF bitmap is corrupted
> (non-empty FL with empty SL)\n",
For the sake of brevity: "...: TLSF bitmap corrupt (...)\n" (please follow
advice given - as for an earlier message - throughout a patch).
> + pool->name);
> + __warn(file, line);
> + once = 0;
> + break;
> + }
> + for ( j = 0; j < MAX_SLI; j++ )
> + {
> + int sl = (pool->sl_bitmap[fl] & (1 << j)) ? j : -1;
> +
> + if ( sl < 0 )
> + continue;
> + if ( !pool->matrix[fl][sl] )
> + {
> + printk(XENLOG_ERR
> + "xmem_pool: %s: the TLSF bitmap is corrupted
> (matrix[%d][%d] is NULL)\n",
> + pool->name, fl, sl);
> + __warn(file, line);
> + once = 0;
> + break;
> + }
> + if ( !xmem_pool_check_size(pool, fl, sl) )
> + {
> + printk(XENLOG_ERR "xmem_pool: %s: the TLSF chunk matrix
> is corrupted\n",
> + pool->name);
> + __warn(file, line);
> + once = 0;
> + break;
> + }
> + }
> + if ( !once )
> + break;
> + }
> + }
> +out:
Label should be indented by one space; whether a label is warranted
here is questionable though.
I thought I gave all these comments on v2 already, but it looks like
I accidentally lost them while reducing quoted text.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |