xref: /aosp_15_r20/external/ltp/testcases/kernel/syscalls/madvise/madvise06.c (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1*49cdfc7eSAndroid Build Coastguard Worker // SPDX-License-Identifier: GPL-2.0-or-later
2*49cdfc7eSAndroid Build Coastguard Worker /*
3*49cdfc7eSAndroid Build Coastguard Worker  * Copyright (c) 2016 Red Hat, Inc.
4*49cdfc7eSAndroid Build Coastguard Worker  */
5*49cdfc7eSAndroid Build Coastguard Worker 
6*49cdfc7eSAndroid Build Coastguard Worker /*\
7*49cdfc7eSAndroid Build Coastguard Worker  * [Description]
8*49cdfc7eSAndroid Build Coastguard Worker  *
9*49cdfc7eSAndroid Build Coastguard Worker  * Page fault occurs in spite that madvise(WILLNEED) system call is called
10*49cdfc7eSAndroid Build Coastguard Worker  * to prefetch the page. This issue is reproduced by running a program
11*49cdfc7eSAndroid Build Coastguard Worker  * which sequentially accesses to a shared memory and calls madvise(WILLNEED)
12*49cdfc7eSAndroid Build Coastguard Worker  * to the next page on a page fault.
13*49cdfc7eSAndroid Build Coastguard Worker  *
14*49cdfc7eSAndroid Build Coastguard Worker  * This bug is present in all RHEL7 versions. It looks like this was fixed in
15*49cdfc7eSAndroid Build Coastguard Worker  * mainline kernel > v3.15 by the following patch:
16*49cdfc7eSAndroid Build Coastguard Worker  *
17*49cdfc7eSAndroid Build Coastguard Worker  *  commit 55231e5c898c5c03c14194001e349f40f59bd300
18*49cdfc7eSAndroid Build Coastguard Worker  *  Author: Johannes Weiner <[email protected]>
19*49cdfc7eSAndroid Build Coastguard Worker  *  Date:   Thu May 22 11:54:17 2014 -0700
20*49cdfc7eSAndroid Build Coastguard Worker  *
21*49cdfc7eSAndroid Build Coastguard Worker  *     mm: madvise: fix MADV_WILLNEED on shmem swapouts
22*49cdfc7eSAndroid Build Coastguard Worker  *
23*49cdfc7eSAndroid Build Coastguard Worker  * Two checks are performed, the first looks at how SwapCache
24*49cdfc7eSAndroid Build Coastguard Worker  * changes during madvise. When the pages are dirtied, about half
25*49cdfc7eSAndroid Build Coastguard Worker  * will be accounted for under Cached and the other half will be
26*49cdfc7eSAndroid Build Coastguard Worker  * moved into Swap. When madvise is run it will cause the pages
27*49cdfc7eSAndroid Build Coastguard Worker  * under Cached to also be moved to Swap while rotating the pages
28*49cdfc7eSAndroid Build Coastguard Worker  * already in Swap into SwapCached. So we expect that SwapCached has
29*49cdfc7eSAndroid Build Coastguard Worker  * roughly MEM_LIMIT bytes added to it, but for reliability the
30*49cdfc7eSAndroid Build Coastguard Worker  * PASS_THRESHOLD is much lower than that.
31*49cdfc7eSAndroid Build Coastguard Worker  *
32*49cdfc7eSAndroid Build Coastguard Worker  * Secondly we run madvise again, but only on the first
33*49cdfc7eSAndroid Build Coastguard Worker  * PASS_THRESHOLD bytes to ensure these are entirely in RAM. Then we
34*49cdfc7eSAndroid Build Coastguard Worker  * dirty these pages and check there were (almost) no page
35*49cdfc7eSAndroid Build Coastguard Worker  * faults. Two faults are allowed incase some tasklet or something
36*49cdfc7eSAndroid Build Coastguard Worker  * else unexpected, but irrelevant procedure, registers a fault to
37*49cdfc7eSAndroid Build Coastguard Worker  * our process.
38*49cdfc7eSAndroid Build Coastguard Worker  *
39*49cdfc7eSAndroid Build Coastguard Worker  * It also can reproduce the MADV_WILLNEED preformance problem.
40*49cdfc7eSAndroid Build Coastguard Worker  * It was introduced since 5.9 kernel with the following commit
41*49cdfc7eSAndroid Build Coastguard Worker  *   e6e88712e43b ("mm: optimise madvise WILLNEED")
42*49cdfc7eSAndroid Build Coastguard Worker  * and fixed since 5.10-rc5 kernel with the following commit
43*49cdfc7eSAndroid Build Coastguard Worker  *   66383800df9c ("mm: fix madvise WILLNEED performance problem").
44*49cdfc7eSAndroid Build Coastguard Worker  */
45*49cdfc7eSAndroid Build Coastguard Worker 
46*49cdfc7eSAndroid Build Coastguard Worker #include <errno.h>
47*49cdfc7eSAndroid Build Coastguard Worker #include <stdio.h>
48*49cdfc7eSAndroid Build Coastguard Worker #include <sys/mount.h>
49*49cdfc7eSAndroid Build Coastguard Worker #include <sys/sysinfo.h>
50*49cdfc7eSAndroid Build Coastguard Worker #include "tst_test.h"
51*49cdfc7eSAndroid Build Coastguard Worker 
52*49cdfc7eSAndroid Build Coastguard Worker #define CHUNK_SZ (400*1024*1024L)
53*49cdfc7eSAndroid Build Coastguard Worker #define MEM_LIMIT (CHUNK_SZ / 2)
54*49cdfc7eSAndroid Build Coastguard Worker #define MEMSW_LIMIT (2 * CHUNK_SZ)
55*49cdfc7eSAndroid Build Coastguard Worker #define PASS_THRESHOLD (CHUNK_SZ / 4)
56*49cdfc7eSAndroid Build Coastguard Worker #define PASS_THRESHOLD_KB (PASS_THRESHOLD / 1024)
57*49cdfc7eSAndroid Build Coastguard Worker 
58*49cdfc7eSAndroid Build Coastguard Worker static const char drop_caches_fname[] = "/proc/sys/vm/drop_caches";
59*49cdfc7eSAndroid Build Coastguard Worker static int pg_sz, stat_refresh_sup;
60*49cdfc7eSAndroid Build Coastguard Worker 
61*49cdfc7eSAndroid Build Coastguard Worker static long init_swap, init_swap_cached, init_cached;
62*49cdfc7eSAndroid Build Coastguard Worker 
check_path(const char * path)63*49cdfc7eSAndroid Build Coastguard Worker static void check_path(const char *path)
64*49cdfc7eSAndroid Build Coastguard Worker {
65*49cdfc7eSAndroid Build Coastguard Worker 	if (access(path, R_OK | W_OK))
66*49cdfc7eSAndroid Build Coastguard Worker 		tst_brk(TCONF, "file needed: %s", path);
67*49cdfc7eSAndroid Build Coastguard Worker }
68*49cdfc7eSAndroid Build Coastguard Worker 
print_cgmem(const char * name)69*49cdfc7eSAndroid Build Coastguard Worker static void print_cgmem(const char *name)
70*49cdfc7eSAndroid Build Coastguard Worker {
71*49cdfc7eSAndroid Build Coastguard Worker 	long ret;
72*49cdfc7eSAndroid Build Coastguard Worker 
73*49cdfc7eSAndroid Build Coastguard Worker 	if (!SAFE_CG_HAS(tst_cg, name))
74*49cdfc7eSAndroid Build Coastguard Worker 		return;
75*49cdfc7eSAndroid Build Coastguard Worker 
76*49cdfc7eSAndroid Build Coastguard Worker 	SAFE_CG_SCANF(tst_cg, name, "%ld", &ret);
77*49cdfc7eSAndroid Build Coastguard Worker 	tst_res(TINFO, "\t%s: %ld Kb", name, ret / 1024);
78*49cdfc7eSAndroid Build Coastguard Worker }
79*49cdfc7eSAndroid Build Coastguard Worker 
meminfo_diag(const char * point)80*49cdfc7eSAndroid Build Coastguard Worker static void meminfo_diag(const char *point)
81*49cdfc7eSAndroid Build Coastguard Worker {
82*49cdfc7eSAndroid Build Coastguard Worker 	if (stat_refresh_sup)
83*49cdfc7eSAndroid Build Coastguard Worker 		SAFE_FILE_PRINTF("/proc/sys/vm/stat_refresh", "1");
84*49cdfc7eSAndroid Build Coastguard Worker 
85*49cdfc7eSAndroid Build Coastguard Worker 	tst_res(TINFO, "%s", point);
86*49cdfc7eSAndroid Build Coastguard Worker 	tst_res(TINFO, "\tSwap: %ld Kb",
87*49cdfc7eSAndroid Build Coastguard Worker 		SAFE_READ_MEMINFO("SwapTotal:") - SAFE_READ_MEMINFO("SwapFree:") - init_swap);
88*49cdfc7eSAndroid Build Coastguard Worker 	tst_res(TINFO, "\tSwapCached: %ld Kb",
89*49cdfc7eSAndroid Build Coastguard Worker 		SAFE_READ_MEMINFO("SwapCached:") - init_swap_cached);
90*49cdfc7eSAndroid Build Coastguard Worker 	tst_res(TINFO, "\tCached: %ld Kb",
91*49cdfc7eSAndroid Build Coastguard Worker 		SAFE_READ_MEMINFO("Cached:") - init_cached);
92*49cdfc7eSAndroid Build Coastguard Worker 
93*49cdfc7eSAndroid Build Coastguard Worker 	print_cgmem("memory.current");
94*49cdfc7eSAndroid Build Coastguard Worker 	print_cgmem("memory.swap.current");
95*49cdfc7eSAndroid Build Coastguard Worker 	print_cgmem("memory.kmem.usage_in_bytes");
96*49cdfc7eSAndroid Build Coastguard Worker }
97*49cdfc7eSAndroid Build Coastguard Worker 
setup(void)98*49cdfc7eSAndroid Build Coastguard Worker static void setup(void)
99*49cdfc7eSAndroid Build Coastguard Worker {
100*49cdfc7eSAndroid Build Coastguard Worker 	struct sysinfo sys_buf_start;
101*49cdfc7eSAndroid Build Coastguard Worker 
102*49cdfc7eSAndroid Build Coastguard Worker 	pg_sz = getpagesize();
103*49cdfc7eSAndroid Build Coastguard Worker 
104*49cdfc7eSAndroid Build Coastguard Worker 	tst_res(TINFO, "dropping caches");
105*49cdfc7eSAndroid Build Coastguard Worker 	sync();
106*49cdfc7eSAndroid Build Coastguard Worker 	SAFE_FILE_PRINTF(drop_caches_fname, "3");
107*49cdfc7eSAndroid Build Coastguard Worker 
108*49cdfc7eSAndroid Build Coastguard Worker 	sysinfo(&sys_buf_start);
109*49cdfc7eSAndroid Build Coastguard Worker 	if (sys_buf_start.freeram < 2 * CHUNK_SZ) {
110*49cdfc7eSAndroid Build Coastguard Worker 		tst_brk(TCONF, "System RAM is too small (%li bytes needed)",
111*49cdfc7eSAndroid Build Coastguard Worker 			2 * CHUNK_SZ);
112*49cdfc7eSAndroid Build Coastguard Worker 	}
113*49cdfc7eSAndroid Build Coastguard Worker 	if (sys_buf_start.freeswap < 2 * CHUNK_SZ) {
114*49cdfc7eSAndroid Build Coastguard Worker 		tst_brk(TCONF, "System swap is too small (%li bytes needed)",
115*49cdfc7eSAndroid Build Coastguard Worker 			2 * CHUNK_SZ);
116*49cdfc7eSAndroid Build Coastguard Worker 	}
117*49cdfc7eSAndroid Build Coastguard Worker 
118*49cdfc7eSAndroid Build Coastguard Worker 	check_path("/proc/self/oom_score_adj");
119*49cdfc7eSAndroid Build Coastguard Worker 	SAFE_FILE_PRINTF("/proc/self/oom_score_adj", "%d", -1000);
120*49cdfc7eSAndroid Build Coastguard Worker 
121*49cdfc7eSAndroid Build Coastguard Worker 	SAFE_CG_PRINTF(tst_cg, "memory.max", "%ld", MEM_LIMIT);
122*49cdfc7eSAndroid Build Coastguard Worker 	if (SAFE_CG_HAS(tst_cg, "memory.swap.max"))
123*49cdfc7eSAndroid Build Coastguard Worker 		SAFE_CG_PRINTF(tst_cg, "memory.swap.max", "%ld", MEMSW_LIMIT);
124*49cdfc7eSAndroid Build Coastguard Worker 
125*49cdfc7eSAndroid Build Coastguard Worker 	if (SAFE_CG_HAS(tst_cg, "memory.swappiness")) {
126*49cdfc7eSAndroid Build Coastguard Worker 		SAFE_CG_PRINT(tst_cg, "memory.swappiness", "60");
127*49cdfc7eSAndroid Build Coastguard Worker 	} else {
128*49cdfc7eSAndroid Build Coastguard Worker 		check_path("/proc/sys/vm/swappiness");
129*49cdfc7eSAndroid Build Coastguard Worker 		SAFE_FILE_PRINTF("/proc/sys/vm/swappiness", "%d", 60);
130*49cdfc7eSAndroid Build Coastguard Worker 	}
131*49cdfc7eSAndroid Build Coastguard Worker 
132*49cdfc7eSAndroid Build Coastguard Worker 	SAFE_CG_PRINTF(tst_cg, "cgroup.procs", "%d", getpid());
133*49cdfc7eSAndroid Build Coastguard Worker 
134*49cdfc7eSAndroid Build Coastguard Worker 	meminfo_diag("Initial meminfo, later values are relative to this (except memcg)");
135*49cdfc7eSAndroid Build Coastguard Worker 	init_swap = SAFE_READ_MEMINFO("SwapTotal:") - SAFE_READ_MEMINFO("SwapFree:");
136*49cdfc7eSAndroid Build Coastguard Worker 	init_swap_cached = SAFE_READ_MEMINFO("SwapCached:");
137*49cdfc7eSAndroid Build Coastguard Worker 	init_cached = SAFE_READ_MEMINFO("Cached:");
138*49cdfc7eSAndroid Build Coastguard Worker 
139*49cdfc7eSAndroid Build Coastguard Worker 	if (!access("/proc/sys/vm/stat_refresh", W_OK))
140*49cdfc7eSAndroid Build Coastguard Worker 		stat_refresh_sup = 1;
141*49cdfc7eSAndroid Build Coastguard Worker 
142*49cdfc7eSAndroid Build Coastguard Worker 	tst_res(TINFO, "mapping %ld Kb (%ld pages), limit %ld Kb, pass threshold %ld Kb",
143*49cdfc7eSAndroid Build Coastguard Worker 		CHUNK_SZ / 1024, CHUNK_SZ / pg_sz, MEM_LIMIT / 1024, PASS_THRESHOLD_KB);
144*49cdfc7eSAndroid Build Coastguard Worker }
145*49cdfc7eSAndroid Build Coastguard Worker 
dirty_pages(char * ptr,long size)146*49cdfc7eSAndroid Build Coastguard Worker static void dirty_pages(char *ptr, long size)
147*49cdfc7eSAndroid Build Coastguard Worker {
148*49cdfc7eSAndroid Build Coastguard Worker 	long i;
149*49cdfc7eSAndroid Build Coastguard Worker 	long pages = size / pg_sz;
150*49cdfc7eSAndroid Build Coastguard Worker 
151*49cdfc7eSAndroid Build Coastguard Worker 	for (i = 0; i < pages; i++)
152*49cdfc7eSAndroid Build Coastguard Worker 		ptr[i * pg_sz] = 'x';
153*49cdfc7eSAndroid Build Coastguard Worker }
154*49cdfc7eSAndroid Build Coastguard Worker 
get_page_fault_num(void)155*49cdfc7eSAndroid Build Coastguard Worker static int get_page_fault_num(void)
156*49cdfc7eSAndroid Build Coastguard Worker {
157*49cdfc7eSAndroid Build Coastguard Worker 	int pg;
158*49cdfc7eSAndroid Build Coastguard Worker 
159*49cdfc7eSAndroid Build Coastguard Worker 	SAFE_FILE_SCANF("/proc/self/stat",
160*49cdfc7eSAndroid Build Coastguard Worker 			"%*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %d",
161*49cdfc7eSAndroid Build Coastguard Worker 			&pg);
162*49cdfc7eSAndroid Build Coastguard Worker 	return pg;
163*49cdfc7eSAndroid Build Coastguard Worker }
164*49cdfc7eSAndroid Build Coastguard Worker 
test_advice_willneed(void)165*49cdfc7eSAndroid Build Coastguard Worker static void test_advice_willneed(void)
166*49cdfc7eSAndroid Build Coastguard Worker {
167*49cdfc7eSAndroid Build Coastguard Worker 	int loops = 100, res;
168*49cdfc7eSAndroid Build Coastguard Worker 	char *target;
169*49cdfc7eSAndroid Build Coastguard Worker 	long swapcached_start, swapcached;
170*49cdfc7eSAndroid Build Coastguard Worker 	int page_fault_num_1, page_fault_num_2;
171*49cdfc7eSAndroid Build Coastguard Worker 
172*49cdfc7eSAndroid Build Coastguard Worker 	meminfo_diag("Before mmap");
173*49cdfc7eSAndroid Build Coastguard Worker 	tst_res(TINFO, "PageFault(before mmap): %d", get_page_fault_num());
174*49cdfc7eSAndroid Build Coastguard Worker 	target = SAFE_MMAP(NULL, CHUNK_SZ, PROT_READ | PROT_WRITE,
175*49cdfc7eSAndroid Build Coastguard Worker 			MAP_SHARED | MAP_ANONYMOUS,
176*49cdfc7eSAndroid Build Coastguard Worker 			-1, 0);
177*49cdfc7eSAndroid Build Coastguard Worker 	meminfo_diag("Before dirty");
178*49cdfc7eSAndroid Build Coastguard Worker 	tst_res(TINFO, "PageFault(before dirty): %d", get_page_fault_num());
179*49cdfc7eSAndroid Build Coastguard Worker 	dirty_pages(target, CHUNK_SZ);
180*49cdfc7eSAndroid Build Coastguard Worker 	tst_res(TINFO, "PageFault(after dirty): %d", get_page_fault_num());
181*49cdfc7eSAndroid Build Coastguard Worker 
182*49cdfc7eSAndroid Build Coastguard Worker 	meminfo_diag("Before madvise");
183*49cdfc7eSAndroid Build Coastguard Worker 	SAFE_FILE_LINES_SCANF("/proc/meminfo", "SwapCached: %ld",
184*49cdfc7eSAndroid Build Coastguard Worker 		&swapcached_start);
185*49cdfc7eSAndroid Build Coastguard Worker 
186*49cdfc7eSAndroid Build Coastguard Worker 	TEST(madvise(target, MEM_LIMIT, MADV_WILLNEED));
187*49cdfc7eSAndroid Build Coastguard Worker 	if (TST_RET == -1)
188*49cdfc7eSAndroid Build Coastguard Worker 		tst_brk(TBROK | TTERRNO, "madvise failed");
189*49cdfc7eSAndroid Build Coastguard Worker 
190*49cdfc7eSAndroid Build Coastguard Worker 	do {
191*49cdfc7eSAndroid Build Coastguard Worker 		loops--;
192*49cdfc7eSAndroid Build Coastguard Worker 		usleep(100000);
193*49cdfc7eSAndroid Build Coastguard Worker 		if (stat_refresh_sup)
194*49cdfc7eSAndroid Build Coastguard Worker 			SAFE_FILE_PRINTF("/proc/sys/vm/stat_refresh", "1");
195*49cdfc7eSAndroid Build Coastguard Worker 		SAFE_FILE_LINES_SCANF("/proc/meminfo", "SwapCached: %ld",
196*49cdfc7eSAndroid Build Coastguard Worker 			&swapcached);
197*49cdfc7eSAndroid Build Coastguard Worker 	} while (swapcached < swapcached_start + PASS_THRESHOLD_KB && loops > 0);
198*49cdfc7eSAndroid Build Coastguard Worker 
199*49cdfc7eSAndroid Build Coastguard Worker 	meminfo_diag("After madvise");
200*49cdfc7eSAndroid Build Coastguard Worker 	res = swapcached > swapcached_start + PASS_THRESHOLD_KB;
201*49cdfc7eSAndroid Build Coastguard Worker 	tst_res(res ? TPASS : TINFO,
202*49cdfc7eSAndroid Build Coastguard Worker 		"%s than %ld Kb were moved to the swap cache",
203*49cdfc7eSAndroid Build Coastguard Worker 		res ? "more" : "less", PASS_THRESHOLD_KB);
204*49cdfc7eSAndroid Build Coastguard Worker 
205*49cdfc7eSAndroid Build Coastguard Worker 	loops = 100;
206*49cdfc7eSAndroid Build Coastguard Worker 	SAFE_FILE_LINES_SCANF("/proc/meminfo", "SwapCached: %ld", &swapcached_start);
207*49cdfc7eSAndroid Build Coastguard Worker 	TEST(madvise(target, pg_sz * 3, MADV_WILLNEED));
208*49cdfc7eSAndroid Build Coastguard Worker 	if (TST_RET == -1)
209*49cdfc7eSAndroid Build Coastguard Worker 		tst_brk(TBROK | TTERRNO, "madvise failed");
210*49cdfc7eSAndroid Build Coastguard Worker 	do {
211*49cdfc7eSAndroid Build Coastguard Worker 		loops--;
212*49cdfc7eSAndroid Build Coastguard Worker 		usleep(100000);
213*49cdfc7eSAndroid Build Coastguard Worker 		if (stat_refresh_sup)
214*49cdfc7eSAndroid Build Coastguard Worker 			SAFE_FILE_PRINTF("/proc/sys/vm/stat_refresh", "1");
215*49cdfc7eSAndroid Build Coastguard Worker 		SAFE_FILE_LINES_SCANF("/proc/meminfo", "SwapCached: %ld",
216*49cdfc7eSAndroid Build Coastguard Worker 				&swapcached);
217*49cdfc7eSAndroid Build Coastguard Worker 	} while (swapcached < swapcached_start + pg_sz*3/1024 && loops > 0);
218*49cdfc7eSAndroid Build Coastguard Worker 
219*49cdfc7eSAndroid Build Coastguard Worker 	page_fault_num_1 = get_page_fault_num();
220*49cdfc7eSAndroid Build Coastguard Worker 	tst_res(TINFO, "PageFault(madvice / no mem access): %d",
221*49cdfc7eSAndroid Build Coastguard Worker 			page_fault_num_1);
222*49cdfc7eSAndroid Build Coastguard Worker 	dirty_pages(target, pg_sz * 3);
223*49cdfc7eSAndroid Build Coastguard Worker 	page_fault_num_2 = get_page_fault_num();
224*49cdfc7eSAndroid Build Coastguard Worker 	tst_res(TINFO, "PageFault(madvice / mem access): %d",
225*49cdfc7eSAndroid Build Coastguard Worker 			page_fault_num_2);
226*49cdfc7eSAndroid Build Coastguard Worker 	meminfo_diag("After page access");
227*49cdfc7eSAndroid Build Coastguard Worker 
228*49cdfc7eSAndroid Build Coastguard Worker 	res = page_fault_num_2 - page_fault_num_1;
229*49cdfc7eSAndroid Build Coastguard Worker 	tst_res(res == 0 ? TPASS : TINFO,
230*49cdfc7eSAndroid Build Coastguard Worker 		"%d pages were faulted out of 3 max", res);
231*49cdfc7eSAndroid Build Coastguard Worker 
232*49cdfc7eSAndroid Build Coastguard Worker 	SAFE_MUNMAP(target, CHUNK_SZ);
233*49cdfc7eSAndroid Build Coastguard Worker 
234*49cdfc7eSAndroid Build Coastguard Worker 	if (tst_taint_check())
235*49cdfc7eSAndroid Build Coastguard Worker 		tst_res(TFAIL, "Kernel tainted");
236*49cdfc7eSAndroid Build Coastguard Worker 	else
237*49cdfc7eSAndroid Build Coastguard Worker 		tst_res(TPASS, "No kernel taints");
238*49cdfc7eSAndroid Build Coastguard Worker }
239*49cdfc7eSAndroid Build Coastguard Worker 
240*49cdfc7eSAndroid Build Coastguard Worker static struct tst_test test = {
241*49cdfc7eSAndroid Build Coastguard Worker 	.test_all = test_advice_willneed,
242*49cdfc7eSAndroid Build Coastguard Worker 	.setup = setup,
243*49cdfc7eSAndroid Build Coastguard Worker 	.needs_tmpdir = 1,
244*49cdfc7eSAndroid Build Coastguard Worker 	.needs_root = 1,
245*49cdfc7eSAndroid Build Coastguard Worker 	.max_runtime = 60,
246*49cdfc7eSAndroid Build Coastguard Worker 	.taint_check = TST_TAINT_W | TST_TAINT_D,
247*49cdfc7eSAndroid Build Coastguard Worker 	.save_restore = (const struct tst_path_val[]) {
248*49cdfc7eSAndroid Build Coastguard Worker 		{"/proc/sys/vm/swappiness", NULL,
249*49cdfc7eSAndroid Build Coastguard Worker 			TST_SR_SKIP_MISSING | TST_SR_TCONF_RO},
250*49cdfc7eSAndroid Build Coastguard Worker 		{}
251*49cdfc7eSAndroid Build Coastguard Worker 	},
252*49cdfc7eSAndroid Build Coastguard Worker 	.needs_cgroup_ctrls = (const char *const []){ "memory", NULL },
253*49cdfc7eSAndroid Build Coastguard Worker 	.tags = (const struct tst_tag[]) {
254*49cdfc7eSAndroid Build Coastguard Worker 		{"linux-git", "55231e5c898c"},
255*49cdfc7eSAndroid Build Coastguard Worker 		{"linux-git", "8de15e920dc8"},
256*49cdfc7eSAndroid Build Coastguard Worker 		{"linux-git", "66383800df9c"},
257*49cdfc7eSAndroid Build Coastguard Worker 		{}
258*49cdfc7eSAndroid Build Coastguard Worker 	}
259*49cdfc7eSAndroid Build Coastguard Worker };
260