Re: [PATCH] slab: ensure cache_alloc_refill terminates

2007-02-21 Thread Christoph Lameter
On Wed, 21 Feb 2007, Pekka Enberg wrote: > ...and batchcount is not decremented and we're effectively in an > infinite loop. Or am I missing something here? No you are right. Acked-by: Christoph Lameter <[EMAIL PROTECTED]> - To unsubscribe from this list: send the line "unsubscribe

Re: [PATCH] slab: ensure cache_alloc_refill terminates

2007-02-21 Thread Pekka Enberg
On Wed, 21 Feb 2007, Pekka J Enberg wrote: > + */ > + BUG_ON(slabp->inuse < 0 || slabp->inuse >= cachep->num); > + > while (slabp->inuse < cachep->num && batchcount--) { On 2/21/07, Christoph Lameter <[EMAIL PROTECTED]> wrote: I think you only need to

Re: [PATCH] slab: ensure cache_alloc_refill terminates

2007-02-21 Thread Christoph Lameter
On Wed, 21 Feb 2007, Pekka J Enberg wrote: > + */ > + BUG_ON(slabp->inuse < 0 || slabp->inuse >= cachep->num); > + > while (slabp->inuse < cachep->num && batchcount--) { I think you only need to check for <0. If slabp->inuse > cachep->num then the loop

Re: [PATCH] slab: ensure cache_alloc_refill terminates

2007-02-21 Thread Christoph Lameter
On Wed, 21 Feb 2007, Pekka J Enberg wrote: + */ + BUG_ON(slabp-inuse 0 || slabp-inuse = cachep-num); + while (slabp-inuse cachep-num batchcount--) { I think you only need to check for 0. If slabp-inuse cachep-num then the loop will not be taken. -

Re: [PATCH] slab: ensure cache_alloc_refill terminates

2007-02-21 Thread Pekka Enberg
On Wed, 21 Feb 2007, Pekka J Enberg wrote: + */ + BUG_ON(slabp-inuse 0 || slabp-inuse = cachep-num); + while (slabp-inuse cachep-num batchcount--) { On 2/21/07, Christoph Lameter [EMAIL PROTECTED] wrote: I think you only need to check for 0. If

Re: [PATCH] slab: ensure cache_alloc_refill terminates

2007-02-21 Thread Christoph Lameter
On Wed, 21 Feb 2007, Pekka Enberg wrote: ...and batchcount is not decremented and we're effectively in an infinite loop. Or am I missing something here? No you are right. Acked-by: Christoph Lameter [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe linux-kernel in

Re: [PATCH] slab: ensure cache_alloc_refill terminates

2007-02-19 Thread Christoph Lameter
On Mon, 19 Feb 2007, Pekka J Enberg wrote: > If slab->inuse is corrupted, cache_alloc_refill can enter an infinite > loop as detailed by Michael Richardson in the following post: > . We have seen that corruption too. >

Re: [PATCH] slab: ensure cache_alloc_refill terminates

2007-02-19 Thread Pekka J Enberg
On Mon, 19 Feb 2007, KAMEZAWA Hiroyuki wrote: > From my experience, this infinite loop in cache_alloc_refill() is caused by > double-free, always...(I'm sorry if my knowledge around the slab is too old.) Well, I don't know what exactly caused slabp->inuse (could be cachep->num too, although

Re: [PATCH] slab: ensure cache_alloc_refill terminates

2007-02-19 Thread KAMEZAWA Hiroyuki
On Mon, 19 Feb 2007 10:22:52 +0200 (EET) Pekka J Enberg <[EMAIL PROTECTED]> wrote: > @@ -2987,6 +2987,14 @@ > slabp = list_entry(entry, struct slab, list); > check_slabp(cachep, slabp); > check_spinlock_acquired(cachep); > + > + /* > +

Re: [PATCH] slab: ensure cache_alloc_refill terminates

2007-02-19 Thread KAMEZAWA Hiroyuki
On Mon, 19 Feb 2007 10:22:52 +0200 (EET) Pekka J Enberg [EMAIL PROTECTED] wrote: @@ -2987,6 +2987,14 @@ slabp = list_entry(entry, struct slab, list); check_slabp(cachep, slabp); check_spinlock_acquired(cachep); + + /* + *

Re: [PATCH] slab: ensure cache_alloc_refill terminates

2007-02-19 Thread Pekka J Enberg
On Mon, 19 Feb 2007, KAMEZAWA Hiroyuki wrote: From my experience, this infinite loop in cache_alloc_refill() is caused by double-free, always...(I'm sorry if my knowledge around the slab is too old.) Well, I don't know what exactly caused slabp-inuse (could be cachep-num too, although sounds

Re: [PATCH] slab: ensure cache_alloc_refill terminates

2007-02-19 Thread Christoph Lameter
On Mon, 19 Feb 2007, Pekka J Enberg wrote: If slab-inuse is corrupted, cache_alloc_refill can enter an infinite loop as detailed by Michael Richardson in the following post: http://lkml.org/lkml/2007/2/16/292. We have seen that corruption too. check_spinlock_acquired(cachep);