Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
sn2_smp.c File Reference
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/spinlock.h>
#include <linux/threads.h>
#include <linux/sched.h>
#include <linux/smp.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/mmzone.h>
#include <linux/module.h>
#include <linux/bitops.h>
#include <linux/nodemask.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <asm/processor.h>
#include <asm/irq.h>
#include <asm/sal.h>
#include <asm/delay.h>
#include <asm/io.h>
#include <asm/smp.h>
#include <asm/tlb.h>
#include <asm/numa.h>
#include <asm/hw_irq.h>
#include <asm/current.h>
#include <asm/sn/sn_cpuid.h>
#include <asm/sn/sn_sal.h>
#include <asm/sn/addrs.h>
#include <asm/sn/shub_mmr.h>
#include <asm/sn/nodepda.h>
#include <asm/sn/rw_mmr.h>
#include <asm/sn/sn_feature_sets.h>

Go to the source code of this file.

Data Structures

struct  ptc_stats
 

Macros

#define sn2_ptctest   0
 
#define local_node_uses_ptc_ga(sh1)   ((sh1) ? 1 : 0)
 
#define max_active_pio(sh1)   ((sh1) ? 32 : 7)
 
#define reset_max_active_on_deadlock()   1
 
#define PTC_LOCK(sh1)   ((sh1) ? &sn2_global_ptc_lock : &sn_nodepda->ptc_lock)
 
#define sn2_ptctest   0
 

Functions

 DEFINE_PER_CPU (struct ptc_stats, ptcstats)
 
 DECLARE_PER_CPU (struct ptc_stats, ptcstats)
 
unsigned long sn2_ptc_deadlock_recovery_core (volatile unsigned long *, unsigned long, volatile unsigned long *, unsigned long, volatile unsigned long *, unsigned long)
 
void sn2_ptc_deadlock_recovery (short *, short, short, int, volatile unsigned long *, unsigned long, volatile unsigned long *, unsigned long)
 
void sn_migrate (struct task_struct *task)
 
void sn_tlb_migrate_finish (struct mm_struct *mm)
 
void sn2_global_tlb_purge (struct mm_struct *mm, unsigned long start, unsigned long end, unsigned long nbits)
 
void sn_send_IPI_phys (int nasid, long physid, int vector, int delivery_mode)
 
 EXPORT_SYMBOL (sn_send_IPI_phys)
 
void sn2_send_IPI (int cpuid, int vector, int delivery_mode, int redirect)
 

Macro Definition Documentation

#define local_node_uses_ptc_ga (   sh1)    ((sh1) ? 1 : 0)

Definition at line 66 of file sn2_smp.c.

#define max_active_pio (   sh1)    ((sh1) ? 32 : 7)

Definition at line 67 of file sn2_smp.c.

#define PTC_LOCK (   sh1)    ((sh1) ? &sn2_global_ptc_lock : &sn_nodepda->ptc_lock)

Definition at line 69 of file sn2_smp.c.

#define reset_max_active_on_deadlock ( )    1

Definition at line 68 of file sn2_smp.c.

#define sn2_ptctest   0

Definition at line 86 of file sn2_smp.c.

#define sn2_ptctest   0

Definition at line 86 of file sn2_smp.c.

Function Documentation

DECLARE_PER_CPU ( struct ptc_stats  ,
ptcstats   
)
DEFINE_PER_CPU ( struct ptc_stats  ,
ptcstats   
)
EXPORT_SYMBOL ( sn_send_IPI_phys  )
void sn2_global_tlb_purge ( struct mm_struct mm,
unsigned long  start,
unsigned long  end,
unsigned long  nbits 
)

sn2_global_tlb_purge - globally purge translation cache of virtual address range : mm_struct containing virtual address range : start of virtual address range : end of virtual address range : specifies number of bytes to purge per instruction (num = 1<<(nbits & 0xfc))

Purges the translation caches of all processors of the given virtual address range.

Note:

  • cpu_vm_mask is a bit mask that indicates which cpus have loaded the context.
  • cpu_vm_mask is converted into a nodemask of the nodes containing the cpus in cpu_vm_mask.

if only one bit is set in cpu_vm_mask & it is the current cpu & the process is purging its own virtual address range, then only the local TLB needs to be flushed. This flushing can be done using ptc.l. This is the common case & avoids the global spinlock.

  • if multiple cpus have loaded the context, then flushing has to be done with ptc.g/MMRs under protection of the global ptc_lock.

Definition at line 164 of file sn2_smp.c.

void sn2_ptc_deadlock_recovery ( short nasids,
short  ib,
short  ie,
int  mynasid,
volatile unsigned long ptc0,
unsigned long  data0,
volatile unsigned long ptc1,
unsigned long  data1 
)

Definition at line 330 of file sn2_smp.c.

unsigned long sn2_ptc_deadlock_recovery_core ( volatile unsigned long ,
unsigned  long,
volatile unsigned long ,
unsigned  long,
volatile unsigned long ,
unsigned  long 
)
void sn2_send_IPI ( int  cpuid,
int  vector,
int  delivery_mode,
int  redirect 
)

sn2_send_IPI - send an IPI to a processor : target of the IPI : command to send : delivery mechanism : redirect the IPI?

Sends an IPI (InterProcessor Interrupt) to the processor specified by . specifies the command to send, while can be one of the following

IA64_IPI_DM_INT - pend an interrupt IA64_IPI_DM_PMI - pend a PMI IA64_IPI_DM_NMI - pend an NMI IA64_IPI_DM_INIT - pend an INIT interrupt

Definition at line 417 of file sn2_smp.c.

void sn_migrate ( struct task_struct task)

sn_migrate - SN-specific task migration actions : Task being migrated to new CPU

SN2 PIO writes from separate CPUs are not guaranteed to arrive in order. Context switching user threads which have memory-mapped MMIO may cause PIOs to issue from separate CPUs, thus the PIO writes must be drained from the previous CPU's Shub before execution resumes on the new CPU.

Definition at line 110 of file sn2_smp.c.

void sn_send_IPI_phys ( int  nasid,
long  physid,
int  vector,
int  delivery_mode 
)

sn_send_IPI_phys - send an IPI to a Nasid and slice : nasid to receive the interrupt (may be outside partition) : physical cpuid to receive the interrupt. : command to send : delivery mechanism

Sends an IPI (interprocessor interrupt) to the processor specified by

can be one of the following

IA64_IPI_DM_INT - pend an interrupt IA64_IPI_DM_PMI - pend a PMI IA64_IPI_DM_NMI - pend an NMI IA64_IPI_DM_INIT - pend an INIT interrupt

Definition at line 374 of file sn2_smp.c.

void sn_tlb_migrate_finish ( struct mm_struct mm)

Definition at line 122 of file sn2_smp.c.