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

Commit ffd32d2b authored by Vivek Kumar's avatar Vivek Kumar Committed by Gerrit - the friendly Code Review server
Browse files

PM: Hibernate: Add option to disable disk offset randomization



Add a kernel parameter to disable the disk offset randomization
for SSD devices in which such feature is available at the
firmware level. This is helpful in improving hibernation
resume time.

Change-Id: Ic1739bf63ad8cf3e71500e12552d4382da617341
Signed-off-by: default avatarVivek Kumar <vivekuma@codeaurora.org>
parent 495096f0
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -3800,6 +3800,17 @@
				(that will set all pages holding image data
				during restoration read-only).

	noswap_randomize
			Kernel uses random disk offsets to help with wear-levelling
			of SSD devices, while saving the hibernation snapshot image to
			disk. Use this parameter to disable this feature for SSD
			devices in scenarios when, such randomization is addressed at
			the firmware level and hibenration image is not re-generated
			frequently.
			(Useful for improving hibernation resume time as snapshot pages
			are available in disk serially and can be read in bigger chunks
			without seeking)

	retain_initrd	[RAM] Keep initrd memory after extraction

	rfkill.default_state=
+9 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@
 */
static bool clean_pages_on_read;
static bool clean_pages_on_decompress;
static bool noswap_randomize;

/*
 *	The swap map is a data structure used for keeping track of each page
@@ -1620,3 +1621,11 @@ static int swsusp_header_init(void)
}

core_initcall(swsusp_header_init);

static int __init noswap_randomize_setup(char *str)
{
	noswap_randomize = true;
	return 1;
}

__setup("noswap_randomize", noswap_randomize_setup);