mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
zram: use crc32c instead of jhash in dedup
crc32c is accelerated in arm64 and is faster than jhash. Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com> Change-Id: Ic4040e5ee941dca61fbfa6ac3b0f8d9a5f22a3dc Signed-off-by: Forenche <prahul2003@gmail.com> Signed-off-by: azrim <mirzaspc@gmail.com>
This commit is contained in:
parent
9a640a495a
commit
3a36008952
@ -42,7 +42,7 @@ config ZRAM_DEF_COMP
|
||||
|
||||
config ZRAM_DEDUP
|
||||
bool "Deduplication support for ZRAM data"
|
||||
depends on ZRAM
|
||||
depends on ZRAM && LIBCRC32C
|
||||
default n
|
||||
help
|
||||
Deduplicate ZRAM data to reduce amount of memory consumption.
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#include <linux/vmalloc.h>
|
||||
#include <linux/jhash.h>
|
||||
#include <linux/crc32c.h>
|
||||
#include <linux/highmem.h>
|
||||
|
||||
#include "zram_drv.h"
|
||||
@ -30,7 +30,7 @@ u64 zram_dedup_meta_size(struct zram *zram)
|
||||
|
||||
static u32 zram_dedup_checksum(unsigned char *mem)
|
||||
{
|
||||
return jhash(mem, PAGE_SIZE, 0);
|
||||
return crc32c(0, mem, PAGE_SIZE);
|
||||
}
|
||||
|
||||
void zram_dedup_insert(struct zram *zram, struct zram_entry *new,
|
||||
|
Loading…
x
Reference in New Issue
Block a user