A brief file description. More...
#include "ink_config.h"
#include <assert.h>
#include <memory.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/mman.h>
#include "ink_atomic.h"
#include "ink_queue.h"
#include "ink_memory.h"
#include "ink_error.h"
#include "ink_assert.h"
#include "ink_queue_ext.h"
#include "ink_align.h"
Go to the source code of this file.
Defines | |
#define | MEMPROTECT_SIZE 0x200 |
#define | fl_memadd(_x_) ink_atomic_increment(&freelist_allocated_mem, (int64_t) (_x_)); |
#define | ADDRESS_OF_NEXT(x, offset) ((void **)((char *)x + offset)) |
Typedefs | |
typedef volatile void * | volatile_void_p |
Functions | |
void | ink_freelist_init (InkFreeList **fl, const char *name, uint32_t type_size, uint32_t chunk_size, uint32_t alignment) |
InkFreeList * | ink_freelist_create (const char *name, uint32_t type_size, uint32_t chunk_size, uint32_t alignment) |
void * | ink_freelist_new (InkFreeList *f) |
void | ink_freelist_free (InkFreeList *f, void *item) |
void | ink_freelists_snap_baseline () |
void | ink_freelists_dump_baselinerel (FILE *f) |
void | ink_freelists_dump (FILE *f) |
void | ink_atomiclist_init (InkAtomicList *l, const char *name, uint32_t offset_to_next) |
void * | ink_atomiclist_pop (InkAtomicList *l) |
void * | ink_atomiclist_popall (InkAtomicList *l) |
void * | ink_atomiclist_push (InkAtomicList *l, void *item) |
void * | ink_atomiclist_remove (InkAtomicList *l, void *item) |
Variables | |
inkcoreapi volatile int64_t | fastalloc_mem_in_use = 0 |
inkcoreapi volatile int64_t | fastalloc_mem_total = 0 |
ink_freelist_list * | freelists = NULL |
inkcoreapi volatile int64_t | freelist_allocated_mem = 0 |
int | fastmemtotal = 0 |
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 ink_queue.cc.
#define ADDRESS_OF_NEXT | ( | x, | ||
offset | ||||
) | ((void **)((char *)x + offset)) |
Definition at line 128 of file ink_queue.cc.
Referenced by ink_atomiclist_pop(), ink_atomiclist_popall(), ink_atomiclist_push(), ink_atomiclist_remove(), ink_freelist_free(), and ink_freelist_new().
#define fl_memadd | ( | _x_ | ) | ink_atomic_increment(&freelist_allocated_mem, (int64_t) (_x_)); |
Definition at line 80 of file ink_queue.cc.
Referenced by ink_freelist_new().
#define MEMPROTECT_SIZE 0x200 |
Definition at line 70 of file ink_queue.cc.
Referenced by ink_freelist_new().
typedef volatile void* volatile_void_p |
Definition at line 241 of file ink_queue.cc.
void ink_atomiclist_init | ( | InkAtomicList * | l, | |
const char * | name, | |||
uint32_t | offset_to_next | |||
) |
Definition at line 367 of file ink_queue.cc.
References FROM_PTR, InkAtomicList::head, InkAtomicList::name, and InkAtomicList::offset.
Referenced by aio_init_fildes(), AtomicSLL< C, L >::AtomicSLL(), clusterAPI_init(), ClusterHandler::ClusterHandler(), CongestionDB::CongestionDB(), UnixUDPConnection::init(), CCFailHistoryTestCont::init_events(), ProtectedQueue::ProtectedQueue(), UDPNetHandler::UDPNetHandler(), and UnixUDPConnection::UnixUDPConnection().
void* ink_atomiclist_pop | ( | InkAtomicList * | l | ) |
Definition at line 375 of file ink_queue.cc.
References ADDRESS_OF_NEXT, head_p::data, InkAtomicList::head, INK_QUEUE_LD, InkAtomicList::offset, and TO_PTR.
Referenced by AtomicSLL< C, L >::pop(), and CCFailHistoryTestCont::schedule_event().
void* ink_atomiclist_popall | ( | InkAtomicList * | l | ) |
Definition at line 401 of file ink_queue.cc.
References ADDRESS_OF_NEXT, head_p::data, FROM_PTR, InkAtomicList::head, INK_QUEUE_LD, InkAtomicList::offset, and TO_PTR.
Referenced by aio_move(), ClusterHandler::build_controlmsg_descriptors(), ClusterHandler::build_freespace_descriptors(), ClusterHandler::build_write_descriptors(), UnixUDPConnection::callbackHandler(), CCFailHistoryTestCont::clear_events(), ProtectedQueue::dequeue_timed(), ClusterHandler::do_open_local_requests(), Log::flush_thread_main(), ClusterAPIPeriodicSM::GetNextSM(), AtomicSLL< C, L >::popall(), ClusterHandler::process_incoming_callouts(), CongestionDB::RunTodoList(), UDPQueue::service(), and UnixUDPConnection::~UnixUDPConnection().
void* ink_atomiclist_push | ( | InkAtomicList * | l, | |
void * | item | |||
) |
Definition at line 432 of file ink_queue.cc.
References ADDRESS_OF_NEXT, head_p::data, FROM_PTR, InkAtomicList::head, ink_assert, INK_QUEUE_LD, InkAtomicList::offset, and TO_PTR.
Referenced by CongestionDB::addRecord(), aio_queue_req(), UDPConnection::bindToThread(), ClusterHandler::do_open_local_requests(), ProtectedQueue::enqueue(), CCFailHistoryTestCont::init_events(), ClusterProcessor::internal_invoke_remote(), machine_offline_APIcallout(), machine_online_APIcallout(), ClusterProcessor::open_local(), LogFile::preproc_and_try_delete(), ClusterHandler::process_large_control_msgs(), ClusterHandler::process_small_control_msgs(), AtomicSLL< C, L >::push(), CongestionDB::removeAllRecords(), CongestionDB::removeRecord(), revalidateCongestionDB(), UDPQueue::send(), send_machine_online_list(), OutgoingControl::startEvent(), UDPNetProcessorInternal::udp_read_from_net(), ClusterHandler::vcs_push(), and LogFile::write_ascii_logbuffer3().
void* ink_atomiclist_remove | ( | InkAtomicList * | l, | |
void * | item | |||
) |
Definition at line 458 of file ink_queue.cc.
References ADDRESS_OF_NEXT, head_p::data, InkAtomicList::head, ink_assert, INK_QUEUE_LD, InkAtomicList::offset, and TO_PTR.
Referenced by ProtectedQueue::remove(), and AtomicSLL< C, L >::remove().
InkFreeList* ink_freelist_create | ( | const char * | name, | |
uint32_t | type_size, | |||
uint32_t | chunk_size, | |||
uint32_t | alignment | |||
) |
Definition at line 119 of file ink_queue.cc.
References ink_freelist_init().
void ink_freelist_free | ( | InkFreeList * | f, | |
void * | item | |||
) |
Definition at line 244 of file ink_queue.cc.
References ADDRESS_OF_NEXT, _InkFreeList::alignment, ats_free(), ats_memalign_free(), head_p::data, fastalloc_mem_in_use, FROM_PTR, _InkFreeList::head, ink_fatal(), INK_QUEUE_LD, TO_PTR, _InkFreeList::type_size, and _InkFreeList::used.
Referenced by ClassAllocator< C >::free(), Allocator::free_void(), and ink_freelist_new().
void ink_freelist_init | ( | InkFreeList ** | fl, | |
const char * | name, | |||
uint32_t | type_size, | |||
uint32_t | chunk_size, | |||
uint32_t | alignment | |||
) |
Definition at line 84 of file ink_queue.cc.
References _InkFreeList::alignment, _InkFreeList::allocated, _InkFreeList::allocated_base, ats_malloc(), ats_memalign(), _InkFreeList::chunk_size, _ink_freelist_list::fl, FROM_PTR, _InkFreeList::head, INK_ALIGN, ink_assert, _InkFreeList::name, _ink_freelist_list::next, _InkFreeList::type_size, _InkFreeList::used, and _InkFreeList::used_base.
Referenced by Allocator::Allocator(), ClassAllocator< C >::ClassAllocator(), ink_freelist_create(), and Allocator::re_init().
void* ink_freelist_new | ( | InkFreeList * | f | ) |
Definition at line 136 of file ink_queue.cc.
References a, ADDRESS_OF_NEXT, _InkFreeList::alignment, _InkFreeList::allocated, ats_malloc(), ats_memalign(), _InkFreeList::chunk_size, head_p::data, fastalloc_mem_in_use, fastalloc_mem_total, fastmemtotal, fl_memadd, _InkFreeList::head, ink_assert, ink_fatal(), ink_freelist_free(), INK_QUEUE_LD, MEMPROTECT_SIZE, TO_PTR, _InkFreeList::type_size, and _InkFreeList::used.
Referenced by SparseClassAllocator< C >::alloc(), ClassAllocator< C >::alloc(), and Allocator::alloc_void().
void ink_freelists_dump | ( | FILE * | f | ) |
Definition at line 343 of file ink_queue.cc.
References _InkFreeList::allocated, _ink_freelist_list::fl, _InkFreeList::name, _ink_freelist_list::next, _InkFreeList::type_size, and _InkFreeList::used.
Referenced by TrackerContinuation::periodic(), and SignalContinuation::periodic().
void ink_freelists_dump_baselinerel | ( | FILE * | f | ) |
Definition at line 315 of file ink_queue.cc.
References a, _InkFreeList::allocated, _InkFreeList::allocated_base, _ink_freelist_list::fl, _InkFreeList::name, _ink_freelist_list::next, _InkFreeList::type_size, _InkFreeList::used, and _InkFreeList::used_base.
Referenced by TrackerContinuation::periodic().
void ink_freelists_snap_baseline | ( | ) |
Definition at line 299 of file ink_queue.cc.
References _InkFreeList::allocated, _InkFreeList::allocated_base, _ink_freelist_list::fl, _ink_freelist_list::next, _InkFreeList::used, and _InkFreeList::used_base.
Referenced by TrackerContinuation::periodic().
inkcoreapi volatile int64_t fastalloc_mem_in_use = 0 |
Definition at line 54 of file ink_queue.cc.
Referenced by ink_freelist_free(), and ink_freelist_new().
inkcoreapi volatile int64_t fastalloc_mem_total = 0 |
Definition at line 55 of file ink_queue.cc.
Referenced by ink_freelist_new().
int fastmemtotal = 0 |
Definition at line 134 of file ink_queue.cc.
Referenced by ink_freelist_new(), and SignalContinuation::periodic().
inkcoreapi volatile int64_t freelist_allocated_mem = 0 |
Definition at line 78 of file ink_queue.cc.
ink_freelist_list* freelists = NULL |
Definition at line 76 of file ink_queue.cc.