From: David Hildenbrand <david@redhat.com>
To: Jinjiang Tu <tujinjiang@huawei.com>,
akpm@linux-foundation.org, shr@devkernel.io, hannes@cmpxchg.org,
riel@surriel.com, wangkefeng.wang@huawei.com,
sunnanyong@huawei.com, linux-mm@kvack.org
Subject: Re: [PATCH v4 2/3] selftest/mm: ksm_functional_tests: refactor mmap_and_merge_range()
Date: Thu, 28 Mar 2024 12:30:34 +0100 [thread overview]
Message-ID: <991d58c0-8003-4d8a-b616-434b3ce46932@redhat.com> (raw)
In-Reply-To: <20240328111010.1502191-3-tujinjiang@huawei.com>
On 28.03.24 12:10, Jinjiang Tu wrote:
> In order to extend test_prctl_fork() and test_prctl_fork_exec() to make
> sure that deduplication really happens, mmap_and_merge_range() needs to be
> refactored.
>
> Firstly, mmap_and_merge_range() will be called with no need to call enable
> KSM by madvise or prctl. So, switch the 'bool use_prctl' parameter to enum
> ksm_merge_mode.
>
> Secondly, mmap_and_merge_range() will be called in child process in the
> two testcases, it isn't appropriate to call ksft_test_result_{fail, skip},
> because the global variables ksft_{fail, skip} aren't consistent with the
> parent process. Thus, convert calls of ksft_test_result_{fail, skip} to
> ksft_print_msg(), return differrent error according to the two cases, and
> rename mmap_and_merge_range() to __mmap_and_merge_range(). For existing
> callers, introduce new mmap_and_merge_range() to handle different return
> values of __mmap_and_merge_range().
>
> Suggested-by: David Hildenbrand <david@redhat.com>
> Signed-off-by: Jinjiang Tu <tujinjiang@huawei.com>
> ---
Thanks!
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2024-03-28 11:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-28 11:10 [PATCH v4 0/3] mm/ksm: fix ksm exec support for prctl Jinjiang Tu
2024-03-28 11:10 ` [PATCH v4 1/3] " Jinjiang Tu
2024-03-28 11:10 ` [PATCH v4 2/3] selftest/mm: ksm_functional_tests: refactor mmap_and_merge_range() Jinjiang Tu
2024-03-28 11:30 ` David Hildenbrand [this message]
2024-03-28 11:10 ` [PATCH v4 3/3] selftest/mm: ksm_functional_tests: extend test case for ksm fork/exec Jinjiang Tu
2024-03-28 11:33 ` David Hildenbrand
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=991d58c0-8003-4d8a-b616-434b3ce46932@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=linux-mm@kvack.org \
--cc=riel@surriel.com \
--cc=shr@devkernel.io \
--cc=sunnanyong@huawei.com \
--cc=tujinjiang@huawei.com \
--cc=wangkefeng.wang@huawei.com \
/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