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

Commit 54283aed authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'linux-kselftest-4.3-rc1' of...

Merge tag 'linux-kselftest-4.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull kselftest update from Shuah Khan:
 "This update adds new zram test and fixes to problems found during
  testing this new zram test.  In addition, there are a few bug fixes
  and ksefltest improvement patches from Linaro developers.

  I will send another update later on this week to fix kselftest
  breakage due to commit 2bf9e0ab ("locking/static_keys: Provide a
  selftest") after the fix soaks in next for a couple of days"

* tag 'linux-kselftest-4.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  selftests/zram: Makefile fix
  selftests/zram: must be run as root
  selftests: breakpoints: fix installing error on the architecture except x86
  selftests: check before install
  selftests/zram: Adding zram tests
parents 9a9952bb 7eba7d90
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ TARGETS += user
TARGETS += jumplabel
TARGETS += vm
TARGETS += x86
TARGETS += zram
#Please keep the TARGETS list alphabetically sorted
# Run "make quicktest=1 run_tests" or
# "make quicktest=1 kselftest from top level Makefile
@@ -72,7 +73,6 @@ ifdef INSTALL_PATH
	@# Ask all targets to install their files
	mkdir -p $(INSTALL_PATH)
	for TARGET in $(TARGETS); do \
		mkdir -p $(INSTALL_PATH)/$$TARGET ; \
		make -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \
	done;

+3 −13
Original line number Diff line number Diff line
# Taken from perf makefile
uname_M := $(shell uname -m 2>/dev/null || echo not)
ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/)
ifeq ($(ARCH),i386)
        ARCH := x86
endif
ifeq ($(ARCH),x86_64)
	ARCH := x86
endif
ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)


all:
ifeq ($(ARCH),x86)
	gcc breakpoint_test.c -o breakpoint_test
else
	echo "Not an x86 target, can't build breakpoints selftests"
TEST_PROGS := breakpoint_test
endif

TEST_PROGS := breakpoint_test
all:

include ../lib.mk

+8 −5
Original line number Diff line number Diff line
@@ -12,11 +12,14 @@ run_tests: all
	$(RUN_TESTS)

define INSTALL_RULE
	mkdir -p $(INSTALL_PATH)
	@for TEST_DIR in $(TEST_DIRS); do\
	@if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then			\
		mkdir -p $(INSTALL_PATH);								\
		for TEST_DIR in $(TEST_DIRS); do							\
			cp -r $$TEST_DIR $(INSTALL_PATH);						\
	done;
	install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)
		done;											\
		echo "install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)";	\
		install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES);		\
	fi
endef

install: all
+9 −0
Original line number Diff line number Diff line
all:

TEST_PROGS := zram.sh
TEST_FILES := zram01.sh zram02.sh zram_lib.sh

include ../lib.mk

clean:
	$(RM) err.log
+40 −0
Original line number Diff line number Diff line
zram: Compressed RAM based block devices
----------------------------------------
* Introduction

The zram module creates RAM based block devices named /dev/zram<id>
(<id> = 0, 1, ...). Pages written to these disks are compressed and stored
in memory itself. These disks allow very fast I/O and compression provides
good amounts of memory savings. Some of the usecases include /tmp storage,
use as swap disks, various caches under /var and maybe many more :)

Statistics for individual zram devices are exported through sysfs nodes at
/sys/block/zram<id>/

Kconfig required:
CONFIG_ZRAM=y
CONFIG_ZRAM_LZ4_COMPRESS=y
CONFIG_ZPOOL=y
CONFIG_ZSMALLOC=y

ZRAM Testcases
--------------
zram_lib.sh: create library with initialization/cleanup functions
zram.sh: For sanity check of CONFIG_ZRAM and to run zram01 and zram02

Two functional tests: zram01 and zram02:
zram01.sh: creates general purpose ram disks with ext4 filesystems
zram02.sh: creates block device for swap

Commands required for testing:
 - bc
 - dd
 - free
 - awk
 - mkswap
 - swapon
 - swapoff
 - mkfs/ mkfs.ext4

For more information please refer:
kernel-source-tree/Documentation/blockdev/zram.txt
Loading