A brief file description. More...
#include "libts.h"
Go to the source code of this file.
A brief file description.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file P_CacheInternal.h.
#define AIO_SOFT_FAILURE -100000 |
Definition at line 59 of file P_CacheInternal.h.
#define ALTERNATES 1 |
Definition at line 39 of file P_CacheInternal.h.
#define CACHE_CLEAR_DYN_STAT | ( | x | ) |
do { \ RecSetRawStatSum(cache_rsb, (x), 0); \ RecSetRawStatCount(cache_rsb, (x), 0); \ RecSetRawStatSum(vol->cache_vol->vol_rsb, (x), 0); \ RecSetRawStatCount(vol->cache_vol->vol_rsb, (x), 0); \ } while (0);
Definition at line 202 of file P_CacheInternal.h.
#define CACHE_DEBUG_INCREMENT_DYN_STAT | ( | _x | ) |
Definition at line 1005 of file P_CacheInternal.h.
Referenced by agg_copy(), and CacheVC::handleRead().
#define CACHE_DEBUG_SUM_DYN_STAT | ( | _x, | ||
_y | ||||
) |
Definition at line 1006 of file P_CacheInternal.h.
Referenced by agg_copy().
#define CACHE_DECREMENT_DYN_STAT | ( | x | ) |
RecIncrRawStat(cache_rsb, mutex->thread_holding, (int) (x), -1); \ RecIncrRawStat(vol->cache_vol->vol_rsb, mutex->thread_holding, (int) (x), -1);
Definition at line 180 of file P_CacheInternal.h.
Referenced by free_CacheVC().
#define CACHE_INCREMENT_DYN_STAT | ( | x | ) |
RecIncrRawStat(cache_rsb, mutex->thread_holding, (int) (x), 1); \ RecIncrRawStat(vol->cache_vol->vol_rsb, mutex->thread_holding, (int) (x), 1);
Definition at line 176 of file P_CacheInternal.h.
Referenced by free_CacheVC(), CacheVC::handleWrite(), Cache::lookup(), new_DocEvacuator(), Cache::open_read(), Vol::open_write(), Cache::open_write(), CacheVC::openReadFromWriter(), CacheVC::openReadFromWriterFailure(), CacheVC::openReadStartEarliest(), CacheVC::openReadStartHead(), CacheVC::openWriteCloseDir(), CacheVC::openWriteStartBegin(), Cache::remove(), and CacheVC::removeEvent().
#define CACHE_SET_DYN_STAT | ( | x, | ||
y | ||||
) |
RecSetGlobalRawStatSum(cache_rsb, (x), (y)) \ RecSetGlobalRawStatSum(vol->cache_vol->vol_rsb, (x), (y))
Definition at line 172 of file P_CacheInternal.h.
#define CACHE_STAT_ACTIVE 0 |
Definition at line 376 of file P_CacheInternal.h.
Referenced by free_CacheVC(), Cache::lookup(), new_DocEvacuator(), Cache::open_read(), Cache::open_write(), and Cache::remove().
#define CACHE_STAT_FAILURE 2 |
Definition at line 378 of file P_CacheInternal.h.
Referenced by CacheVC::handleWrite(), Cache::open_write(), and CacheVC::openWriteStartBegin().
#define CACHE_STAT_SUCCESS 1 |
Definition at line 377 of file P_CacheInternal.h.
Referenced by free_CacheVC().
#define CACHE_SUM_DYN_STAT | ( | x, | ||
y | ||||
) |
RecIncrRawStat(cache_rsb, mutex->thread_holding, (int) (x), (int64_t) (y)); \ RecIncrRawStat(vol->cache_vol->vol_rsb, mutex->thread_holding, (int) (x), (int64_t) (y));
Definition at line 187 of file P_CacheInternal.h.
#define CACHE_SUM_DYN_STAT_THREAD | ( | x, | ||
y | ||||
) |
RecIncrRawStat(cache_rsb, this_ethread(), (int) (x), (int64_t) (y)); \ RecIncrRawStat(vol->cache_vol->vol_rsb, this_ethread(), (int) (x), (int64_t) (y));
Definition at line 191 of file P_CacheInternal.h.
Referenced by RamCacheCLFUS::compress_entries(), RamCacheCLFUS::destroy(), RamCacheLRU::get(), RamCacheCLFUS::get(), RamCacheLRU::put(), RamCacheCLFUS::put(), RamCacheLRU::remove(), and RamCacheCLFUS::requeue_victims().
#define CACHE_SUM_GLOBAL_DYN_STAT | ( | x, | ||
y | ||||
) |
RecIncrGlobalRawStatSum(cache_rsb,(x),(y)) \ RecIncrGlobalRawStatSum(vol->cache_vol->vol_rsb,(x),(y))
Definition at line 198 of file P_CacheInternal.h.
#define CACHE_TRY_LOCK | ( | _l, | ||
_m, | ||||
_t | ||||
) | MUTEX_TRY_LOCK(_l, _m, _t) |
Definition at line 64 of file P_CacheInternal.h.
Referenced by Vol::aggWriteDone(), Vol::begin_read_lock(), Vol::close_read_lock(), Vol::close_write_lock(), CacheVC::derefRead(), dir_delete_lock(), dir_insert_lock(), dir_overwrite_lock(), CacheVC::handleWriteLock(), CacheSync::mainEvent(), Cache::open_read(), Vol::open_write_lock(), CacheVC::openReadClose(), CacheVC::openReadFromWriter(), CacheVC::openReadMain(), CacheVC::openReadReadDone(), CacheVC::openReadStartEarliest(), CacheVC::openReadStartHead(), CacheVC::openWriteCloseDataDone(), CacheVC::openWriteCloseDir(), CacheVC::openWriteCloseHeadDone(), CacheVC::openWriteOverwrite(), CacheVC::openWriteWriteDone(), Cache::remove(), CacheVC::scanObject(), CacheVC::scanOpenWrite(), CacheVC::scanUpdateDone(), ShowCacheInternal::showSegSegment(), ShowCacheInternal::showVolEvacuations(), ShowCacheInternal::showVolVolumes(), and OpenDir::signal_readers().
#define CACHE_VOL_SUM_DYN_STAT | ( | x, | ||
y | ||||
) | RecIncrRawStat(vol->cache_vol->vol_rsb, mutex->thread_holding, (int) (x), (int64_t) y); |
Definition at line 184 of file P_CacheInternal.h.
Referenced by CacheProcessor::cacheInitialized().
#define CONT_SCHED_LOCK_RETRY | ( | _c | ) | _c->mutex->thread_holding->schedule_in_local(_c, HRTIME_MSECONDS(cache_config_mutex_retry_delay)) |
Definition at line 92 of file P_CacheInternal.h.
Referenced by Cache::open_read(), Cache::open_write(), register_ShowCache(), register_ShowCacheInternal(), ShowCacheInternal::showSegSegment(), and ShowCacheInternal::showVolEvacuations().
#define CONT_SCHED_LOCK_RETRY_RET | ( | _c | ) |
do { \ _c->mutex->thread_holding->schedule_in_local(_c, HRTIME_MSECONDS(cache_config_mutex_retry_delay)); \ return EVENT_CONT; \ } while (0)
Definition at line 86 of file P_CacheInternal.h.
Referenced by ShowCacheInternal::showEvacuations(), ShowCacheInternal::showSegments(), ShowCacheInternal::showSegSegment(), ShowCacheInternal::showVolEvacuations(), ShowCacheInternal::showVolumes(), and ShowCacheInternal::showVolVolumes().
#define DDebug if (0) dummy_debug |
Definition at line 56 of file P_CacheInternal.h.
Referenced by Vol::aggWrite(), Vol::aggWriteDone(), RamCacheCLFUS::compress_entries(), RamCacheCLFUS::destroy(), dir_insert(), dir_lookaside_cleanup(), dir_lookaside_fixup(), dir_lookaside_insert(), dir_lookaside_probe(), dir_lookaside_remove(), dir_overwrite(), dir_probe(), CacheVC::do_io_close(), Vol::evac_range(), Vol::evacuate_cleanup_blocks(), evacuate_fragments(), CacheVC::evacuateDocDone(), Vol::evacuateDocReadDone(), CacheVC::evacuateReadHead(), Vol::force_evacuate_head(), RamCacheLRU::get(), RamCacheCLFUS::get(), RamCacheLRU::init(), RamCacheCLFUS::init(), CacheVC::openReadChooseWriter(), CacheVC::openReadFromWriter(), CacheVC::openReadFromWriterMain(), CacheVC::openReadMain(), CacheVC::openReadReadDone(), CacheVC::openReadStartEarliest(), CacheVC::openReadStartHead(), CacheVC::openWriteCloseDir(), CacheVC::openWriteWriteDone(), RamCacheLRU::put(), RamCacheCLFUS::put(), CacheVC::reenable(), CacheVC::reenable_re(), RamCacheLRU::remove(), RamCacheLRU::resize_hashtable(), RamCacheCLFUS::resize_hashtable(), Vol::scan_for_pinned_documents(), RamCacheCLFUS::tick(), and RamCacheCLFUS::victimize().
#define GLOBAL_CACHE_SET_DYN_STAT | ( | x, | ||
y | ||||
) | RecSetGlobalRawStatSum(cache_rsb, (x), (y)) |
Definition at line 169 of file P_CacheInternal.h.
Referenced by CacheProcessor::cacheInitialized().
#define GLOBAL_CACHE_SUM_GLOBAL_DYN_STAT | ( | x, | ||
y | ||||
) | RecIncrGlobalRawStatSum(cache_rsb,(x),(y)) |
Definition at line 195 of file P_CacheInternal.h.
#define INTEGRAL_FRAGS 4 |
Definition at line 45 of file P_CacheInternal.h.
#define MAX_CACHE_VCS_PER_THREAD 500 |
Definition at line 43 of file P_CacheInternal.h.
#define POP_HANDLER |
do { \ handler = save_handler; \ ink_assert(handler != (ContinuationHandler)(&CacheVC::dead)); \ } while (0)
Definition at line 519 of file P_CacheInternal.h.
#define PUSH_HANDLER | ( | _x | ) |
do { \ ink_assert(handler != (ContinuationHandler)(&CacheVC::dead)); \ save_handler = handler; handler = (ContinuationHandler)(_x); \ } while (0)
Definition at line 514 of file P_CacheInternal.h.
Referenced by CacheVC::do_read_call(), CacheVC::do_write_call(), CacheVC::do_write_lock(), and CacheVC::do_write_lock_call().
#define VC_LOCK_RETRY_EVENT | ( | ) |
do { \ trigger = mutex->thread_holding->schedule_in_local(this, HRTIME_MSECONDS(cache_config_mutex_retry_delay), event); \ return EVENT_CONT; \ } while (0)
Definition at line 74 of file P_CacheInternal.h.
Referenced by CacheVC::openWriteCloseDataDone(), CacheVC::openWriteCloseHeadDone(), CacheVC::openWriteOverwrite(), and CacheVC::openWriteWriteDone().
#define VC_SCHED_LOCK_RETRY | ( | ) |
do { \ trigger = mutex->thread_holding->schedule_in_local(this, HRTIME_MSECONDS(cache_config_mutex_retry_delay)); \ return EVENT_CONT; \ } while (0)
Definition at line 80 of file P_CacheInternal.h.
Referenced by CacheVC::handleReadDone(), CacheVC::openReadClose(), CacheVC::openReadFromWriter(), CacheVC::openReadMain(), CacheVC::openReadReadDone(), CacheVC::openReadStartEarliest(), CacheVC::openReadStartHead(), CacheVC::openWriteCloseDir(), CacheVC::openWriteStartBegin(), CacheVC::removeEvent(), and CacheVC::scanOpenWrite().
#define VC_SCHED_WRITER_RETRY | ( | ) |
do { \ ink_assert(!trigger); \ writer_lock_retry++; \ ink_hrtime _t = WRITER_RETRY_DELAY; \ if (writer_lock_retry > 2) \ _t = WRITER_RETRY_DELAY * 2; \ else if (writer_lock_retry > 5) \ _t = WRITER_RETRY_DELAY * 10; \ else if (writer_lock_retry > 10) \ _t = WRITER_RETRY_DELAY * 100; \ trigger = mutex->thread_holding->schedule_in_local(this, _t); \ return EVENT_CONT; \ } while (0)
Definition at line 95 of file P_CacheInternal.h.
Referenced by CacheVC::openReadFromWriter(), CacheVC::openReadMain(), and CacheVC::openReadReadDone().
#define WRITER_RETRY_DELAY HRTIME_MSECONDS(50) |
Definition at line 61 of file P_CacheInternal.h.
anonymous enum |
Definition at line 112 of file P_CacheInternal.h.
int64_t cache_bytes_total | ( | void | ) |
int64_t cache_bytes_used | ( | void | ) |
TS_INLINE unsigned int cache_hash | ( | INK_MD5 & | md5 | ) |
Definition at line 1107 of file P_CacheInternal.h.
References ats::CryptoHash::fold().
Referenced by Cluster_lookup(), CacheContinuation::do_remote_lookup(), UpdateSM::HandleSMEvent(), CacheProcessor::open_write(), CacheContinuation::remoteOpEvent(), and CacheProcessor::remove().
TS_INLINE int dir_delete_lock | ( | CacheKey * | key, | |
Vol * | d, | |||
ProxyMutex * | m, | |||
Dir * | del | |||
) |
Definition at line 904 of file P_CacheInternal.h.
References CACHE_TRY_LOCK, dir_delete(), Continuation::mutex, and ProxyMutex::thread_holding.
TS_INLINE int dir_insert_lock | ( | CacheKey * | key, | |
Vol * | d, | |||
Dir * | to_part, | |||
ProxyMutex * | m | |||
) |
Definition at line 914 of file P_CacheInternal.h.
References CACHE_TRY_LOCK, dir_insert(), Continuation::mutex, and ProxyMutex::thread_holding.
TS_INLINE int dir_overwrite_lock | ( | CacheKey * | key, | |
Vol * | d, | |||
Dir * | to_part, | |||
ProxyMutex * | m, | |||
Dir * | overwrite, | |||
bool | must_overwrite = true | |||
) |
Definition at line 924 of file P_CacheInternal.h.
References CACHE_TRY_LOCK, dir_overwrite(), Continuation::mutex, and ProxyMutex::thread_holding.
TS_INLINE void free_CacheRemoveCont | ( | CacheRemoveCont * | cache_rm | ) |
Definition at line 983 of file P_CacheInternal.h.
References ClassAllocator< C >::free(), and Continuation::mutex.
Referenced by CacheRemoveCont::event_handler().
TS_INLINE int free_CacheVC | ( | CacheVC * | cont | ) |
Definition at line 573 of file P_CacheInternal.h.
References CacheVC::_action, AIOCallback::action, ink_aiocb::aio_nbytes, ink_aiocb::aio_reqprio, AIOCallback::aio_result, AIOCallback::aiocb, CacheVC::alternate, CacheVC::alternate_index, ats_free(), CacheVC::base_stat, CacheVC::blocks, CacheVC::buf, VIO::buffer, CACHE_ALT_INDEX_DEFAULT, CACHE_DECREMENT_DYN_STAT, CACHE_INCREMENT_DYN_STAT, CACHE_STAT_ACTIVE, CACHE_STAT_SUCCESS, Action::cancel(), Action::cancelled, MIOBufferAccessor::clear(), CacheHTTPInfoVector::clear(), Ptr< T >::clear(), CacheVC::closed, Action::continuation, CacheVC::dead(), Debug, CacheVC::f, CacheVC::first_buf, ink_assert, CacheVC::io, CacheVC::is_io_in_progress(), VIO::mutex, Action::mutex, Continuation::mutex, CacheVC::od, VIO::op, VIO::READ, CacheVC::scan_vol_map, SET_CONTINUATION_HANDLER, CacheVC::size_to_init, this_ethread(), this_thread(), THREAD_FREE, ProxyMutex::thread_holding, CacheVC::trigger, CacheVC::vector, CacheVC::vio, CacheVC::vol, VIO::WRITE, and CacheVC::writer_buf.
Referenced by CacheVC::derefRead(), dir_lookaside_cleanup(), CacheVC::evacuateDocDone(), Vol::evacuateDocReadDone(), CacheVC::evacuateReadHead(), CacheVC::linkWrite(), Cache::open_write(), CacheVC::openReadClose(), CacheVC::openReadFromWriter(), CacheVC::openReadFromWriterFailure(), CacheVC::openReadStartEarliest(), CacheVC::openReadStartHead(), CacheVC::openWriteCloseDir(), CacheVC::openWriteStartBegin(), CacheVC::removeEvent(), CacheVC::scanObject(), and CacheVC::scanVol().
TS_INLINE Cache* local_cache | ( | ) |
Definition at line 1355 of file P_CacheInternal.h.
TS_INLINE CacheRemoveCont* new_CacheRemoveCont | ( | ) |
Definition at line 973 of file P_CacheInternal.h.
References ClassAllocator< C >::alloc(), CacheRemoveCont::event_handler(), Continuation::mutex, new_ProxyMutex(), and SET_CONTINUATION_HANDLER.
Referenced by Cache::remove().
TS_INLINE CacheVC* new_CacheVC | ( | Continuation * | cont | ) |
Definition at line 551 of file P_CacheInternal.h.
References CacheVC::_action, CacheArray< T >::data, CacheHTTPInfoVector::data, Debug, DEDICATED, CacheVC::dir, dir_clear, CacheArray< T >::fast_data, CacheVC::initial_thread, ink_assert, ink_get_hrtime(), Continuation::mutex, CacheVC::start_time, THREAD_ALLOC, CacheVC::trigger, EThread::tt, and CacheVC::vector.
Referenced by Cache::deref(), Cache::link(), Cache::lookup(), new_DocEvacuator(), Cache::open_read(), Cache::open_write(), Cache::remove(), and Cache::scan().
Definition at line 368 of file CacheWrite.cc.
References CacheVC::base_stat, CacheVC::buf, CACHE_INCREMENT_DYN_STAT, CACHE_STAT_ACTIVE, CacheVC::earliest_key, CacheVC::evacuateDocDone(), CacheVC::f, iobuffer_size_to_index(), MAX_BUFFER_SIZE_INDEX, MEMALIGNED, Continuation::mutex, new_CacheVC(), new_IOBufferData, SET_CONTINUATION_HANDLER, CacheVC::vol, and zero_key.
Referenced by Vol::evac_range().
Definition at line 942 of file P_CacheInternal.h.
Referenced by Vol::evacuateDocReadDone(), CacheVC::evacuateReadHead(), CacheVC::openReadMain(), CacheVC::openReadReadDone(), CacheVC::openReadStartEarliest(), CacheVC::openReadStartHead(), CacheVC::openWriteCloseDataDone(), and CacheVC::openWriteWriteDone().
TS_INLINE unsigned int next_rand | ( | unsigned int * | p | ) |
Definition at line 962 of file P_CacheInternal.h.
Referenced by build_hash_table_bucket(), build_hash_table_machine(), build_vol_hash_table(), and regress_rand_CacheKey().
Definition at line 952 of file P_CacheInternal.h.
Referenced by agg_copy(), and CacheVC::openReadMain().
void TS_INLINE rand_CacheKey | ( | CacheKey * | next_key, | |
ProxyMutex * | mutex | |||
) |
Definition at line 934 of file P_CacheInternal.h.
References ats::CryptoHash::b, EThread::generator, InkRand::random(), and ProxyMutex::thread_holding.
Referenced by cache(), Cache_dir(), and Cache::open_write().
Definition at line 375 of file ClusterProcessor.cc.
Referenced by cluster_machine_at_depth(), CacheProcessor::lookup(), main(), CacheProcessor::open_read(), CacheProcessor::open_write(), and CacheProcessor::remove().
Definition at line 223 of file P_CacheInternal.h.
Referenced by CacheVC::handleWrite(), ink_cache_init(), and Vol::open_write().
Definition at line 79 of file Cache.cc.
Referenced by ink_cache_init().
Definition at line 65 of file Cache.cc.
Referenced by dir_sync_init(), ink_cache_init(), and CacheSync::mainEvent().
Definition at line 78 of file Cache.cc.
Referenced by agg_copy(), CacheVC::handleReadDone(), and ink_cache_init().
Definition at line 75 of file Cache.cc.
Referenced by ink_cache_init(), and CacheProcessor::start_internal().
Definition at line 73 of file Cache.cc.
Referenced by Vol::init(), ink_cache_init(), CacheSync::mainEvent(), and sync_cache_dir_on_shutdown().
Definition at line 74 of file Cache.cc.
Referenced by ink_cache_init(), CacheVC::openReadStartEarliest(), and CacheVC::openReadStartHead().
Definition at line 64 of file Cache.cc.
Referenced by ink_cache_init().
Definition at line 69 of file Cache.cc.
Referenced by CacheVC::handleWrite(), ink_cache_init(), and validate_rww().
Definition at line 70 of file Cache.cc.
Referenced by Cache::open(), and vol_init_data_internal().
Definition at line 81 of file Cache.cc.
Referenced by Vol::aggWriteDone(), Cache::deref(), CacheVC::derefRead(), CacheVC::handleWriteLock(), ink_cache_init(), CacheSync::mainEvent(), CacheVC::scanObject(), CacheVC::scanUpdateDone(), and OpenDir::signal_readers().
Definition at line 66 of file Cache.cc.
Referenced by ink_cache_init(), and Vol::scan_for_pinned_documents().
Definition at line 61 of file Cache.cc.
Referenced by CacheProcessor::cacheInitialized(), RamCacheCLFUS::compress_entries(), CacheVC::handleRead(), CacheVC::handleReadDone(), ink_cache_init(), and RamCacheCLFUSCompressor::mainEvent().
Definition at line 62 of file Cache.cc.
Referenced by RamCacheCLFUS::compress_entries(), ink_cache_init(), and RamCacheCLFUSCompressor::mainEvent().
Definition at line 63 of file Cache.cc.
Referenced by ink_cache_init(), RamCacheLRU::put(), RamCacheCLFUS::put(), RamCacheLRU::resize_hashtable(), and RamCacheCLFUS::resize_hashtable().
Definition at line 80 of file Cache.cc.
Referenced by ink_cache_init(), CacheVC::openReadChooseWriter(), CacheVC::openReadFromWriter(), and update_cache_config().
Definition at line 68 of file Cache.cc.
Referenced by ink_cache_init(), CacheVC::openReadChooseWriter(), and CacheVC::openReadStartHead().
Definition at line 76 of file Cache.cc.
Referenced by ink_cache_init(), and target_fragment_size().
Definition at line 102 of file Cache.cc.
Referenced by Vol::aggWriteDone(), and dir_sync_init().
uint8_t CacheKey_next_table[] |
Definition at line 1318 of file CacheDir.cc.
uint8_t CacheKey_prev_table[] |
Definition at line 1354 of file CacheDir.cc.
Definition at line 101 of file Cache.cc.
Referenced by cache_lookup_ClusterFunction(), cache_op_ClusterFunction(), Cache::deref(), Cache::link(), Cache::open_read(), Cache::open_write(), CacheContinuation::remoteOpEvent(), and CacheContinuation::setupReadWriteVC().
Definition at line 97 of file Cache.cc.
Referenced by CacheVC::scanVol().
Definition at line 125 of file Cache.cc.
Referenced by agg_copy(), Vol::force_evacuate_head(), new_DocEvacuator(), CacheVC::openReadStartEarliest(), CacheVC::scanObject(), and HttpTransactCache::SelectFromAlternates().