Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
ramster.c File Reference
#include <linux/module.h>
#include <linux/cpu.h>
#include <linux/highmem.h>
#include <linux/list.h>
#include <linux/lzo.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/types.h>
#include <linux/atomic.h>
#include <linux/frontswap.h>
#include "../tmem.h"
#include "../zcache.h"
#include "../zbud.h"
#include "ramster.h"
#include "ramster_nodemanager.h"
#include "tcp.h"

Go to the source code of this file.

Macros

#define RAMSTER_TESTING
 
#define MANUAL_NODES   8
 
#define FLUSH_ENTIRE_OBJECT   ((uint32_t)-1)
 
#define RAMSTER_SYSFS_RO(_name)
 
#define RAMSTER_SYSFS_RW(_name)
 
#define RAMSTER_SYSFS_RO_ATOMIC(_name)
 

Functions

int ramster_do_preload_flnode (struct tmem_pool *pool)
 
int ramster_localify (int pool_id, struct tmem_oid *oidp, uint32_t index, char *data, unsigned int size, void *extra)
 
void ramster_pampd_new_obj (struct tmem_obj *obj)
 
void ramster_pampd_free_obj (struct tmem_pool *pool, struct tmem_obj *obj, bool pool_destroy)
 
voidramster_pampd_repatriate_preload (void *pampd, struct tmem_pool *pool, struct tmem_oid *oidp, uint32_t index, bool *intransit)
 
int ramster_pampd_repatriate (void *fake_pampd, void *real_pampd, struct tmem_pool *pool, struct tmem_oid *oid, uint32_t index, bool free, void *extra)
 
bool ramster_pampd_is_remote (void *pampd)
 
int ramster_pampd_replace_in_obj (void *new_pampd, struct tmem_obj *obj)
 
voidramster_pampd_free (void *pampd, struct tmem_pool *pool, struct tmem_oid *oid, uint32_t index, bool acct)
 
void ramster_count_foreign_pages (bool eph, int count)
 
int ramster_remotify_pageframe (bool eph)
 
void __init ramster_remotify_init (void)
 
 RAMSTER_SYSFS_RO (interface_revision)
 
 RAMSTER_SYSFS_RO_ATOMIC (remote_pers_pages)
 
 RAMSTER_SYSFS_RW (pers_remotify_enable)
 
 RAMSTER_SYSFS_RW (eph_remotify_enable)
 
 __setup ("noselfshrink", ramster_nofrontswap_selfshrink_setup)
 
void ramster_cpu_up (int cpu)
 
void ramster_cpu_down (int cpu)
 
void ramster_register_pamops (struct tmem_pamops *pamops)
 
void __init ramster_init (bool cleancache, bool frontswap, bool frontswap_exclusive_gets)
 

Macro Definition Documentation

#define FLUSH_ENTIRE_OBJECT   ((uint32_t)-1)

Definition at line 164 of file ramster.c.

#define MANUAL_NODES   8

Definition at line 62 of file ramster.c.

#define RAMSTER_SYSFS_RO (   _name)
Value:
static ssize_t ramster_##_name##_show(struct kobject *kobj, \
struct kobj_attribute *attr, char *buf) \
{ \
return sprintf(buf, "%lu\n", ramster_##_name); \
} \
static struct kobj_attribute ramster_##_name##_attr = { \
.attr = { .name = __stringify(_name), .mode = 0444 }, \
.show = ramster_##_name##_show, \
}

Definition at line 775 of file ramster.c.

#define RAMSTER_SYSFS_RO_ATOMIC (   _name)
Value:
static ssize_t ramster_##_name##_show(struct kobject *kobj, \
struct kobj_attribute *attr, char *buf) \
{ \
return sprintf(buf, "%d\n", atomic_read(&ramster_##_name)); \
} \
static struct kobj_attribute ramster_##_name##_attr = { \
.attr = { .name = __stringify(_name), .mode = 0444 }, \
.show = ramster_##_name##_show, \
}

Definition at line 809 of file ramster.c.

#define RAMSTER_SYSFS_RW (   _name)
Value:
static ssize_t ramster_##_name##_show(struct kobject *kobj, \
struct kobj_attribute *attr, char *buf) \
{ \
return sprintf(buf, "%lu\n", ramster_##_name); \
} \
static ssize_t ramster_##_name##_store(struct kobject *kobj, \
struct kobj_attribute *attr, const char *buf, size_t count) \
{ \
int err; \
unsigned long enable; \
err = kstrtoul(buf, 10, &enable); \
if (err) \
return -EINVAL; \
ramster_##_name = enable; \
return count; \
} \
static struct kobj_attribute ramster_##_name##_attr = { \
.attr = { .name = __stringify(_name), .mode = 0644 }, \
.show = ramster_##_name##_show, \
.store = ramster_##_name##_store, \
}

Definition at line 786 of file ramster.c.

#define RAMSTER_TESTING

Definition at line 46 of file ramster.c.

Function Documentation

__setup ( "noselfshrink"  ,
ramster_nofrontswap_selfshrink_setup   
)
void ramster_count_foreign_pages ( bool  eph,
int  count 
)

Definition at line 462 of file ramster.c.

void ramster_cpu_down ( int  cpu)

Definition at line 934 of file ramster.c.

void ramster_cpu_up ( int  cpu)

Definition at line 925 of file ramster.c.

int ramster_do_preload_flnode ( struct tmem_pool pool)

Definition at line 175 of file ramster.c.

void __init ramster_init ( bool  cleancache,
bool  frontswap,
bool  frontswap_exclusive_gets 
)

Definition at line 959 of file ramster.c.

int ramster_localify ( int  pool_id,
struct tmem_oid oidp,
uint32_t  index,
char data,
unsigned int  size,
void extra 
)

Definition at line 206 of file ramster.c.

void* ramster_pampd_free ( void pampd,
struct tmem_pool pool,
struct tmem_oid oid,
uint32_t  index,
bool  acct 
)

Definition at line 424 of file ramster.c.

void ramster_pampd_free_obj ( struct tmem_pool pool,
struct tmem_obj obj,
bool  pool_destroy 
)

Definition at line 299 of file ramster.c.

bool ramster_pampd_is_remote ( void pampd)

Definition at line 402 of file ramster.c.

void ramster_pampd_new_obj ( struct tmem_obj obj)

Definition at line 294 of file ramster.c.

int ramster_pampd_repatriate ( void fake_pampd,
void real_pampd,
struct tmem_pool pool,
struct tmem_oid oid,
uint32_t  index,
bool  free,
void extra 
)

Definition at line 381 of file ramster.c.

void* ramster_pampd_repatriate_preload ( void pampd,
struct tmem_pool pool,
struct tmem_oid oidp,
uint32_t  index,
bool intransit 
)

Definition at line 329 of file ramster.c.

int ramster_pampd_replace_in_obj ( void new_pampd,
struct tmem_obj obj 
)

Definition at line 407 of file ramster.c.

void ramster_register_pamops ( struct tmem_pamops pamops)

Definition at line 949 of file ramster.c.

void __init ramster_remotify_init ( void  )

Definition at line 677 of file ramster.c.

int ramster_remotify_pageframe ( bool  eph)

Definition at line 543 of file ramster.c.

RAMSTER_SYSFS_RO ( interface_revision  )
RAMSTER_SYSFS_RO_ATOMIC ( remote_pers_pages  )
RAMSTER_SYSFS_RW ( pers_remotify_enable  )
RAMSTER_SYSFS_RW ( eph_remotify_enable  )