From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2] syscalls/migrate_pages03.c: Add new regression test
Date: Wed, 3 Jan 2018 15:38:36 +0100 [thread overview]
Message-ID: <20180103143836.GA7370@rei> (raw)
In-Reply-To: <1514198251-8249-1-git-send-email-yangx.jy@cn.fujitsu.com>
Hi!
> +/* Wait at least two full scans to guarantee merging */
> +static void wait_ksmd_full_scan(void)
> +{
> + unsigned long exp_scans, get_scans;
> + int count = 0;
> +
> + SAFE_FILE_SCANF(KSM_PATH "full_scans", "%lu", &get_scans);
> + exp_scans = get_scans + 3;
> + while (get_scans < exp_scans) {
> + sleep(1);
> + count++;
> + SAFE_FILE_SCANF(KSM_PATH "full_scans", "%lu", &get_scans);
> + }
> +
> + tst_res(TINFO, "ksmd takes %ds to run two full scans", count);
> +}
I do not like that this piece of code has been copied from the lib/mem.c.
Cleaner solution will move the function to testcases/kernel/lib/ksm.c
and create accompanying testcases/kernel/include/ksm.h header so that we
can link againts it here and in the ksm testcases as well in order to
retain only one copy of the function in the source tree.
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2018-01-03 14:38 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-28 10:07 [LTP] [PATCH] syscalls/migrate_pages03.c: Add new regression test Xiao Yang
2017-11-30 15:20 ` Cyril Hrubis
2017-12-21 10:03 ` [LTP] [PATCH v2] " Xiao Yang
2017-12-25 10:26 ` Xiao Yang
2017-12-25 10:37 ` xiao yang
2018-01-03 12:04 ` Jan Stancek
2018-01-03 14:38 ` Cyril Hrubis [this message]
2018-01-04 9:26 ` [LTP] [PATCH v3 1/2] lib/mem.c: factor out wait_ksmd_full_scan() xiao yang
2018-01-04 9:26 ` [LTP] [PATCH v3 2/2] syscalls/migrate_pages03.c: Add new regression test xiao yang
2018-01-04 9:34 ` [LTP] [PATCH v3 1/2] lib/mem.c: factor out wait_ksmd_full_scan() Xiao Yang
2018-01-04 9:44 ` [LTP] [PATCH v4 " xiao yang
2018-01-04 9:44 ` [LTP] [PATCH v4 2/2] syscalls/migrate_pages03.c: Add new regression test xiao yang
2018-01-04 15:30 ` Cyril Hrubis
2018-01-05 1:51 ` Xiao Yang
2018-01-05 2:48 ` [LTP] [PATCH v5 1/3] lib/mem.c: factor out wait_ksmd_full_scan() xiao yang
2018-01-05 2:48 ` [LTP] [PATCH v5 2/3] syscalls/migrate_pages*: Small cleanup xiao yang
2018-02-07 16:22 ` Cyril Hrubis
2018-01-05 2:48 ` [LTP] [PATCH v5 3/3] syscalls/migrate_pages03.c: Add new regression test xiao yang
2018-01-19 1:51 ` Xiao Yang
2018-02-02 8:11 ` Xiao Yang
2018-02-06 21:20 ` Jan Stancek
2018-05-15 8:30 ` Xiao Yang
2018-05-16 8:48 ` Jan Stancek
2018-03-20 9:18 ` Xiao Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180103143836.GA7370@rei \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox