Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
padata.h File Reference
#include <linux/workqueue.h>
#include <linux/spinlock.h>
#include <linux/list.h>
#include <linux/timer.h>
#include <linux/notifier.h>
#include <linux/kobject.h>

Go to the source code of this file.

Data Structures

struct  padata_priv
 
struct  padata_list
 
struct  padata_serial_queue
 
struct  padata_parallel_queue
 
struct  padata_cpumask
 
struct  parallel_data
 
struct  padata_instance
 

Macros

#define PADATA_CPU_SERIAL   0x01
 
#define PADATA_CPU_PARALLEL   0x02
 
#define PADATA_INIT   1
 
#define PADATA_RESET   2
 
#define PADATA_INVALID   4
 

Functions

struct padata_instancepadata_alloc_possible (struct workqueue_struct *wq)
 
struct padata_instancepadata_alloc (struct workqueue_struct *wq, const struct cpumask *pcpumask, const struct cpumask *cbcpumask)
 
void padata_free (struct padata_instance *pinst)
 
int padata_do_parallel (struct padata_instance *pinst, struct padata_priv *padata, int cb_cpu)
 
void padata_do_serial (struct padata_priv *padata)
 
int padata_set_cpumask (struct padata_instance *pinst, int cpumask_type, cpumask_var_t cpumask)
 
int padata_set_cpumasks (struct padata_instance *pinst, cpumask_var_t pcpumask, cpumask_var_t cbcpumask)
 
int padata_add_cpu (struct padata_instance *pinst, int cpu, int mask)
 
int padata_remove_cpu (struct padata_instance *pinst, int cpu, int mask)
 
int padata_start (struct padata_instance *pinst)
 
void padata_stop (struct padata_instance *pinst)
 
int padata_register_cpumask_notifier (struct padata_instance *pinst, struct notifier_block *nblock)
 
int padata_unregister_cpumask_notifier (struct padata_instance *pinst, struct notifier_block *nblock)
 

Macro Definition Documentation

#define PADATA_CPU_PARALLEL   0x02

Definition at line 32 of file padata.h.

#define PADATA_CPU_SERIAL   0x01

Definition at line 31 of file padata.h.

#define PADATA_INIT   1

Definition at line 163 of file padata.h.

#define PADATA_INVALID   4

Definition at line 165 of file padata.h.

#define PADATA_RESET   2

Definition at line 164 of file padata.h.

Function Documentation

int padata_add_cpu ( struct padata_instance pinst,
int  cpu,
int  mask 
)

padata_add_cpu - add a cpu to one or both(parallel and serial) padata cpumasks.

: padata instance : cpu to add : bitmask of flags specifying to which cpumask shuld be added. The may be any combination of the following flags: PADATA_CPU_SERIAL - serial cpumask PADATA_CPU_PARALLEL - parallel cpumask

Definition at line 711 of file padata.c.

struct padata_instance* padata_alloc ( struct workqueue_struct wq,
const struct cpumask pcpumask,
const struct cpumask cbcpumask 
)
read

padata_alloc - allocate and initialize a padata instance and specify cpumasks for serial and parallel workers.

: workqueue to use for the allocated padata instance : cpumask that will be used for padata parallelization : cpumask that will be used for padata serialization

Definition at line 1055 of file padata.c.

struct padata_instance* padata_alloc_possible ( struct workqueue_struct wq)
read

padata_alloc_possible - Allocate and initialize padata instance. Use the cpu_possible_mask for serial and parallel workers.

: workqueue to use for the allocated padata instance

Definition at line 1041 of file padata.c.

int padata_do_parallel ( struct padata_instance pinst,
struct padata_priv padata,
int  cb_cpu 
)

padata_do_parallel - padata parallelization function

: padata instance : object to be parallelized : cpu the serialization callback function will run on, must be in the serial cpumask of padata(i.e. cpumask.cbcpu).

The parallelization callback function will run with BHs off. Note: Every object which is parallelized by padata_do_parallel must be seen by padata_do_serial.

Definition at line 107 of file padata.c.

void padata_do_serial ( struct padata_priv padata)

padata_do_serial - padata serialization function

: object to be serialized.

padata_do_serial must be called for every parallelized object. The serialization callback function will run with BHs off.

Definition at line 330 of file padata.c.

void padata_free ( struct padata_instance pinst)

padata_free - free a padata instance

: padata instance to free

Definition at line 1120 of file padata.c.

int padata_register_cpumask_notifier ( struct padata_instance pinst,
struct notifier_block nblock 
)

padata_register_cpumask_notifier - Registers a notifier that will be called if either pcpu or cbcpu or both cpumasks change.

: A poineter to padata instance : A pointer to notifier block.

Definition at line 540 of file padata.c.

int padata_remove_cpu ( struct padata_instance pinst,
int  cpu,
int  mask 
)

padata_remove_cpu - remove a cpu from the one or both(serial and parallel) padata cpumasks.

: padata instance : cpu to remove : bitmask specifying from which cpumask should be removed The may be any combination of the following flags: PADATA_CPU_SERIAL - serial cpumask PADATA_CPU_PARALLEL - parallel cpumask

Definition at line 770 of file padata.c.

int padata_set_cpumask ( struct padata_instance pinst,
int  cpumask_type,
cpumask_var_t  cpumask 
)

padata_set_cpumask: Sets specified by cpumask to the value equivalent to .

: padata instance : PADATA_CPU_SERIAL or PADATA_CPU_PARALLEL corresponding to parallel and serial cpumasks respectively. : the cpumask to use

Definition at line 647 of file padata.c.

int padata_set_cpumasks ( struct padata_instance pinst,
cpumask_var_t  pcpumask,
cpumask_var_t  cbcpumask 
)

padata_set_cpumasks - Set both parallel and serial cpumasks. The first one is used by parallel workers and the second one by the wokers doing serialization.

: padata instance : the cpumask to use for parallel workers : the cpumsak to use for serial workers

Definition at line 620 of file padata.c.

int padata_start ( struct padata_instance pinst)

padata_start - start the parallel processing

: padata instance to start

Definition at line 799 of file padata.c.

void padata_stop ( struct padata_instance pinst)

padata_stop - stop the parallel processing

: padata instance to stop

Definition at line 821 of file padata.c.

int padata_unregister_cpumask_notifier ( struct padata_instance pinst,
struct notifier_block nblock 
)

padata_unregister_cpumask_notifier - Unregisters cpumask notifier registered earlier using padata_register_cpumask_notifier

: A pointer to data instance. : A pointer to notifier block.

Definition at line 555 of file padata.c.