From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org,
kirill.shutemov@linux.intel.com
Subject: Re: [PATCH] khugeepaged: Replace the usage of system(3) in the test.
Date: Wed, 29 Apr 2020 15:48:16 +0300 [thread overview]
Message-ID: <20200429124816.jp272trghrzxx5j5@box> (raw)
In-Reply-To: <20200429110727.89388-1-aneesh.kumar@linux.ibm.com>
On Wed, Apr 29, 2020 at 04:37:27PM +0530, Aneesh Kumar K.V wrote:
> Some glibc version doesn't use CLONE_VM | CLONE_VFORK for system(3) implementation
> and on such system, we find the test case fails. This is due to fork() marking
> all the parent page table pages read-only to do a COW.
>
> Avoid the usage of system(3) in the test.
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Below is fixup for issues I've noticed.
With them integrated the patch looks good to me and you can use my
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
diff --git a/tools/testing/selftests/vm/khugepaged.c b/tools/testing/selftests/vm/khugepaged.c
index 9b2d675c0fd3..5d0698d4a101 100644
--- a/tools/testing/selftests/vm/khugepaged.c
+++ b/tools/testing/selftests/vm/khugepaged.c
@@ -345,7 +345,7 @@ static bool check_for_pattern(FILE *fp, char *pattern, char *buf)
return false;
}
-static bool check_huge(char *addr)
+static bool check_huge(void *addr)
{
bool thp = false;
int ret;
@@ -353,7 +353,8 @@ static bool check_huge(char *addr)
char buffer[MAX_LINE_LENGTH];
char addr_pattern[MAX_LINE_LENGTH];
- ret = snprintf(addr_pattern, MAX_LINE_LENGTH, "%08llx-", addr);
+ ret = snprintf(addr_pattern, MAX_LINE_LENGTH, "%08lx-",
+ (unsigned long) addr);
if (ret >= MAX_LINE_LENGTH) {
printf("%s: Pattern is too long\n", __func__);
exit(EXIT_FAILURE);
@@ -368,7 +369,8 @@ static bool check_huge(char *addr)
if (!check_for_pattern(fp, addr_pattern, buffer))
goto err_out;
- ret = snprintf(addr_pattern, MAX_LINE_LENGTH, "AnonHugePages:%10lld kB", hpage_pmd_size >> 10);
+ ret = snprintf(addr_pattern, MAX_LINE_LENGTH, "AnonHugePages:%10ld kB",
+ hpage_pmd_size >> 10);
if (ret >= MAX_LINE_LENGTH) {
printf("%s: Pattern is too long\n", __func__);
exit(EXIT_FAILURE);
@@ -398,7 +400,8 @@ static bool check_swap(void *addr, unsigned long size)
char buffer[MAX_LINE_LENGTH];
char addr_pattern[MAX_LINE_LENGTH];
- ret = snprintf(addr_pattern, MAX_LINE_LENGTH, "%08llx-", addr);
+ ret = snprintf(addr_pattern, MAX_LINE_LENGTH, "%08lx-",
+ (unsigned long) addr);
if (ret >= MAX_LINE_LENGTH) {
printf("%s: Pattern is too long\n", __func__);
exit(EXIT_FAILURE);
@@ -413,7 +416,8 @@ static bool check_swap(void *addr, unsigned long size)
if (!check_for_pattern(fp, addr_pattern, buffer))
goto err_out;
- ret = snprintf(addr_pattern, MAX_LINE_LENGTH, "Swap:%19lld kB", size >> 10);
+ ret = snprintf(addr_pattern, MAX_LINE_LENGTH, "Swap:%19ld kB",
+ size >> 10);
if (ret >= MAX_LINE_LENGTH) {
printf("%s: Pattern is too long\n", __func__);
exit(EXIT_FAILURE);
--
Kirill A. Shutemov
prev parent reply other threads:[~2020-04-29 12:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-29 11:07 Aneesh Kumar K.V
2020-04-29 12:48 ` Kirill A. Shutemov [this message]
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=20200429124816.jp272trghrzxx5j5@box \
--to=kirill@shutemov.name \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.ibm.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-mm@kvack.org \
/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