Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Functions | Variables
wnuma.cpp File Reference
#include "precompiled.h"
#include "lib/sysdep/numa.h"
#include "lib/bits.h"
#include "lib/alignment.h"
#include "lib/timer.h"
#include "lib/module_init.h"
#include "lib/sysdep/vm.h"
#include "lib/sysdep/acpi.h"
#include "lib/sysdep/os_cpu.h"
#include "lib/sysdep/os/win/win.h"
#include "lib/sysdep/os/win/wutil.h"
#include "lib/sysdep/os/win/wcpu.h"
#include <Psapi.h>

Go to the source code of this file.

Classes

struct  Node
 
struct  SLIT
 

Functions

static NodeAddNode ()
 
static NodeFindNodeWithProcessorMask (uintptr_t processorMask)
 
static NodeFindNodeWithProcessor (size_t processor)
 
static UCHAR HighestNodeNumber ()
 
static void PopulateNodes ()
 
static Status InitTopology ()
 
size_t numa_NumNodes ()
 
size_t numa_NodeFromProcessor (size_t processor)
 
uintptr_t numa_ProcessorMaskFromNode (size_t node)
 
static UCHAR NodeNumberFromNode (size_t node)
 
size_t numa_AvailableMemory (size_t node)
 
static double ReadRelativeDistanceFromSLIT (const SLIT *slit)
 
static double MeasureRelativeDistance ()
 
static Status InitRelativeDistance ()
 
double numa_Factor ()
 
static bool IsMemoryInterleaved ()
 
static Status InitMemoryInterleaved ()
 
bool numa_IsMemoryInterleaved ()
 

Variables

static Node nodes [os_cpu_MaxProcessors]
 
static size_t numNodes
 
static ModuleInitState initState
 
static double relativeDistance
 
static bool isMemoryInterleaved
 

Function Documentation

static Node* AddNode ( )
static

Definition at line 59 of file wnuma.cpp.

static Node* FindNodeWithProcessor ( size_t  processor)
static

Definition at line 76 of file wnuma.cpp.

static Node* FindNodeWithProcessorMask ( uintptr_t  processorMask)
static

Definition at line 65 of file wnuma.cpp.

static UCHAR HighestNodeNumber ( )
static

Definition at line 91 of file wnuma.cpp.

static Status InitMemoryInterleaved ( )
static

Definition at line 450 of file wnuma.cpp.

static Status InitRelativeDistance ( )
static

Definition at line 405 of file wnuma.cpp.

static Status InitTopology ( )
static

Definition at line 267 of file wnuma.cpp.

static bool IsMemoryInterleaved ( )
static

Definition at line 434 of file wnuma.cpp.

static double MeasureRelativeDistance ( )
static

Definition at line 374 of file wnuma.cpp.

static UCHAR NodeNumberFromNode ( size_t  node)
static

Definition at line 315 of file wnuma.cpp.

size_t numa_AvailableMemory ( size_t  node)
Parameters
node
Returns
bytes of memory available for allocation on <node>.

Definition at line 326 of file wnuma.cpp.

double numa_Factor ( )
Returns
the ratio between maximum and minimum times that one processor from each node required to fill a globally allocated array. in other words, this is the maximum slowdown for NUMA-oblivious memory accesses. Microsoft guidelines require it to be <= 3.

Definition at line 426 of file wnuma.cpp.

bool numa_IsMemoryInterleaved ( )
Returns
an indication of whether memory pages are node-interleaved.

note: this requires ACPI access, which may not be available on least-permission accounts. the default is to return false so as not to cause callers to panic and trigger performance warnings.

Definition at line 456 of file wnuma.cpp.

size_t numa_NodeFromProcessor ( size_t  processor)
Parameters
processor
Returns
node number (zero-based) to which <processor> belongs.

Definition at line 299 of file wnuma.cpp.

size_t numa_NumNodes ( )
Returns
number of NUMA "nodes" (i.e. groups of CPUs with local memory).

Definition at line 293 of file wnuma.cpp.

uintptr_t numa_ProcessorMaskFromNode ( size_t  node)
Parameters
node
Returns
bit-mask of all processors constituting <node>.

Definition at line 308 of file wnuma.cpp.

static void PopulateNodes ( )
static

Definition at line 104 of file wnuma.cpp.

static double ReadRelativeDistanceFromSLIT ( const SLIT slit)
static

Definition at line 361 of file wnuma.cpp.

Variable Documentation

ModuleInitState initState
static

Definition at line 265 of file wnuma.cpp.

bool isMemoryInterleaved
static

Definition at line 448 of file wnuma.cpp.

Node nodes[os_cpu_MaxProcessors]
static

Definition at line 56 of file wnuma.cpp.

size_t numNodes
static

Definition at line 57 of file wnuma.cpp.

double relativeDistance
static

Definition at line 403 of file wnuma.cpp.