Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
sched.c File Reference
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/completion.h>
#include <linux/vmalloc.h>
#include <linux/smp.h>
#include <linux/stddef.h>
#include <linux/unistd.h>
#include <linux/numa.h>
#include <linux/mutex.h>
#include <linux/notifier.h>
#include <linux/kthread.h>
#include <linux/pid_namespace.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <asm/io.h>
#include <asm/mmu_context.h>
#include <asm/spu.h>
#include <asm/spu_csa.h>
#include <asm/spu_priv1.h>
#include "spufs.h"
#include "sputrace.h"

Go to the source code of this file.

Data Structures

struct  spu_prio_array
 

Macros

#define CREATE_TRACE_POINTS
 
#define NORMAL_PRIO   120
 
#define SPUSCHED_TICK   (10)
 
#define MIN_SPU_TIMESLICE   max(5 * HZ / (1000 * SPUSCHED_TICK), 1)
 
#define DEF_SPU_TIMESLICE   (100 * HZ / (1000 * SPUSCHED_TICK))
 
#define MAX_USER_PRIO   (MAX_PRIO - MAX_RT_PRIO)
 
#define SCALE_PRIO(x, prio)   max(x * (MAX_PRIO - prio) / (MAX_USER_PRIO / 2), MIN_SPU_TIMESLICE)
 
#define LOAD_INT(x)   ((x) >> FSHIFT)
 
#define LOAD_FRAC(x)   LOAD_INT(((x) & (FIXED_1-1)) * 100)
 

Functions

void spu_set_timeslice (struct spu_context *ctx)
 
void __spu_update_sched_info (struct spu_context *ctx)
 
void spu_update_sched_info (struct spu_context *ctx)
 
void do_notify_spus_active (void)
 
void spu_del_from_rq (struct spu_context *ctx)
 
int spu_activate (struct spu_context *ctx, unsigned long flags)
 
void spu_deactivate (struct spu_context *ctx)
 
void spu_yield (struct spu_context *ctx)
 
void spuctx_switch_state (struct spu_context *ctx, enum spu_utilization_state new_state)
 
int __init spu_sched_init (void)
 
void spu_sched_exit (void)
 

Macro Definition Documentation

#define CREATE_TRACE_POINTS

Definition at line 49 of file sched.c.

#define DEF_SPU_TIMESLICE   (100 * HZ / (1000 * SPUSCHED_TICK))

Definition at line 83 of file sched.c.

#define LOAD_FRAC (   x)    LOAD_INT(((x) & (FIXED_1-1)) * 100)

Definition at line 1076 of file sched.c.

#define LOAD_INT (   x)    ((x) >> FSHIFT)

Definition at line 1075 of file sched.c.

#define MAX_USER_PRIO   (MAX_PRIO - MAX_RT_PRIO)

Definition at line 85 of file sched.c.

#define MIN_SPU_TIMESLICE   max(5 * HZ / (1000 * SPUSCHED_TICK), 1)

Definition at line 82 of file sched.c.

#define NORMAL_PRIO   120

Definition at line 68 of file sched.c.

#define SCALE_PRIO (   x,
  prio 
)    max(x * (MAX_PRIO - prio) / (MAX_USER_PRIO / 2), MIN_SPU_TIMESLICE)

Definition at line 86 of file sched.c.

#define SPUSCHED_TICK   (10)

Definition at line 74 of file sched.c.

Function Documentation

void __spu_update_sched_info ( struct spu_context ctx)

Definition at line 108 of file sched.c.

void do_notify_spus_active ( void  )

Definition at line 190 of file sched.c.

int spu_activate ( struct spu_context ctx,
unsigned long  flags 
)

spu_activate - find a free spu for a context and execute it : spu context to schedule : flags (currently ignored)

Tries to find a free spu to run . If no free spu is available add the context to the runqueue so it gets woken up once an spu is available.

Definition at line 786 of file sched.c.

void spu_deactivate ( struct spu_context ctx)

spu_deactivate - unbind a context from it's physical spu : spu context to unbind

Unbind from the physical spu it is running on and schedule the highest priority context to run on the freed physical spu.

Definition at line 895 of file sched.c.

void spu_del_from_rq ( struct spu_context ctx)

Definition at line 537 of file sched.c.

void spu_sched_exit ( void  )

Definition at line 1155 of file sched.c.

int __init spu_sched_init ( void  )

Definition at line 1113 of file sched.c.

void spu_set_timeslice ( struct spu_context ctx)

Definition at line 97 of file sched.c.

void spu_update_sched_info ( struct spu_context ctx)

Definition at line 149 of file sched.c.

void spu_yield ( struct spu_context ctx)

spu_yield - yield a physical spu if others are waiting : spu context to yield

Check if there is a higher priority context waiting and if yes unbind from the physical spu and schedule the highest priority context to run on the freed physical spu instead.

Definition at line 909 of file sched.c.

void spuctx_switch_state ( struct spu_context ctx,
enum spu_utilization_state  new_state 
)

Definition at line 1037 of file sched.c.