Commit 91a71d61 authored by Daniel Jordan's avatar Daniel Jordan Committed by Herbert Xu

padata: remove cpumask change notifier

Since commit 63d35788 ("crypto: pcrypt - remove padata cpumask
notifier") this feature is unused, so get rid of it.
Signed-off-by: default avatarDaniel Jordan <daniel.m.jordan@oracle.com>
Cc: Eric Biggers <ebiggers@kernel.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Cc: linux-crypto@vger.kernel.org
Cc: linux-doc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 38228e88
...@@ -75,30 +75,6 @@ To simply add or remove one CPU from a certain cpumask the functions ...@@ -75,30 +75,6 @@ To simply add or remove one CPU from a certain cpumask the functions
padata_add_cpu/padata_remove_cpu are used. cpu specifies the CPU to add or padata_add_cpu/padata_remove_cpu are used. cpu specifies the CPU to add or
remove and mask is one of PADATA_CPU_SERIAL, PADATA_CPU_PARALLEL. remove and mask is one of PADATA_CPU_SERIAL, PADATA_CPU_PARALLEL.
If a user is interested in padata cpumask changes, he can register to
the padata cpumask change notifier::
int padata_register_cpumask_notifier(struct padata_instance *pinst,
struct notifier_block *nblock);
To unregister from that notifier::
int padata_unregister_cpumask_notifier(struct padata_instance *pinst,
struct notifier_block *nblock);
The padata cpumask change notifier notifies about changes of the usable
cpumasks, i.e. the subset of active CPUs in the user supplied cpumask.
Padata calls the notifier chain with::
blocking_notifier_call_chain(&pinst->cpumask_change_notifier,
notification_mask,
&pd_new->cpumask);
Here cpumask_change_notifier is registered notifier, notification_mask
is one of PADATA_CPU_SERIAL, PADATA_CPU_PARALLEL and cpumask is a pointer
to a struct padata_cpumask that contains the new cpumask information.
Actually submitting work to the padata instance requires the creation of a Actually submitting work to the padata instance requires the creation of a
padata_priv structure:: padata_priv structure::
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/notifier.h>
#include <linux/kobject.h> #include <linux/kobject.h>
#include <linux/cpu.h> #include <linux/cpu.h>
#include <crypto/pcrypt.h> #include <crypto/pcrypt.h>
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/notifier.h>
#include <linux/kobject.h> #include <linux/kobject.h>
#define PADATA_CPU_SERIAL 0x01 #define PADATA_CPU_SERIAL 0x01
...@@ -151,10 +150,6 @@ struct padata_shell { ...@@ -151,10 +150,6 @@ struct padata_shell {
* @pslist: List of padata_shell objects attached to this instance. * @pslist: List of padata_shell objects attached to this instance.
* @cpumask: User supplied cpumasks for parallel and serial works. * @cpumask: User supplied cpumasks for parallel and serial works.
* @rcpumask: Actual cpumasks based on user cpumask and cpu_online_mask. * @rcpumask: Actual cpumasks based on user cpumask and cpu_online_mask.
* @omask: Temporary storage used to compute the notification mask.
* @cpumask_change_notifier: Notifiers chain for user-defined notify
* callbacks that will be called when either @pcpu or @cbcpu
* or both cpumasks change.
* @kobj: padata instance kernel object. * @kobj: padata instance kernel object.
* @lock: padata instance lock. * @lock: padata instance lock.
* @flags: padata flags. * @flags: padata flags.
...@@ -166,8 +161,6 @@ struct padata_instance { ...@@ -166,8 +161,6 @@ struct padata_instance {
struct list_head pslist; struct list_head pslist;
struct padata_cpumask cpumask; struct padata_cpumask cpumask;
struct padata_cpumask rcpumask; struct padata_cpumask rcpumask;
cpumask_var_t omask;
struct blocking_notifier_head cpumask_change_notifier;
struct kobject kobj; struct kobject kobj;
struct mutex lock; struct mutex lock;
u8 flags; u8 flags;
...@@ -187,8 +180,4 @@ extern int padata_set_cpumask(struct padata_instance *pinst, int cpumask_type, ...@@ -187,8 +180,4 @@ extern int padata_set_cpumask(struct padata_instance *pinst, int cpumask_type,
cpumask_var_t cpumask); cpumask_var_t cpumask);
extern int padata_start(struct padata_instance *pinst); extern int padata_start(struct padata_instance *pinst);
extern void padata_stop(struct padata_instance *pinst); extern void padata_stop(struct padata_instance *pinst);
extern int padata_register_cpumask_notifier(struct padata_instance *pinst,
struct notifier_block *nblock);
extern int padata_unregister_cpumask_notifier(struct padata_instance *pinst,
struct notifier_block *nblock);
#endif #endif
...@@ -514,23 +514,16 @@ static int padata_replace_one(struct padata_shell *ps) ...@@ -514,23 +514,16 @@ static int padata_replace_one(struct padata_shell *ps)
static int padata_replace(struct padata_instance *pinst) static int padata_replace(struct padata_instance *pinst)
{ {
int notification_mask = 0;
struct padata_shell *ps; struct padata_shell *ps;
int err; int err;
pinst->flags |= PADATA_RESET; pinst->flags |= PADATA_RESET;
cpumask_copy(pinst->omask, pinst->rcpumask.pcpu);
cpumask_and(pinst->rcpumask.pcpu, pinst->cpumask.pcpu, cpumask_and(pinst->rcpumask.pcpu, pinst->cpumask.pcpu,
cpu_online_mask); cpu_online_mask);
if (!cpumask_equal(pinst->omask, pinst->rcpumask.pcpu))
notification_mask |= PADATA_CPU_PARALLEL;
cpumask_copy(pinst->omask, pinst->rcpumask.cbcpu);
cpumask_and(pinst->rcpumask.cbcpu, pinst->cpumask.cbcpu, cpumask_and(pinst->rcpumask.cbcpu, pinst->cpumask.cbcpu,
cpu_online_mask); cpu_online_mask);
if (!cpumask_equal(pinst->omask, pinst->rcpumask.cbcpu))
notification_mask |= PADATA_CPU_SERIAL;
list_for_each_entry(ps, &pinst->pslist, list) { list_for_each_entry(ps, &pinst->pslist, list) {
err = padata_replace_one(ps); err = padata_replace_one(ps);
...@@ -544,48 +537,11 @@ static int padata_replace(struct padata_instance *pinst) ...@@ -544,48 +537,11 @@ static int padata_replace(struct padata_instance *pinst)
if (atomic_dec_and_test(&ps->opd->refcnt)) if (atomic_dec_and_test(&ps->opd->refcnt))
padata_free_pd(ps->opd); padata_free_pd(ps->opd);
if (notification_mask)
blocking_notifier_call_chain(&pinst->cpumask_change_notifier,
notification_mask,
&pinst->cpumask);
pinst->flags &= ~PADATA_RESET; pinst->flags &= ~PADATA_RESET;
return err; return err;
} }
/**
* padata_register_cpumask_notifier - Registers a notifier that will be called
* if either pcpu or cbcpu or both cpumasks change.
*
* @pinst: A poineter to padata instance
* @nblock: A pointer to notifier block.
*/
int padata_register_cpumask_notifier(struct padata_instance *pinst,
struct notifier_block *nblock)
{
return blocking_notifier_chain_register(&pinst->cpumask_change_notifier,
nblock);
}
EXPORT_SYMBOL(padata_register_cpumask_notifier);
/**
* padata_unregister_cpumask_notifier - Unregisters cpumask notifier
* registered earlier using padata_register_cpumask_notifier
*
* @pinst: A pointer to data instance.
* @nlock: A pointer to notifier block.
*/
int padata_unregister_cpumask_notifier(struct padata_instance *pinst,
struct notifier_block *nblock)
{
return blocking_notifier_chain_unregister(
&pinst->cpumask_change_notifier,
nblock);
}
EXPORT_SYMBOL(padata_unregister_cpumask_notifier);
/* If cpumask contains no active cpu, we mark the instance as invalid. */ /* If cpumask contains no active cpu, we mark the instance as invalid. */
static bool padata_validate_cpumask(struct padata_instance *pinst, static bool padata_validate_cpumask(struct padata_instance *pinst,
const struct cpumask *cpumask) const struct cpumask *cpumask)
...@@ -785,7 +741,6 @@ static void __padata_free(struct padata_instance *pinst) ...@@ -785,7 +741,6 @@ static void __padata_free(struct padata_instance *pinst)
WARN_ON(!list_empty(&pinst->pslist)); WARN_ON(!list_empty(&pinst->pslist));
padata_stop(pinst); padata_stop(pinst);
free_cpumask_var(pinst->omask);
free_cpumask_var(pinst->rcpumask.cbcpu); free_cpumask_var(pinst->rcpumask.cbcpu);
free_cpumask_var(pinst->rcpumask.pcpu); free_cpumask_var(pinst->rcpumask.pcpu);
free_cpumask_var(pinst->cpumask.pcpu); free_cpumask_var(pinst->cpumask.pcpu);
...@@ -965,8 +920,6 @@ static struct padata_instance *padata_alloc(const char *name, ...@@ -965,8 +920,6 @@ static struct padata_instance *padata_alloc(const char *name,
goto err_free_masks; goto err_free_masks;
if (!alloc_cpumask_var(&pinst->rcpumask.cbcpu, GFP_KERNEL)) if (!alloc_cpumask_var(&pinst->rcpumask.cbcpu, GFP_KERNEL))
goto err_free_rcpumask_pcpu; goto err_free_rcpumask_pcpu;
if (!alloc_cpumask_var(&pinst->omask, GFP_KERNEL))
goto err_free_rcpumask_cbcpu;
INIT_LIST_HEAD(&pinst->pslist); INIT_LIST_HEAD(&pinst->pslist);
...@@ -976,11 +929,10 @@ static struct padata_instance *padata_alloc(const char *name, ...@@ -976,11 +929,10 @@ static struct padata_instance *padata_alloc(const char *name,
cpumask_and(pinst->rcpumask.cbcpu, cbcpumask, cpu_online_mask); cpumask_and(pinst->rcpumask.cbcpu, cbcpumask, cpu_online_mask);
if (padata_setup_cpumasks(pinst)) if (padata_setup_cpumasks(pinst))
goto err_free_omask; goto err_free_rcpumask_cbcpu;
pinst->flags = 0; pinst->flags = 0;
BLOCKING_INIT_NOTIFIER_HEAD(&pinst->cpumask_change_notifier);
kobject_init(&pinst->kobj, &padata_attr_type); kobject_init(&pinst->kobj, &padata_attr_type);
mutex_init(&pinst->lock); mutex_init(&pinst->lock);
...@@ -994,8 +946,6 @@ static struct padata_instance *padata_alloc(const char *name, ...@@ -994,8 +946,6 @@ static struct padata_instance *padata_alloc(const char *name,
return pinst; return pinst;
err_free_omask:
free_cpumask_var(pinst->omask);
err_free_rcpumask_cbcpu: err_free_rcpumask_cbcpu:
free_cpumask_var(pinst->rcpumask.cbcpu); free_cpumask_var(pinst->rcpumask.cbcpu);
err_free_rcpumask_pcpu: err_free_rcpumask_pcpu:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment