Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 204346
b: refs/heads/master
c: ee83655
h: refs/heads/master
v: v3
  • Loading branch information
Steffen Klassert authored and Herbert Xu committed Jul 14, 2010
1 parent 029872c commit cc690ce
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4c879170296174bde05cd1c643dac16594edee77
refs/heads/master: ee836555120140f770005b8ce6673c913d1b9a98
24 changes: 16 additions & 8 deletions trunk/kernel/padata.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,20 @@ static void __padata_start(struct padata_instance *pinst)
pinst->flags |= PADATA_INIT;
}

static void __padata_stop(struct padata_instance *pinst)
{
if (!(pinst->flags & PADATA_INIT))
return;

pinst->flags &= ~PADATA_INIT;

synchronize_rcu();

get_online_cpus();
padata_flush_queues(pinst->pd);
put_online_cpus();
}

/* Replace the internal control stucture with a new one. */
static void padata_replace(struct padata_instance *pinst,
struct parallel_data *pd_new)
Expand Down Expand Up @@ -649,7 +663,7 @@ EXPORT_SYMBOL(padata_start);
void padata_stop(struct padata_instance *pinst)
{
mutex_lock(&pinst->lock);
pinst->flags &= ~PADATA_INIT;
__padata_stop(pinst);
mutex_unlock(&pinst->lock);
}
EXPORT_SYMBOL(padata_stop);
Expand Down Expand Up @@ -770,17 +784,11 @@ EXPORT_SYMBOL(padata_alloc);
*/
void padata_free(struct padata_instance *pinst)
{
padata_stop(pinst);

synchronize_rcu();

#ifdef CONFIG_HOTPLUG_CPU
unregister_hotcpu_notifier(&pinst->cpu_notifier);
#endif
get_online_cpus();
padata_flush_queues(pinst->pd);
put_online_cpus();

padata_stop(pinst);
padata_free_pd(pinst->pd);
free_cpumask_var(pinst->cpumask);
kfree(pinst);
Expand Down

0 comments on commit cc690ce

Please sign in to comment.