Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
sched.c File Reference
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/slab.h>
#include <linux/mempool.h>
#include <linux/smp.h>
#include <linux/spinlock.h>
#include <linux/mutex.h>
#include <linux/freezer.h>
#include <linux/sunrpc/clnt.h>
#include "sunrpc.h"
#include <trace/events/sunrpc.h>

Go to the source code of this file.

Macros

#define CREATE_TRACE_POINTS
 
#define RPC_BUFFER_MAXSIZE   (2048)
 
#define RPC_BUFFER_POOLSIZE   (8)
 
#define RPC_TASK_POOLSIZE   (8)
 

Functions

void rpc_init_priority_wait_queue (struct rpc_wait_queue *queue, const char *qname)
 
 EXPORT_SYMBOL_GPL (rpc_init_priority_wait_queue)
 
void rpc_init_wait_queue (struct rpc_wait_queue *queue, const char *qname)
 
 EXPORT_SYMBOL_GPL (rpc_init_wait_queue)
 
void rpc_destroy_wait_queue (struct rpc_wait_queue *queue)
 
 EXPORT_SYMBOL_GPL (rpc_destroy_wait_queue)
 
int __rpc_wait_for_completion_task (struct rpc_task *task, int(*action)(void *))
 
 EXPORT_SYMBOL_GPL (__rpc_wait_for_completion_task)
 
void rpc_sleep_on (struct rpc_wait_queue *q, struct rpc_task *task, rpc_action action)
 
 EXPORT_SYMBOL_GPL (rpc_sleep_on)
 
void rpc_sleep_on_priority (struct rpc_wait_queue *q, struct rpc_task *task, rpc_action action, int priority)
 
int rpc_queue_empty (struct rpc_wait_queue *queue)
 
 EXPORT_SYMBOL_GPL (rpc_queue_empty)
 
void rpc_wake_up_queued_task (struct rpc_wait_queue *queue, struct rpc_task *task)
 
 EXPORT_SYMBOL_GPL (rpc_wake_up_queued_task)
 
struct rpc_taskrpc_wake_up_first (struct rpc_wait_queue *queue, bool(*func)(struct rpc_task *, void *), void *data)
 
 EXPORT_SYMBOL_GPL (rpc_wake_up_first)
 
struct rpc_taskrpc_wake_up_next (struct rpc_wait_queue *queue)
 
 EXPORT_SYMBOL_GPL (rpc_wake_up_next)
 
void rpc_wake_up (struct rpc_wait_queue *queue)
 
 EXPORT_SYMBOL_GPL (rpc_wake_up)
 
void rpc_wake_up_status (struct rpc_wait_queue *queue, int status)
 
 EXPORT_SYMBOL_GPL (rpc_wake_up_status)
 
void rpc_delay (struct rpc_task *task, unsigned long delay)
 
 EXPORT_SYMBOL_GPL (rpc_delay)
 
void rpc_prepare_task (struct rpc_task *task)
 
void rpc_exit_task (struct rpc_task *task)
 
void rpc_exit (struct rpc_task *task, int status)
 
 EXPORT_SYMBOL_GPL (rpc_exit)
 
void rpc_release_calldata (const struct rpc_call_ops *ops, void *calldata)
 
void rpc_execute (struct rpc_task *task)
 
voidrpc_malloc (struct rpc_task *task, size_t size)
 
 EXPORT_SYMBOL_GPL (rpc_malloc)
 
void rpc_free (void *buffer)
 
 EXPORT_SYMBOL_GPL (rpc_free)
 
struct rpc_taskrpc_new_task (const struct rpc_task_setup *setup_data)
 
void rpc_put_task (struct rpc_task *task)
 
 EXPORT_SYMBOL_GPL (rpc_put_task)
 
void rpc_put_task_async (struct rpc_task *task)
 
 EXPORT_SYMBOL_GPL (rpc_put_task_async)
 
int rpciod_up (void)
 
void rpciod_down (void)
 
void rpc_destroy_mempool (void)
 
int rpc_init_mempool (void)
 

Variables

struct workqueue_structrpciod_workqueue
 

Macro Definition Documentation

#define CREATE_TRACE_POINTS

Definition at line 31 of file sched.c.

#define RPC_BUFFER_MAXSIZE   (2048)

Definition at line 37 of file sched.c.

#define RPC_BUFFER_POOLSIZE   (8)

Definition at line 38 of file sched.c.

#define RPC_TASK_POOLSIZE   (8)

Definition at line 39 of file sched.c.

Function Documentation

int __rpc_wait_for_completion_task ( struct rpc_task task,
int(*)(void *)  action 
)

Definition at line 291 of file sched.c.

EXPORT_SYMBOL_GPL ( rpc_init_priority_wait_queue  )
EXPORT_SYMBOL_GPL ( rpc_init_wait_queue  )
EXPORT_SYMBOL_GPL ( rpc_destroy_wait_queue  )
EXPORT_SYMBOL_GPL ( __rpc_wait_for_completion_task  )
EXPORT_SYMBOL_GPL ( rpc_sleep_on  )
EXPORT_SYMBOL_GPL ( rpc_queue_empty  )
EXPORT_SYMBOL_GPL ( rpc_wake_up_queued_task  )
EXPORT_SYMBOL_GPL ( rpc_wake_up_first  )
EXPORT_SYMBOL_GPL ( rpc_wake_up_next  )
EXPORT_SYMBOL_GPL ( rpc_wake_up  )
EXPORT_SYMBOL_GPL ( rpc_wake_up_status  )
EXPORT_SYMBOL_GPL ( rpc_delay  )
EXPORT_SYMBOL_GPL ( rpc_exit  )
EXPORT_SYMBOL_GPL ( rpc_malloc  )
EXPORT_SYMBOL_GPL ( rpc_free  )
EXPORT_SYMBOL_GPL ( rpc_put_task  )
EXPORT_SYMBOL_GPL ( rpc_put_task_async  )
void rpc_delay ( struct rpc_task task,
unsigned long  delay 
)

Definition at line 620 of file sched.c.

void rpc_destroy_mempool ( void  )

Definition at line 1044 of file sched.c.

void rpc_destroy_wait_queue ( struct rpc_wait_queue queue)

Definition at line 226 of file sched.c.

void rpc_execute ( struct rpc_task task)

Definition at line 784 of file sched.c.

void rpc_exit ( struct rpc_task task,
int  status 
)

Definition at line 673 of file sched.c.

void rpc_exit_task ( struct rpc_task task)

Definition at line 659 of file sched.c.

void rpc_free ( void buffer)

rpc_free - free buffer allocated via rpc_malloc : buffer to free

Definition at line 844 of file sched.c.

int rpc_init_mempool ( void  )

Definition at line 1059 of file sched.c.

void rpc_init_priority_wait_queue ( struct rpc_wait_queue queue,
const char qname 
)

Definition at line 214 of file sched.c.

void rpc_init_wait_queue ( struct rpc_wait_queue queue,
const char qname 
)

Definition at line 220 of file sched.c.

void* rpc_malloc ( struct rpc_task task,
size_t  size 
)

rpc_malloc - allocate an RPC buffer : RPC task that will use this buffer : requested byte size

To prevent rpciod from hanging, this allocator never sleeps, returning NULL if the request cannot be serviced immediately. The caller can arrange to sleep in a way that is safe for rpciod.

Most requests are 'small' (under 2KiB) and can be serviced from a mempool, ensuring that NFS reads and writes can always proceed, and that there is good locality of reference for these buffers.

In order to avoid memory starvation triggering more writebacks of NFS requests, we avoid using GFP_KERNEL.

Definition at line 815 of file sched.c.

struct rpc_task* rpc_new_task ( const struct rpc_task_setup setup_data)
read

Definition at line 901 of file sched.c.

void rpc_prepare_task ( struct rpc_task task)

Definition at line 630 of file sched.c.

void rpc_put_task ( struct rpc_task task)

Definition at line 968 of file sched.c.

void rpc_put_task_async ( struct rpc_task task)

Definition at line 974 of file sched.c.

int rpc_queue_empty ( struct rpc_wait_queue queue)

Definition at line 410 of file sched.c.

void rpc_release_calldata ( const struct rpc_call_ops ops,
void calldata 
)

Definition at line 682 of file sched.c.

void rpc_sleep_on ( struct rpc_wait_queue q,
struct rpc_task task,
rpc_action  action 
)

Definition at line 342 of file sched.c.

void rpc_sleep_on_priority ( struct rpc_wait_queue q,
struct rpc_task task,
rpc_action  action,
int  priority 
)

Definition at line 357 of file sched.c.

void rpc_wake_up ( struct rpc_wait_queue queue)

rpc_wake_up - wake up all rpc_tasks : rpc_wait_queue on which the tasks are sleeping

Grabs queue->lock

Definition at line 536 of file sched.c.

struct rpc_task* rpc_wake_up_first ( struct rpc_wait_queue queue,
bool(*)(struct rpc_task *, void *)  func,
void data 
)
read

Definition at line 495 of file sched.c.

struct rpc_task* rpc_wake_up_next ( struct rpc_wait_queue queue)
read

Definition at line 524 of file sched.c.

void rpc_wake_up_queued_task ( struct rpc_wait_queue queue,
struct rpc_task task 
)

Definition at line 424 of file sched.c.

void rpc_wake_up_status ( struct rpc_wait_queue queue,
int  status 
)

rpc_wake_up_status - wake up all rpc_tasks and set their status value. : rpc_wait_queue on which the tasks are sleeping : status value to set

Grabs queue->lock

Definition at line 565 of file sched.c.

void rpciod_down ( void  )

Definition at line 1009 of file sched.c.

int rpciod_up ( void  )

Definition at line 1004 of file sched.c.

Variable Documentation

struct workqueue_struct* rpciod_workqueue

Definition at line 57 of file sched.c.