Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196723
b: refs/heads/master
c: e2cb2f1
h: refs/heads/master
i:
  196721: 050f6fc
  196719: 4852624
v: v3
  • Loading branch information
Steffen Klassert authored and Herbert Xu committed May 3, 2010
1 parent d3106b7 commit ab1dbe4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 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: df2071bd081408318d659cd14a9cf6ff23d874c9
refs/heads/master: e2cb2f1c2ccf19914e941859c07558ba5f8a4610
13 changes: 7 additions & 6 deletions trunk/kernel/padata.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ void padata_stop(struct padata_instance *pinst)
}
EXPORT_SYMBOL(padata_stop);

#ifdef CONFIG_HOTPLUG_CPU
static int padata_cpu_callback(struct notifier_block *nfb,
unsigned long action, void *hcpu)
{
Expand Down Expand Up @@ -621,6 +622,7 @@ static int padata_cpu_callback(struct notifier_block *nfb,

return NOTIFY_OK;
}
#endif

/*
* padata_alloc - allocate and initialize a padata instance
Expand All @@ -631,7 +633,6 @@ static int padata_cpu_callback(struct notifier_block *nfb,
struct padata_instance *padata_alloc(const struct cpumask *cpumask,
struct workqueue_struct *wq)
{
int err;
struct padata_instance *pinst;
struct parallel_data *pd;

Expand All @@ -654,18 +655,16 @@ struct padata_instance *padata_alloc(const struct cpumask *cpumask,

pinst->flags = 0;

#ifdef CONFIG_HOTPLUG_CPU
pinst->cpu_notifier.notifier_call = padata_cpu_callback;
pinst->cpu_notifier.priority = 0;
err = register_hotcpu_notifier(&pinst->cpu_notifier);
if (err)
goto err_free_cpumask;
register_hotcpu_notifier(&pinst->cpu_notifier);
#endif

mutex_init(&pinst->lock);

return pinst;

err_free_cpumask:
free_cpumask_var(pinst->cpumask);
err_free_pd:
padata_free_pd(pd);
err_free_inst:
Expand All @@ -689,7 +688,9 @@ void padata_free(struct padata_instance *pinst)
while (atomic_read(&pinst->pd->refcnt) != 0)
yield();

#ifdef CONFIG_HOTPLUG_CPU
unregister_hotcpu_notifier(&pinst->cpu_notifier);
#endif
padata_free_pd(pinst->pd);
free_cpumask_var(pinst->cpumask);
kfree(pinst);
Expand Down

0 comments on commit ab1dbe4

Please sign in to comment.