Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooFit::BidirMMapPipe_impl::PageChunk Class Reference

class representing a chunk of pages

Author
Manuel Schiller manue.nosp@m.l.sc.nosp@m.hille.nosp@m.r@ni.nosp@m.khef..nosp@m.nl
Date
2013-07-24

allocating pages from the OS happens in chunks in order to not exhaust the maximum allowed number of memory mappings per process; this class takes care of such a chunk

a page chunk allows callers to obtain or release pages in groups of continuous pages of fixed size

Definition at line 45 of file BidirMMapPipe.h.

Public Types

enum  MMapVariety {
  Unknown , Copy , FileBacked , DevZero ,
  Anonymous
}
 type of mmap support found More...
 

Public Member Functions

 PageChunk (PagePool *parent, unsigned length, unsigned nPgPerGroup)
 constructor
 
 ~PageChunk ()
 destructor
 
bool contains (const Pages &p) const
 return if p is contained in this PageChunk
 
bool empty () const
 return true if no used page groups in this chunk
 
bool full () const
 return true if no free page groups in this chunk
 
unsigned len () const
 return length of chunk
 
unsigned nPagesPerGroup () const
 return number of pages per page group
 
Pages pop ()
 pop a group of pages off the free list
 
void push (const Pages &p)
 push a group of pages onto the free list
 
void zap (Pages &p)
 free all pages except for those pointed to by p
 

Static Public Member Functions

static MMapVariety mmapVariety ()
 return mmap variety support found
 
static unsigned pagesize ()
 return the logical page size
 
static unsigned physPgSz ()
 return the physical page size of the system
 

Private Types

typedef BidirMMapPipeException Exception
 convenience typedef
 

Private Member Functions

 PageChunk (const PageChunk &)
 forbid copying
 
PageChunkoperator= (const PageChunk &)
 forbid assignment
 

Static Private Member Functions

static void * dommap (unsigned len)
 mmap pages, len is length of mmapped area in bytes
 
static void domunmap (void *p, unsigned len)
 munmap pages p, len is length of mmapped area in bytes
 
static unsigned getPageSize ()
 determine page size at run time
 

Private Attributes

void * m_begin
 pointer to start of mmapped area
 
void * m_end
 pointer one behind end of mmapped area
 
std::list< void * > m_freelist
 free pages list
 
unsigned m_nPgPerGrp
 number of pages per group
 
unsigned m_nUsedGrp
 number of used page groups
 
PagePoolm_parent
 parent page pool
 

Static Private Attributes

static MMapVariety s_mmapworks = PageChunk::Unknown
 mmap variety that works on this system
 
static unsigned s_pagesize = std::min(PageChunk::s_physpgsz, 16384u)
 logical page size (run-time determined)
 
static unsigned s_physpgsz = PageChunk::getPageSize()
 system physical page size
 

#include </home/sftnight/build/workspace/root-makedoc-v628/rootspi/rdoc/src/v6-28-00-patches/roofit/roofitcore/src/BidirMMapPipe.h>

Member Typedef Documentation

◆ Exception

convenience typedef

Definition at line 63 of file BidirMMapPipe.h.

Member Enumeration Documentation

◆ MMapVariety

type of mmap support found

Enumerator
Unknown 

don't know yet what'll work

Copy 

mmap doesn't work, have to copy back and forth

FileBacked 

mmapping a temp file works

DevZero 

mmapping /dev/zero works

Anonymous 

anonymous mmap works

Definition at line 48 of file BidirMMapPipe.h.

Constructor & Destructor Documentation

◆ PageChunk() [1/2]

RooFit::BidirMMapPipe_impl::PageChunk::PageChunk ( const PageChunk )
inlineprivate

forbid copying

Definition at line 82 of file BidirMMapPipe.h.

◆ PageChunk() [2/2]

RooFit::BidirMMapPipe_impl::PageChunk::PageChunk ( PagePool parent,
unsigned  length,
unsigned  nPgPerGroup 
)

constructor

Definition at line 344 of file BidirMMapPipe.cxx.

◆ ~PageChunk()

RooFit::BidirMMapPipe_impl::PageChunk::~PageChunk ( )

destructor

Definition at line 360 of file BidirMMapPipe.cxx.

Member Function Documentation

◆ contains()

bool RooFit::BidirMMapPipe_impl::PageChunk::contains ( const Pages p) const

return if p is contained in this PageChunk

Definition at line 366 of file BidirMMapPipe.cxx.

◆ dommap()

void * RooFit::BidirMMapPipe_impl::PageChunk::dommap ( unsigned  len)
staticprivate

mmap pages, len is length of mmapped area in bytes

Definition at line 392 of file BidirMMapPipe.cxx.

◆ domunmap()

void RooFit::BidirMMapPipe_impl::PageChunk::domunmap ( void *  p,
unsigned  len 
)
staticprivate

munmap pages p, len is length of mmapped area in bytes

Definition at line 532 of file BidirMMapPipe.cxx.

◆ empty()

bool RooFit::BidirMMapPipe_impl::PageChunk::empty ( ) const
inline

return true if no used page groups in this chunk

Definition at line 118 of file BidirMMapPipe.h.

◆ full()

bool RooFit::BidirMMapPipe_impl::PageChunk::full ( ) const
inline

return true if no free page groups in this chunk

Definition at line 121 of file BidirMMapPipe.h.

◆ getPageSize()

unsigned RooFit::BidirMMapPipe_impl::PageChunk::getPageSize ( )
staticprivate

determine page size at run time

Definition at line 330 of file BidirMMapPipe.cxx.

◆ len()

unsigned RooFit::BidirMMapPipe_impl::PageChunk::len ( ) const
inline

return length of chunk

Definition at line 109 of file BidirMMapPipe.h.

◆ mmapVariety()

static MMapVariety RooFit::BidirMMapPipe_impl::PageChunk::mmapVariety ( )
inlinestatic

return mmap variety support found

Definition at line 91 of file BidirMMapPipe.h.

◆ nPagesPerGroup()

unsigned RooFit::BidirMMapPipe_impl::PageChunk::nPagesPerGroup ( ) const
inline

return number of pages per page group

Definition at line 115 of file BidirMMapPipe.h.

◆ operator=()

PageChunk & RooFit::BidirMMapPipe_impl::PageChunk::operator= ( const PageChunk )
inlineprivate

forbid assignment

Definition at line 84 of file BidirMMapPipe.h.

◆ pagesize()

static unsigned RooFit::BidirMMapPipe_impl::PageChunk::pagesize ( )
inlinestatic

return the logical page size

Definition at line 87 of file BidirMMapPipe.h.

◆ physPgSz()

static unsigned RooFit::BidirMMapPipe_impl::PageChunk::physPgSz ( )
inlinestatic

return the physical page size of the system

Definition at line 89 of file BidirMMapPipe.h.

◆ pop()

Pages RooFit::BidirMMapPipe_impl::PageChunk::pop ( )

pop a group of pages off the free list

Definition at line 369 of file BidirMMapPipe.cxx.

◆ push()

void RooFit::BidirMMapPipe_impl::PageChunk::push ( const Pages p)

push a group of pages onto the free list

Definition at line 378 of file BidirMMapPipe.cxx.

◆ zap()

void RooFit::BidirMMapPipe_impl::PageChunk::zap ( Pages p)

free all pages except for those pointed to by p

Definition at line 546 of file BidirMMapPipe.cxx.

Member Data Documentation

◆ m_begin

void* RooFit::BidirMMapPipe_impl::PageChunk::m_begin
private

pointer to start of mmapped area

Definition at line 65 of file BidirMMapPipe.h.

◆ m_end

void* RooFit::BidirMMapPipe_impl::PageChunk::m_end
private

pointer one behind end of mmapped area

Definition at line 66 of file BidirMMapPipe.h.

◆ m_freelist

std::list<void*> RooFit::BidirMMapPipe_impl::PageChunk::m_freelist
private

free pages list

Definition at line 69 of file BidirMMapPipe.h.

◆ m_nPgPerGrp

unsigned RooFit::BidirMMapPipe_impl::PageChunk::m_nPgPerGrp
private

number of pages per group

Definition at line 71 of file BidirMMapPipe.h.

◆ m_nUsedGrp

unsigned RooFit::BidirMMapPipe_impl::PageChunk::m_nUsedGrp
private

number of used page groups

Definition at line 72 of file BidirMMapPipe.h.

◆ m_parent

PagePool* RooFit::BidirMMapPipe_impl::PageChunk::m_parent
private

parent page pool

Definition at line 70 of file BidirMMapPipe.h.

◆ s_mmapworks

PageChunk::MMapVariety RooFit::BidirMMapPipe_impl::PageChunk::s_mmapworks = PageChunk::Unknown
staticprivate

mmap variety that works on this system

Definition at line 60 of file BidirMMapPipe.h.

◆ s_pagesize

unsigned RooFit::BidirMMapPipe_impl::PageChunk::s_pagesize = std::min(PageChunk::s_physpgsz, 16384u)
staticprivate

logical page size (run-time determined)

Definition at line 58 of file BidirMMapPipe.h.

◆ s_physpgsz

unsigned RooFit::BidirMMapPipe_impl::PageChunk::s_physpgsz = PageChunk::getPageSize()
staticprivate

system physical page size

Definition at line 57 of file BidirMMapPipe.h.

  • roofit/roofitcore/src/BidirMMapPipe.h
  • roofit/roofitcore/src/BidirMMapPipe.cxx