ModDevPoll.cc File Reference
#include "squid.h"
#include "comm/Loops.h"
#include "fd.h"
#include "fde.h"
#include "mgr/Registration.h"
#include "profiler/Profiler.h"
#include "SquidTime.h"
#include "StatCounters.h"
#include "StatHist.h"
#include "Store.h"
#include <cerrno>
#include <climits>
Include dependency graph for ModDevPoll.cc:

Go to the source code of this file.

Classes

struct  _devpoll_state
 Current state. More...
 

Macros

#define DEBUG_DEVPOLL   0
 
#define DEVPOLL_UPDATESIZE   OPEN_MAX
 
#define DEVPOLL_QUERYSIZE   OPEN_MAX
 

Typedefs

typedef short pollfd_events_t
 

Functions

static void commDevPollRegisterWithCacheManager (void)
 
static void comm_flush_updates (void)
 Write batched file descriptor event changes to poll device. More...
 
static void comm_update_fd (int fd, int events)
 Register change in desired polling state for file descriptor. More...
 
static void commIncomingStats (StoreEntry *sentry)
 

Variables

struct {
   struct pollfd *   pfds
 
   int   cur
 
   int   size
 
devpoll_update
 Update list. More...
 
static int devpoll_fd
 
static int max_poll_time = 1000
 
static struct _devpoll_statedevpoll_state
 
static struct dvpoll do_poll
 
static int dpoll_nfds
 

Macro Definition Documentation

#define DEBUG_DEVPOLL   0

Definition at line 51 of file ModDevPoll.cc.

Referenced by comm_flush_updates(), comm_update_fd(), and Comm::DoSelect().

#define DEVPOLL_QUERYSIZE   OPEN_MAX

Definition at line 55 of file ModDevPoll.cc.

Referenced by Comm::SelectLoopInit().

#define DEVPOLL_UPDATESIZE   OPEN_MAX

Definition at line 54 of file ModDevPoll.cc.

Referenced by Comm::SelectLoopInit().

Typedef Documentation

typedef short pollfd_events_t

Definition at line 58 of file ModDevPoll.cc.

Function Documentation

static void comm_flush_updates ( void  )
static

Writes out the static array of file descriptor event changes to the poll device. This is done only when necessary (i.e. just before the poll device is queried during the select call, and whenever the number of changes to store in the array exceeds the size of the array).

Definition at line 101 of file ModDevPoll.cc.

References assert, DEBUG_DEVPOLL, debugs, devpoll_fd, devpoll_update, HERE(), and i.

Referenced by comm_update_fd(), and Comm::DoSelect().

static void comm_update_fd ( int  fd,
int  events 
)
static

Prevents unnecessary calls to the /dev/poll API by queueing changes in the devpoll_update array. If the array fills up the comm_flush_updates function is called.

Parameters
fdfile descriptor to register change with
eventsevents to register (usually POLLIN, POLLOUT, or POLLREMOVE)

Definition at line 133 of file ModDevPoll.cc.

References comm_flush_updates(), DEBUG_DEVPOLL, debugs, devpoll_update, and HERE().

Referenced by Comm::SetSelect().

static void commDevPollRegisterWithCacheManager ( void  )
static

Definition at line 160 of file ModDevPoll.cc.

References commIncomingStats(), and Mgr::RegisterAction().

Referenced by Comm::SelectLoopInit().

static void commIncomingStats ( StoreEntry sentry)
static

Variable Documentation

int devpoll_fd
static

handle to /dev/poll device

Definition at line 81 of file ModDevPoll.cc.

Referenced by comm_flush_updates(), Comm::DoSelect(), and Comm::SelectLoopInit().

struct _devpoll_state* devpoll_state
static

array of socket states

Definition at line 84 of file ModDevPoll.cc.

struct { ... } devpoll_update

This structure contains an array of settings to send to the /dev/poll interface. Rather than send changes to /dev/poll one at a time they are pushed onto this array (updating cur to indicate how many of the pfds structure elements have been set) until it is full before it is written out the API.

Referenced by comm_flush_updates(), comm_update_fd(), and Comm::SelectLoopInit().

struct dvpoll do_poll
static

data struct for storing poll results

Definition at line 85 of file ModDevPoll.cc.

Referenced by Comm::DoSelect(), and Comm::SelectLoopInit().

int dpoll_nfds
static

maximum number of poll results

Definition at line 86 of file ModDevPoll.cc.

Referenced by Comm::DoSelect(), and Comm::SelectLoopInit().

int max_poll_time = 1000
static

maximum milliseconds to spend in poll

Definition at line 82 of file ModDevPoll.cc.

Referenced by Comm::DoSelect(), and Comm::QuickPollRequired().

struct pollfd* pfds

ptr to array of struct pollfd config elements

Definition at line 75 of file ModDevPoll.cc.

int size

maximum number of elements in array

Definition at line 77 of file ModDevPoll.cc.

Referenced by action(), Ssl::CertificateDb::addCertAndPrivateKey(), addr2oid(), ConnStateData::afterClientWrite(), Parser::BinaryTokenizer::area(), Adaptation::Config::clear(), client_Inst(), clientdbUpdate(), concat(), Ssl::CertificateDb::Create(), Adaptation::Icap::ModXact::echoMore(), Adaptation::Icap::ModXact::estimateVirginBody(), BodyPipe::expectProductionEndAfter(), VectorMap< Key, Value >::findKeyIndex(), Auth::Scheme::FreeAll(), ftpListParseParts(), Mem::AllocatorProxy::getAllocator(), BodyPipe::getMoreData(), gopherSendComplete(), hash4(), hash_next(), hash_string(), hash_url(), HeapKeyGen_StoreEntry_GDSF(), hex_dump(), Ftp::Gateway::htmlifyListEntry(), VectorMap< Key, Value >::indexUsed(), inet_ntop4(), ldap_escape_value(), main(), match(), memFindBufSizeType(), memFreeBuf(), memFreeBufFunc(), memFreeString(), netdbExchangeHandleReply(), oid2addr(), operator new(), Store::Disk::optionObjectSizeParse(), Ssl::ErrorDetailFile::parse(), Http::One::TeChunkedParser::parseChunkSize(), ClientDelayConfig::parsePoolCount(), ClientDelayConfig::parsePoolId(), Fs::Ufs::UFSSwapDir::parseSizeL1L2(), peerDigestSwapInMask(), BodyPipe::postAppend(), BodyPipe::postConsume(), Adaptation::Icap::VirginBodyAct::progress(), BodyPipe::putMoreData(), re_compile_fastmap(), Rock::IoState::read_(), Fs::Ufs::RebuildState::rebuildFromDirectory(), regex_compile(), Dns::CachedIps::reportCurrent(), request(), Dns::CachedIps::restoreGoodness(), DiskdIOStrategy::SEND(), send_request(), Snmp::Var::setObject(), Snmp::Var::setString(), Parser::BinaryTokenizer::skip(), SMB_Create(), SMB_Logon_TCon_Open(), SMB_Lseek(), SMB_Open(), Client::startAdaptation(), LruMap< Key, EntryValue, EntryCost >::trim(), urldecode(), Adaptation::Ecap::XactionRep::vbContent(), Adaptation::Ecap::XactionRep::vbContentShift(), Adaptation::Icap::ModXact::virginConsume(), Ssl::ServerBio::write(), Http::Stream::writeComplete(), Adaptation::Icap::ModXact::writePreviewBody(), Adaptation::Icap::ModXact::writePrimeBody(), Adaptation::Icap::Preview::wrote(), and Ftp::CtrlChannel::~CtrlChannel().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors