![]() |
NVMLib
very early alpha
A library to optimally use a Hybrid RAM setup.
|
#include "object_maintainance.h"#include "types.h"#include "malloc.h"#include <libpmemobj.h>#include "globals.h"#include "pool.h"#include "hashmap.h"#include "mem_log.h"#include "log.h"#include <uv.h>#include <pthread.h>
Go to the source code of this file.
Functions | |
| uint64_t | get_hash (object_maintainance *entry) |
| int | compare (object_maintainance *a, object_maintainance *b) |
| HASH_MAP (object_maintainance) | |
| Hashmap for object maintaince. More... | |
| void | unlock_om () |
| void | initialise_logistics () |
| void * | logistics_thread_function (void *data) |
The logistics thread function. More... | |
| void * | deletion_thread_function (void *data) |
The deletion thread function. More... | |
| static size_t | set_bits (uint64_t *bitmap, size_t offset, size_t size) |
| void | reset_om (object_maintainance *om) |
| void | on_logistics_timer (uv_timer_t *timer, int status) |
The function thats called when the logistic thread wakes up. More... | |
| void | on_deletion_timer (uv_timer_t *timer, int status) |
The function thats called when the deletion thread wakes up. More... | |
| void | delete_object (MEMoidKey key, MEMoid oid) |
| The function to delete the object specified. More... | |
| void | move_to_dram (uv_work_t *req) |
| The function to move an object from NVRAM to DRAM. More... | |
| void | move_to_nvram (uv_work_t *req) |
| The function to move an object from DRAM to NVRAM. More... | |
| void | on_after_work (uv_work_t *req, int status) |
| int | check_if_required_to_delete (object_maintainance entry) |
| int | check_if_required_to_move (object_maintainance entry) |
| Checks if an object can be moved or not. More... | |
| void | create_maintainance_map () |
| object_maintainance * | create_new_maintainance_map_entry (MEMoidKey key, MEMoid oid, where_t which_ram, bool can_be_moved) |
| void | insert_into_maintainance_map (object_maintainance *obj) |
| void | delete_from_maintainance_map (object_maintainance *obj) |
| object_maintainance * | find_in_maintainance_map (MEMoidKey key) |
| void | create_addition_deletion_queues () |
Variables | |
| uv_mutex_t | object_maintainence_hashmap_mutex |
The mutex used during manupulation of types map More... | |
| uv_mutex_t | object_maintainence_memory_mutex |
The mutex used during nvm_free / access too. More... | |
| uv_mutex_t | object_maintainence_maintain_map_mutex |
The mutex used during manupulation of maintainance map More... | |
| uv_mutex_t | object_maintainence_addtion_mutex |
The mutex used during manupulation of maintainance map More... | |
| uv_mutex_t | object_maintainence_deletion_mutex |
The mutex used during manupulation of maintainance map More... | |
| uv_mutex_t | read_splay_tree_mutex |
The mutex used during manupulation of read splay tree More... | |
| uv_mutex_t | write_splay_tree_mutex |
The mutex used during manupulation of read splay tree More... | |
| int check_if_required_to_delete | ( | object_maintainance | entry | ) |
Definition at line 541 of file object_maintainance.c.
| int check_if_required_to_move | ( | object_maintainance | entry | ) |
Checks if an object can be moved or not.
| entry | The entry of the object under analysis from the object maintainance table. |
Definition at line 554 of file object_maintainance.c.
| int compare | ( | object_maintainance * | a, |
| object_maintainance * | b | ||
| ) |
Definition at line 26 of file object_maintainance.c.
| void create_addition_deletion_queues | ( | ) |
Definition at line 616 of file object_maintainance.c.
| void create_maintainance_map | ( | ) |
Definition at line 566 of file object_maintainance.c.
| object_maintainance* create_new_maintainance_map_entry | ( | MEMoidKey | key, |
| MEMoid | oid, | ||
| where_t | which_ram, | ||
| bool | can_be_moved | ||
| ) |
Definition at line 570 of file object_maintainance.c.
| void delete_from_maintainance_map | ( | object_maintainance * | obj | ) |
Definition at line 598 of file object_maintainance.c.
The function to delete the object specified.
| key | The MEMoidKey of the object that needs to be deleted. |
| oid | The MEMoid object that represents the object that needs to be deleted. |
object_maintainance table and types_table.Definition at line 359 of file object_maintainance.c.

| void* deletion_thread_function | ( | void * | data | ) |
The deletion thread function.
This function starts an uv_loop thats fired after every DELETE_LOOP_SLEEP_TIME amount of time.
| data | the loop that needs to be started |
Definition at line 135 of file object_maintainance.c.

| object_maintainance* find_in_maintainance_map | ( | MEMoidKey | key | ) |
| uint64_t get_hash | ( | object_maintainance * | entry | ) |
Definition at line 22 of file object_maintainance.c.
| HASH_MAP | ( | object_maintainance | ) |
Hashmap for object maintaince.
will be used by check_if_required_to_move()
Definition at line 48 of file object_maintainance.c.
| void initialise_logistics | ( | ) |
| void insert_into_maintainance_map | ( | object_maintainance * | obj | ) |
Definition at line 594 of file object_maintainance.c.
| void* logistics_thread_function | ( | void * | data | ) |
The logistics thread function.
This function starts an uv_loop thats fired after every MOVE_LOOP_SLEEP_TIME amount of time.
| data | the loop that needs to be started |
Definition at line 114 of file object_maintainance.c.

| void move_to_dram | ( | uv_work_t * | req | ) |
The function to move an object from NVRAM to DRAM.
| key | the MEMoidKey of the object that needs to be moved. |
| oid | the MEMoid object representing the object that needs to be moved. |
object_maintainance table and types_table Definition at line 414 of file object_maintainance.c.

| void move_to_nvram | ( | uv_work_t * | req | ) |
The function to move an object from DRAM to NVRAM.
| key | the MEMoidKey of the object that needs to be moved. |
| oid | the MEMoid object representing the object that needs to be moved. |
object_maintainance table and types_table Definition at line 477 of file object_maintainance.c.

| void on_after_work | ( | uv_work_t * | req, |
| int | status | ||
| ) |
Definition at line 531 of file object_maintainance.c.
| void on_deletion_timer | ( | uv_timer_t * | timer, |
| int | status | ||
| ) |
The function thats called when the deletion thread wakes up.
Here all the objects received from memfree() for deletion are deleted.
Definition at line 298 of file object_maintainance.c.

| void on_logistics_timer | ( | uv_timer_t * | timer, |
| int | status | ||
| ) |
The function thats called when the logistic thread wakes up.
Here at first all the new objects created by memalloc() are recorded. Then all the objects are updated using the stats revieved from log_write() and log_read(). And finally the decision for movement of object is made.
Definition at line 182 of file object_maintainance.c.

| void reset_om | ( | object_maintainance * | om | ) |
Definition at line 163 of file object_maintainance.c.
|
inlinestatic |
Definition at line 148 of file object_maintainance.c.
| void unlock_om | ( | ) |
Definition at line 75 of file object_maintainance.c.
| uv_mutex_t object_maintainence_addtion_mutex |
The mutex used during manupulation of maintainance map
Definition at line 16 of file object_maintainance.c.
| uv_mutex_t object_maintainence_deletion_mutex |
The mutex used during manupulation of maintainance map
Definition at line 17 of file object_maintainance.c.
| uv_mutex_t object_maintainence_hashmap_mutex |
The mutex used during manupulation of types map
Definition at line 13 of file object_maintainance.c.
| uv_mutex_t object_maintainence_maintain_map_mutex |
The mutex used during manupulation of maintainance map
Definition at line 15 of file object_maintainance.c.
| uv_mutex_t object_maintainence_memory_mutex |
The mutex used during nvm_free / access too.
Definition at line 14 of file object_maintainance.c.
| uv_mutex_t read_splay_tree_mutex |
The mutex used during manupulation of read splay tree
Definition at line 18 of file object_maintainance.c.
| uv_mutex_t write_splay_tree_mutex |
The mutex used during manupulation of read splay tree
Definition at line 19 of file object_maintainance.c.