Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 262893
b: refs/heads/master
c: 3ca15c4
h: refs/heads/master
i:
  262891: 4f9dbb4
v: v3
  • Loading branch information
Thadeu Lima de Souza Cascardo authored and Greg Kroah-Hartman committed Aug 8, 2011
1 parent 92c8bc6 commit 9c59617
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 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: f704648281831fbb8a4ca1acbe18cb84bc0267c8
refs/heads/master: 3ca15c4486beb113700cda44e32109cf0d97528b
7 changes: 5 additions & 2 deletions trunk/drivers/staging/zcache/zcache-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <linux/spinlock.h>
#include <linux/types.h>
#include <linux/atomic.h>
#include <linux/math64.h>
#include "tmem.h"

#include "../zram/xvmalloc.h" /* if built in drivers/staging */
Expand Down Expand Up @@ -1162,6 +1163,7 @@ static void *zcache_pampd_create(char *data, size_t size, bool raw, int eph,
uint16_t client_id = get_client_id_from_client(cli);
unsigned long zv_mean_zsize;
unsigned long curr_pers_pampd_count;
u64 total_zsize;

if (eph) {
ret = zcache_compress(page, &cdata, &clen);
Expand Down Expand Up @@ -1194,8 +1196,9 @@ static void *zcache_pampd_create(char *data, size_t size, bool raw, int eph,
}
/* reject if mean compression is too poor */
if ((clen > zv_max_mean_zsize) && (curr_pers_pampd_count > 0)) {
zv_mean_zsize = xv_get_total_size_bytes(cli->xvpool) /
curr_pers_pampd_count;
total_zsize = xv_get_total_size_bytes(cli->xvpool);
zv_mean_zsize = div_u64(total_zsize,
curr_pers_pampd_count);
if (zv_mean_zsize > zv_max_mean_zsize) {
zcache_mean_compress_poor++;
goto out;
Expand Down

0 comments on commit 9c59617

Please sign in to comment.