Commit c1b1880b authored by Pavel Emelyanov's avatar Pavel Emelyanov

zdtm: Check how auto-dedup works

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent df006762
# Check auto-deduplication of pagemaps
set -e
source `dirname $0`/criu-lib.sh
prep
./test/zdtm.py run --all --report report --parallel 4 -f h --pre 2 --dedup -x maps04 -x maps007 || fail
# Additionally run these two as they touch a lot of
# memory and it makes sense to additionally check it
# with delays petween iterations
./test/zdtm.py run -t zdtm/live/transition/maps007 --report report -f h --pre 8:.1 --dedup || fail
./test/zdtm.py run -t zdtm/live/static/mem-touch --report report -f h --pre 8:.1 --dedup || fail
...@@ -474,6 +474,7 @@ class criu_cli: ...@@ -474,6 +474,7 @@ class criu_cli:
self.__restore_sibling = (opts['sibling'] and True or False) self.__restore_sibling = (opts['sibling'] and True or False)
self.__fault = (opts['fault']) self.__fault = (opts['fault'])
self.__sat = (opts['sat'] and True or False) self.__sat = (opts['sat'] and True or False)
self.__dedup = (opts['dedup'] and True or False)
def logs(self): def logs(self):
return self.__dump_path return self.__dump_path
...@@ -545,12 +546,19 @@ class criu_cli: ...@@ -545,12 +546,19 @@ class criu_cli:
if self.__page_server: if self.__page_server:
print "Adding page server" print "Adding page server"
self.__criu_act("page-server", opts = [ "--port", "12345", \
"--daemon", "--pidfile", "ps.pid"]) ps_opts = [ "--port", "12345", "--daemon", "--pidfile", "ps.pid" ]
if self.__dedup:
ps_opts += [ "--auto-dedup" ]
self.__criu_act("page-server", opts = ps_opts)
a_opts += ["--page-server", "--address", "127.0.0.1", "--port", "12345"] a_opts += ["--page-server", "--address", "127.0.0.1", "--port", "12345"]
a_opts += self.__test.getdopts() a_opts += self.__test.getdopts()
if self.__dedup:
a_opts += [ "--auto-dedup" ]
self.__criu_act(action, opts = a_opts + opts) self.__criu_act(action, opts = a_opts + opts)
if self.__page_server: if self.__page_server:
...@@ -733,7 +741,8 @@ class launcher: ...@@ -733,7 +741,8 @@ class launcher:
self.__nr += 1 self.__nr += 1
self.__show_progress() self.__show_progress()
nd = ('nocr', 'norst', 'pre', 'iters', 'page_server', 'sibling', 'fault', 'keep_img', 'report', 'snaps', 'sat') nd = ('nocr', 'norst', 'pre', 'iters', 'page_server', 'sibling', \
'fault', 'keep_img', 'report', 'snaps', 'sat', 'dedup')
arg = repr((name, desc, flavor, { d: self.__opts[d] for d in nd })) arg = repr((name, desc, flavor, { d: self.__opts[d] for d in nd }))
log = name.replace('/', '_') + ".log" log = name.replace('/', '_') + ".log"
sub = subprocess.Popen(["./zdtm_ct", "zdtm.py"], \ sub = subprocess.Popen(["./zdtm_ct", "zdtm.py"], \
...@@ -951,6 +960,7 @@ rp.add_argument("-x", "--exclude", help = "Exclude tests from --all run", action ...@@ -951,6 +960,7 @@ rp.add_argument("-x", "--exclude", help = "Exclude tests from --all run", action
rp.add_argument("--sibling", help = "Restore tests as siblings", action = 'store_true') rp.add_argument("--sibling", help = "Restore tests as siblings", action = 'store_true')
rp.add_argument("--pre", help = "Do some pre-dumps before dump (n[:pause])") rp.add_argument("--pre", help = "Do some pre-dumps before dump (n[:pause])")
rp.add_argument("--snaps", help = "Instead of pre-dumps do full dumps", action = 'store_true') rp.add_argument("--snaps", help = "Instead of pre-dumps do full dumps", action = 'store_true')
rp.add_argument("--dedup", help = "Auto-deduplicate images on iterations", action = 'store_true')
rp.add_argument("--nocr", help = "Do not CR anything, just check test works", action = 'store_true') rp.add_argument("--nocr", help = "Do not CR anything, just check test works", action = 'store_true')
rp.add_argument("--norst", help = "Don't restore tasks, leave them running after dump", action = 'store_true') rp.add_argument("--norst", help = "Don't restore tasks, leave them running after dump", action = 'store_true')
rp.add_argument("--iters", help = "Do CR cycle several times before check (n[:pause])") rp.add_argument("--iters", help = "Do CR cycle several times before check (n[:pause])")
......
...@@ -32,13 +32,14 @@ int main(int argc, char **argv) ...@@ -32,13 +32,14 @@ int main(int argc, char **argv)
test_daemon(); test_daemon();
while (test_go()) { while (test_go()) {
unsigned pfn; unsigned pfn;
struct timespec req = { .tv_sec = 0, .tv_nsec = 100000, };
pfn = random() % MEM_PAGES; pfn = random() % MEM_PAGES;
*(unsigned *)(mem + pfn * PAGE_SIZE) = rover; *(unsigned *)(mem + pfn * PAGE_SIZE) = rover;
backup[pfn] = rover; backup[pfn] = rover;
test_msg("t %u %u\n", pfn, rover); test_msg("t %u %u\n", pfn, rover);
rover++; rover++;
sleep(1); nanosleep(&req, NULL);
} }
test_waitsig(); test_waitsig();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment