Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f1bf5309 authored by Andreas Schneider's avatar Andreas Schneider
Browse files

SONY: mm:zram: Add up to 3x density storage for compressed pages

parent 693d01d3
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -7,6 +7,11 @@
 * storage pool implementations.  Typically, this is used to
 * store compressed memory.
 */
/*
 * NOTE: This file has been modified by Sony Mobile Communications Inc.
 * Modifications are Copyright (c) 2015 Sony Mobile Communications Inc,
 * and licensed under the license of the file.
 */

#ifndef _ZPOOL_H_
#define _ZPOOL_H_
@@ -60,6 +65,9 @@ void zpool_unmap_handle(struct zpool *pool, unsigned long handle);

u64 zpool_get_total_size(struct zpool *pool);

unsigned long zpool_compact(struct zpool *pool);

unsigned long zpool_get_num_compacted(struct zpool *zpool);

/**
 * struct zpool_driver - driver implementation for zpool
@@ -101,6 +109,10 @@ struct zpool_driver {
	void (*unmap)(void *pool, unsigned long handle);

	u64 (*total_size)(void *pool);

	unsigned long (*compact)(void *pool);

	unsigned long (*get_num_compacted)(void *pool);
};

void zpool_register_driver(struct zpool_driver *driver);
+11 −1
Original line number Diff line number Diff line
@@ -557,7 +557,7 @@ config ZPOOL
	  zsmalloc.

config ZBUD
	tristate "Low density storage for compressed pages"
	tristate "Low (Up to 2x) density storage for compressed pages"
	default n
	help
	  A special purpose allocator for storing compressed pages.
@@ -566,6 +566,16 @@ config ZBUD
	  deterministic reclaim properties that make it preferable to a higher
	  density approach when reclaim will be used.

config Z3FOLD
	tristate "Up to 3x density storage for compressed pages"
	depends on ZPOOL
	default n
	help
	  A special purpose allocator for storing compressed pages.
	  It is designed to store up to three compressed pages per physical
	  page. It is a ZBUD derivative so the simplicity and determinism are
	  still there.

config ZSMALLOC
	tristate "Memory allocator for compressed pages"
	depends on MMU
+1 −0
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ obj-$(CONFIG_MEMORY_ISOLATION) += page_isolation.o
obj-$(CONFIG_ZPOOL)	+= zpool.o
obj-$(CONFIG_ZBUD)	+= zbud.o
obj-$(CONFIG_ZSMALLOC)	+= zsmalloc.o
obj-$(CONFIG_Z3FOLD)	+= z3fold.o
obj-$(CONFIG_GENERIC_EARLY_IOREMAP) += early_ioremap.o
obj-$(CONFIG_CMA)	+= cma.o
obj-$(CONFIG_MEMORY_BALLOON) += balloon_compaction.o
+5 −0
Original line number Diff line number Diff line
@@ -4,6 +4,11 @@
 *  This work is licensed under the terms of the GNU GPL, version 2. See
 *  the COPYING file in the top-level directory.
 */
/*
 * NOTE: This file has been modified by Sony Mobile Communications Inc.
 * Modifications are Copyright (c) 2015 Sony Mobile Communications Inc,
 * and licensed under the license of the file.
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

+3 −0
Original line number Diff line number Diff line
@@ -1312,6 +1312,9 @@ unsigned long do_mmap(struct file *file, unsigned long addr,

	*populate = 0;

	while (file && (file->f_mode & FMODE_NONMAPPABLE))
		file = file->f_op->get_lower_file(file);

	if (!len)
		return -EINVAL;

Loading