Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 364123
b: refs/heads/master
c: 93cc39b
h: refs/heads/master
i:
  364121: 64b583b
  364119: 120a899
v: v3
  • Loading branch information
Wanpeng Li authored and Greg Kroah-Hartman committed Apr 11, 2013
1 parent ec3464f commit 6202118
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6706c721b22aadffbffec7550b81efedddd05cfb
refs/heads/master: 93cc39b64c492cede5b45232387344f745c61686
34 changes: 23 additions & 11 deletions trunk/drivers/staging/zcache/ramster/ramster.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,32 @@ static int ramster_remote_target_nodenum __read_mostly = -1;
static long ramster_flnodes;
static atomic_t ramster_flnodes_atomic = ATOMIC_INIT(0);
static unsigned long ramster_flnodes_max;
static inline void inc_ramster_flnodes(void)
{
ramster_flnodes = atomic_inc_return(&ramster_flnodes_atomic);
if (ramster_flnodes > ramster_flnodes_max)
ramster_flnodes_max = ramster_flnodes;
}
static ssize_t ramster_foreign_eph_pages;
static atomic_t ramster_foreign_eph_pages_atomic = ATOMIC_INIT(0);
static ssize_t ramster_foreign_eph_pages_max;
static inline void inc_ramster_foreign_eph_pages(void)
{
ramster_foreign_eph_pages = atomic_inc_return(
&ramster_foreign_eph_pages_atomic);
if (ramster_foreign_eph_pages > ramster_foreign_eph_pages_max)
ramster_foreign_eph_pages_max = ramster_foreign_eph_pages;
}
static ssize_t ramster_foreign_pers_pages;
static atomic_t ramster_foreign_pers_pages_atomic = ATOMIC_INIT(0);
static ssize_t ramster_foreign_pers_pages_max;
static inline void inc_ramster_foreign_pers_pages(void)
{
ramster_foreign_pers_pages = atomic_inc_return(
&ramster_foreign_pers_pages_atomic);
if (ramster_foreign_pers_pages > ramster_foreign_pers_pages_max)
ramster_foreign_pers_pages_max = ramster_foreign_pers_pages;
}
static ssize_t ramster_eph_pages_remoted;
static ssize_t ramster_pers_pages_remoted;
static ssize_t ramster_eph_pages_remote_failed;
Expand Down Expand Up @@ -159,9 +179,7 @@ static struct flushlist_node *ramster_flnode_alloc(struct tmem_pool *pool)
flnode = kp->flnode;
BUG_ON(flnode == NULL);
kp->flnode = NULL;
ramster_flnodes = atomic_inc_return(&ramster_flnodes_atomic);
if (ramster_flnodes > ramster_flnodes_max)
ramster_flnodes_max = ramster_flnodes;
inc_ramster_flnodes();
return flnode;
}

Expand Down Expand Up @@ -471,21 +489,15 @@ void ramster_count_foreign_pages(bool eph, int count)
BUG_ON(count != 1 && count != -1);
if (eph) {
if (count > 0) {
c = atomic_inc_return(
&ramster_foreign_eph_pages_atomic);
if (c > ramster_foreign_eph_pages_max)
ramster_foreign_eph_pages_max = c;
inc_ramster_foreign_eph_pages();
} else {
c = atomic_dec_return(&ramster_foreign_eph_pages_atomic);
WARN_ON_ONCE(c < 0);
}
ramster_foreign_eph_pages = c;
} else {
if (count > 0) {
c = atomic_inc_return(
&ramster_foreign_pers_pages_atomic);
if (c > ramster_foreign_pers_pages_max)
ramster_foreign_pers_pages_max = c;
inc_ramster_foreign_pers_pages();
} else {
c = atomic_dec_return(
&ramster_foreign_pers_pages_atomic);
Expand Down

0 comments on commit 6202118

Please sign in to comment.