[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100429160644.4dee414d.akpm@linux-foundation.org>
Date: Thu, 29 Apr 2010 16:06:44 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Steffen Klassert <steffen.klassert@...unet.com>
Cc: Herbert Xu <herbert@...dor.hengli.com.au>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 6/8] padata: Use a timer to handle the reorder queues
On Thu, 29 Apr 2010 14:43:37 +0200
Steffen Klassert <steffen.klassert@...unet.com> wrote:
> padata_get_next had a bogus check that returned always true,
> so the try_again loop in padata_reorder was never taken.
A better changelog would have told us what this "bogus check" _is_.
> This can lead to object leaks in some rare cases.
And a better changelog would describe those leaks!
> This patch
> implements a timer that processes the reorder queues if noone
> else does it in appropriate time.
Under what circumstances would "noone else do it in appropriate time"?
Would that be a bug, or what?
> @@ -273,13 +274,22 @@ try_again:
>
> spin_unlock_bh(&pd->lock);
>
> - if (atomic_read(&pd->reorder_objects))
> - goto try_again;
> + if (atomic_read(&pd->reorder_objects)
> + && !(pinst->flags & PADATA_RESET))
> + mod_timer(&pd->timer, jiffies + HZ);
> + else
> + del_timer(&pd->timer);
>
> -out:
> return;
> }
I'd feel more comfortable if the above was in the locked region. Is
there a race whereby another CPU can set pd->reorder_objects, but we
forgot to arm the timer?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists