* [LTP] [PATCH v1 1/1] migrate_pages03: remove wait_ksmd_full_scan() check because it's not necessary
[not found] <cover.1721293231.git.pengfei.xu@intel.com>
@ 2024-07-18 9:03 ` Pengfei Xu
2024-07-18 10:06 ` Li Wang
0 siblings, 1 reply; 4+ messages in thread
From: Pengfei Xu @ 2024-07-18 9:03 UTC (permalink / raw)
To: ltp; +Cc: feij.fnst
Remove wait_ksmd_full_scan() check because it's not a necessary step for
migrate_pages03 syscall test:
1. KSM(kernel samepage merging) could be enabled and it is optional for
migrate_pages syscall testing.
2. When server launched any qemu guest, wait_ksmd_full_scan() will in
infinite loop due to /sys/kernel/mm/ksm/full_scans number would not
increase anymore, and migrate_pages03 will failed with timeout reason.
After removed wait_ksmd_full_scan(), migrate_pages03 could pass without
issue.
Signed-off-by: Pengfei Xu <pengfei.xu@intel.com>
---
testcases/kernel/syscalls/migrate_pages/migrate_pages03.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/testcases/kernel/syscalls/migrate_pages/migrate_pages03.c b/testcases/kernel/syscalls/migrate_pages/migrate_pages03.c
index 4d3299b61..f514ed10c 100644
--- a/testcases/kernel/syscalls/migrate_pages/migrate_pages03.c
+++ b/testcases/kernel/syscalls/migrate_pages/migrate_pages03.c
@@ -95,7 +95,6 @@ static void setup(void)
SAFE_FILE_SCANF(PATH_KSM "run", "%d", &orig_ksm_run);
SAFE_FILE_PRINTF(PATH_KSM "run", "%d", 1);
- wait_ksmd_full_scan();
}
static void cleanup(void)
--
2.43.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH v1 1/1] migrate_pages03: remove wait_ksmd_full_scan() check because it's not necessary
2024-07-18 9:03 ` [LTP] [PATCH v1 1/1] migrate_pages03: remove wait_ksmd_full_scan() check because it's not necessary Pengfei Xu
@ 2024-07-18 10:06 ` Li Wang
2024-07-18 10:09 ` Li Wang
0 siblings, 1 reply; 4+ messages in thread
From: Li Wang @ 2024-07-18 10:06 UTC (permalink / raw)
To: Pengfei Xu; +Cc: feij.fnst, ltp
Pengfei Xu <pengfei.xu@intel.com> wrote:
Remove wait_ksmd_full_scan() check because it's not a necessary step for
> migrate_pages03 syscall test:
> 1. KSM(kernel samepage merging) could be enabled and it is optional for
> migrate_pages syscall testing.
>
The wait_ksmd_full_scan guarantees the actual merging happens then test
can migrate those merged KSM pages to reproduce the regression panic in
kernel commit 4b0ece6fa0167b.
So this is a necessary configuration before testing.
> 2. When server launched any qemu guest, wait_ksmd_full_scan() will in
> infinite loop due to /sys/kernel/mm/ksm/full_scans number would not
> increase anymore, and migrate_pages03 will failed with timeout reason.
> After removed wait_ksmd_full_scan(), migrate_pages03 could pass without
> issue.
Yes, this timeout problem likely exists. That is the KSM design which can't
avoid "unrelated" page merging happening in the background.
But removing the wait_ksmd_full_scan might not be a good approach IMHO.
Cc @Andrea Arcangeli <aarcange@redhat.com> if he has good suggestions on
the test.
> Signed-off-by: Pengfei Xu <pengfei.xu@intel.com>
> ---
> testcases/kernel/syscalls/migrate_pages/migrate_pages03.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/testcases/kernel/syscalls/migrate_pages/migrate_pages03.c
> b/testcases/kernel/syscalls/migrate_pages/migrate_pages03.c
> index 4d3299b61..f514ed10c 100644
> --- a/testcases/kernel/syscalls/migrate_pages/migrate_pages03.c
> +++ b/testcases/kernel/syscalls/migrate_pages/migrate_pages03.c
> @@ -95,7 +95,6 @@ static void setup(void)
>
> SAFE_FILE_SCANF(PATH_KSM "run", "%d", &orig_ksm_run);
> SAFE_FILE_PRINTF(PATH_KSM "run", "%d", 1);
> - wait_ksmd_full_scan();
> }
>
> static void cleanup(void)
> --
> 2.43.0
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
>
>
--
Regards,
Li Wang
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH v1 1/1] migrate_pages03: remove wait_ksmd_full_scan() check because it's not necessary
2024-07-18 10:06 ` Li Wang
@ 2024-07-18 10:09 ` Li Wang
2024-07-19 1:29 ` Pengfei Xu
0 siblings, 1 reply; 4+ messages in thread
From: Li Wang @ 2024-07-18 10:09 UTC (permalink / raw)
To: Pengfei Xu; +Cc: Andrea Arcangeli, feij.fnst, ltp
Sorry, forgot to cc Andrea Arcangeli in the last reply.
On Thu, Jul 18, 2024 at 6:06 PM Li Wang <liwang@redhat.com> wrote:
> Pengfei Xu <pengfei.xu@intel.com> wrote:
>
> Remove wait_ksmd_full_scan() check because it's not a necessary step for
>> migrate_pages03 syscall test:
>> 1. KSM(kernel samepage merging) could be enabled and it is optional for
>> migrate_pages syscall testing.
>>
>
> The wait_ksmd_full_scan guarantees the actual merging happens then test
> can migrate those merged KSM pages to reproduce the regression panic in
> kernel commit 4b0ece6fa0167b.
>
> So this is a necessary configuration before testing.
>
>
>> 2. When server launched any qemu guest, wait_ksmd_full_scan() will in
>> infinite loop due to /sys/kernel/mm/ksm/full_scans number would not
>> increase anymore, and migrate_pages03 will failed with timeout reason.
>> After removed wait_ksmd_full_scan(), migrate_pages03 could pass without
>> issue.
>
>
> Yes, this timeout problem likely exists. That is the KSM design which can't
> avoid "unrelated" page merging happening in the background.
> But removing the wait_ksmd_full_scan might not be a good approach IMHO.
>
> Cc @Andrea Arcangeli <aarcange@redhat.com> if he has good suggestions on
> the test.
>
>
>> Signed-off-by: Pengfei Xu <pengfei.xu@intel.com>
>> ---
>> testcases/kernel/syscalls/migrate_pages/migrate_pages03.c | 1 -
>> 1 file changed, 1 deletion(-)
>>
>> diff --git a/testcases/kernel/syscalls/migrate_pages/migrate_pages03.c
>> b/testcases/kernel/syscalls/migrate_pages/migrate_pages03.c
>> index 4d3299b61..f514ed10c 100644
>> --- a/testcases/kernel/syscalls/migrate_pages/migrate_pages03.c
>> +++ b/testcases/kernel/syscalls/migrate_pages/migrate_pages03.c
>> @@ -95,7 +95,6 @@ static void setup(void)
>>
>> SAFE_FILE_SCANF(PATH_KSM "run", "%d", &orig_ksm_run);
>> SAFE_FILE_PRINTF(PATH_KSM "run", "%d", 1);
>> - wait_ksmd_full_scan();
>> }
>>
>> static void cleanup(void)
>> --
>> 2.43.0
>>
>>
>> --
>> Mailing list info: https://lists.linux.it/listinfo/ltp
>>
>>
>
> --
> Regards,
> Li Wang
>
--
Regards,
Li Wang
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH v1 1/1] migrate_pages03: remove wait_ksmd_full_scan() check because it's not necessary
2024-07-18 10:09 ` Li Wang
@ 2024-07-19 1:29 ` Pengfei Xu
0 siblings, 0 replies; 4+ messages in thread
From: Pengfei Xu @ 2024-07-19 1:29 UTC (permalink / raw)
To: Li Wang; +Cc: Andrea Arcangeli, feij.fnst, ltp
Hi Li Wang and Andrea Arcangeli,
On 2024-07-18 at 18:09:56 +0800, Li Wang wrote:
> Sorry, forgot to cc Andrea Arcangeli in the last reply.
>
>
> On Thu, Jul 18, 2024 at 6:06 PM Li Wang <liwang@redhat.com> wrote:
>
> > Pengfei Xu <pengfei.xu@intel.com> wrote:
> >
> > Remove wait_ksmd_full_scan() check because it's not a necessary step for
> >> migrate_pages03 syscall test:
> >> 1. KSM(kernel samepage merging) could be enabled and it is optional for
> >> migrate_pages syscall testing.
> >>
> >
> > The wait_ksmd_full_scan guarantees the actual merging happens then test
> > can migrate those merged KSM pages to reproduce the regression panic in
> > kernel commit 4b0ece6fa0167b.
> >
> > So this is a necessary configuration before testing.
I did not consider the above situation. Is it possible to improve
wait_ksmd_full_scan() to handle the scenario described in point 2?
> >
> >
> >> 2. When server launched any qemu guest, wait_ksmd_full_scan() will in
> >> infinite loop due to /sys/kernel/mm/ksm/full_scans number would not
> >> increase anymore, and migrate_pages03 will failed with timeout reason.
> >> After removed wait_ksmd_full_scan(), migrate_pages03 could pass without
> >> issue.
> >
> >
> > Yes, this timeout problem likely exists. That is the KSM design which can't
> > avoid "unrelated" page merging happening in the background.
> > But removing the wait_ksmd_full_scan might not be a good approach IMHO.
Yes, thanks for above background info sharing!
Best Regards,
Thank you!
> >
> > Cc @Andrea Arcangeli <aarcange@redhat.com> if he has good suggestions on
> > the test.
> >
> >
> >> Signed-off-by: Pengfei Xu <pengfei.xu@intel.com>
> >> ---
> >> testcases/kernel/syscalls/migrate_pages/migrate_pages03.c | 1 -
> >> 1 file changed, 1 deletion(-)
> >>
> >> diff --git a/testcases/kernel/syscalls/migrate_pages/migrate_pages03.c
> >> b/testcases/kernel/syscalls/migrate_pages/migrate_pages03.c
> >> index 4d3299b61..f514ed10c 100644
> >> --- a/testcases/kernel/syscalls/migrate_pages/migrate_pages03.c
> >> +++ b/testcases/kernel/syscalls/migrate_pages/migrate_pages03.c
> >> @@ -95,7 +95,6 @@ static void setup(void)
> >>
> >> SAFE_FILE_SCANF(PATH_KSM "run", "%d", &orig_ksm_run);
> >> SAFE_FILE_PRINTF(PATH_KSM "run", "%d", 1);
> >> - wait_ksmd_full_scan();
> >> }
> >>
> >> static void cleanup(void)
> >> --
> >> 2.43.0
> >>
> >>
> >> --
> >> Mailing list info: https://lists.linux.it/listinfo/ltp
> >>
> >>
> >
> > --
> > Regards,
> > Li Wang
> >
>
>
> --
> Regards,
> Li Wang
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-07-19 1:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <cover.1721293231.git.pengfei.xu@intel.com>
2024-07-18 9:03 ` [LTP] [PATCH v1 1/1] migrate_pages03: remove wait_ksmd_full_scan() check because it's not necessary Pengfei Xu
2024-07-18 10:06 ` Li Wang
2024-07-18 10:09 ` Li Wang
2024-07-19 1:29 ` Pengfei Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox