Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 363295
b: refs/heads/master
c: e0d11ae
h: refs/heads/master
i:
  363293: 71b8c78
  363291: 880ab97
  363287: 1e30c38
  363279: d0bc413
  363263: 2f0623b
v: v3
  • Loading branch information
Konrad Rzeszutek Wilk authored and Greg Kroah-Hartman committed Mar 5, 2013
1 parent 912027d commit 64359e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 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: 6f4336fbbe666490b1dccb39b3c0499a051da09b
refs/heads/master: e0d11aed1966df0858564b58d2e355d36ff38e06
13 changes: 9 additions & 4 deletions trunk/drivers/staging/zcache/zcache-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,14 @@ static inline void dec_zcache_pers_zpages(unsigned zpages)
{
zcache_pers_zpages = atomic_sub_return(zpages, &zcache_pers_zpages_atomic);
}

static inline unsigned long curr_pageframes_count(void)
{
return zcache_pageframes_alloced -
atomic_read(&zcache_pageframes_freed_atomic) -
atomic_read(&zcache_eph_pageframes_atomic) -
atomic_read(&zcache_pers_pageframes_atomic);
};
/* but for the rest of these, counting races are ok */
static ssize_t zcache_flush_total;
static ssize_t zcache_flush_found;
Expand Down Expand Up @@ -565,10 +573,7 @@ static void zcache_free_page(struct page *page)
BUG();
__free_page(page);
inc_zcache_pageframes_freed();
curr_pageframes = zcache_pageframes_alloced -
atomic_read(&zcache_pageframes_freed_atomic) -
atomic_read(&zcache_eph_pageframes_atomic) -
atomic_read(&zcache_pers_pageframes_atomic);
curr_pageframes = curr_pageframes_count();
if (curr_pageframes > max_pageframes)
max_pageframes = curr_pageframes;
if (curr_pageframes < min_pageframes)
Expand Down

0 comments on commit 64359e3

Please sign in to comment.