lkml.org 
[lkml]   [2010]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 7/8] padata: Flush the padata queues actively
On Thu, 29 Apr 2010 14:44:26 +0200
Steffen Klassert <steffen.klassert@secunet.com> wrote:

> +static void padata_flush_queues(struct parallel_data *pd)
> +{
> + int cpu;
> + struct padata_queue *queue;
> +
> + for_each_cpu(cpu, pd->cpumask) {
> + queue = per_cpu_ptr(pd->queue, cpu);
> + flush_work(&queue->pwork);
> + }
> +
> + del_timer_sync(&pd->timer);
> +
> + if (atomic_read(&pd->reorder_objects))
> + padata_reorder(pd);

padata_reorder() can fail to do anything, if someone else is holding
pd->lock. What happens then?


> + for_each_cpu(cpu, pd->cpumask) {
> + queue = per_cpu_ptr(pd->queue, cpu);
> + flush_work(&queue->swork);
> + }
> + BUG_ON(atomic_read(&pd->refcnt) != 0);
> +}

Are we safe against cpu hot-unplug in this code?


\
 
 \ /
  Last update: 2010-04-30 20:57    [from the cache]
©2003-2011 Jasper Spaans