* [PATCH] selftests/mm: FOLL_LONGTERM need to be updated to 0x100
@ 2023-08-08 12:43 Ayush Jain
2023-08-09 2:31 ` John Hubbard
2023-08-09 7:40 ` David Hildenbrand
0 siblings, 2 replies; 3+ messages in thread
From: Ayush Jain @ 2023-08-08 12:43 UTC (permalink / raw)
To: jglisse, akpm, shuah
Cc: linux-mm, linux-kselftest, linux-kernel, bharata, kalpana.shetty,
santosh.shukla, Ayush Jain, Raghavendra K T
After commit 2c2241081f7d ("mm/gup: move private gup FOLL_ flags to internal.h")
FOLL_LONGTERM flag value got updated from 0x10000 to 0x100 at
include/linux/mm_types.h.
As hmm.hmm_device_private.hmm_gup_test uses FOLL_LONGTERM
Updating same here as well.
Before this change test goes in an infinite assert loop in
hmm.hmm_device_private.hmm_gup_test
==========================================================
RUN hmm.hmm_device_private.hmm_gup_test ...
hmm-tests.c:1962:hmm_gup_test:Expected HMM_DMIRROR_PROT_WRITE..
..(2) == m[2] (34)
hmm-tests.c:157:hmm_gup_test:Expected ret (-1) == 0 (0)
hmm-tests.c:157:hmm_gup_test:Expected ret (-1) == 0 (0)
...
==========================================================
Call Trace:
<TASK>
? sched_clock+0xd/0x20
? __lock_acquire.constprop.0+0x120/0x6c0
? ktime_get+0x2c/0xd0
? sched_clock+0xd/0x20
? local_clock+0x12/0xd0
? lock_release+0x26e/0x3b0
pin_user_pages_fast+0x4c/0x70
gup_test_ioctl+0x4ff/0xbb0
? gup_test_ioctl+0x68c/0xbb0
__x64_sys_ioctl+0x99/0xd0
do_syscall_64+0x60/0x90
? syscall_exit_to_user_mode+0x2a/0x50
? do_syscall_64+0x6d/0x90
? syscall_exit_to_user_mode+0x2a/0x50
? do_syscall_64+0x6d/0x90
? irqentry_exit_to_user_mode+0xd/0x20
? irqentry_exit+0x3f/0x50
? exc_page_fault+0x96/0x200
entry_SYSCALL_64_after_hwframe+0x72/0xdc
RIP: 0033:0x7f6aaa31aaff
After this change test is able to pass successfully.
Signed-off-by: Ayush Jain <ayush.jain3@amd.com>
Reviewed-by: Raghavendra K T <raghavendra.kt@amd.com>
---
tools/testing/selftests/mm/hmm-tests.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/mm/hmm-tests.c b/tools/testing/selftests/mm/hmm-tests.c
index 4adaad1b822f..20294553a5dd 100644
--- a/tools/testing/selftests/mm/hmm-tests.c
+++ b/tools/testing/selftests/mm/hmm-tests.c
@@ -57,9 +57,14 @@ enum {
#define ALIGN(x, a) (((x) + (a - 1)) & (~((a) - 1)))
/* Just the flags we need, copied from mm.h: */
+
+#ifndef FOLL_WRITE
#define FOLL_WRITE 0x01 /* check pte is writable */
-#define FOLL_LONGTERM 0x10000 /* mapping lifetime is indefinite */
+#endif
+#ifndef FOLL_LONGTERM
+#define FOLL_LONGTERM 0x100 /* mapping lifetime is indefinite */
+#endif
FIXTURE(hmm)
{
int fd;
--
2.39.3
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] selftests/mm: FOLL_LONGTERM need to be updated to 0x100
2023-08-08 12:43 [PATCH] selftests/mm: FOLL_LONGTERM need to be updated to 0x100 Ayush Jain
@ 2023-08-09 2:31 ` John Hubbard
2023-08-09 7:40 ` David Hildenbrand
1 sibling, 0 replies; 3+ messages in thread
From: John Hubbard @ 2023-08-09 2:31 UTC (permalink / raw)
To: Ayush Jain, jglisse, akpm, shuah
Cc: linux-mm, linux-kselftest, linux-kernel, bharata, kalpana.shetty,
santosh.shukla, Raghavendra K T
On 8/8/23 05:43, Ayush Jain wrote:
...
> diff --git a/tools/testing/selftests/mm/hmm-tests.c b/tools/testing/selftests/mm/hmm-tests.c
> index 4adaad1b822f..20294553a5dd 100644
> --- a/tools/testing/selftests/mm/hmm-tests.c
> +++ b/tools/testing/selftests/mm/hmm-tests.c
> @@ -57,9 +57,14 @@ enum {
>
> #define ALIGN(x, a) (((x) + (a - 1)) & (~((a) - 1)))
> /* Just the flags we need, copied from mm.h: */
> +
> +#ifndef FOLL_WRITE
> #define FOLL_WRITE 0x01 /* check pte is writable */
> -#define FOLL_LONGTERM 0x10000 /* mapping lifetime is indefinite */
> +#endif
>
> +#ifndef FOLL_LONGTERM
> +#define FOLL_LONGTERM 0x100 /* mapping lifetime is indefinite */
> +#endif
> FIXTURE(hmm)
> {
> int fd;
Yes, it's unfortunate that this selftest framework prevents easily
including those FOLL_* flags directly.
Anyway, thanks for fixing this,
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
thanks,
--
John Hubbard
NVIDIA
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] selftests/mm: FOLL_LONGTERM need to be updated to 0x100
2023-08-08 12:43 [PATCH] selftests/mm: FOLL_LONGTERM need to be updated to 0x100 Ayush Jain
2023-08-09 2:31 ` John Hubbard
@ 2023-08-09 7:40 ` David Hildenbrand
1 sibling, 0 replies; 3+ messages in thread
From: David Hildenbrand @ 2023-08-09 7:40 UTC (permalink / raw)
To: Ayush Jain, jglisse, akpm, shuah
Cc: linux-mm, linux-kselftest, linux-kernel, bharata, kalpana.shetty,
santosh.shukla, Raghavendra K T
On 08.08.23 14:43, Ayush Jain wrote:
> After commit 2c2241081f7d ("mm/gup: move private gup FOLL_ flags to internal.h")
> FOLL_LONGTERM flag value got updated from 0x10000 to 0x100 at
> include/linux/mm_types.h.
> As hmm.hmm_device_private.hmm_gup_test uses FOLL_LONGTERM
> Updating same here as well.
>
> Before this change test goes in an infinite assert loop in
> hmm.hmm_device_private.hmm_gup_test
> ==========================================================
> RUN hmm.hmm_device_private.hmm_gup_test ...
> hmm-tests.c:1962:hmm_gup_test:Expected HMM_DMIRROR_PROT_WRITE..
> ..(2) == m[2] (34)
> hmm-tests.c:157:hmm_gup_test:Expected ret (-1) == 0 (0)
> hmm-tests.c:157:hmm_gup_test:Expected ret (-1) == 0 (0)
> ...
> ==========================================================
>
> Call Trace:
> <TASK>
> ? sched_clock+0xd/0x20
> ? __lock_acquire.constprop.0+0x120/0x6c0
> ? ktime_get+0x2c/0xd0
> ? sched_clock+0xd/0x20
> ? local_clock+0x12/0xd0
> ? lock_release+0x26e/0x3b0
> pin_user_pages_fast+0x4c/0x70
> gup_test_ioctl+0x4ff/0xbb0
> ? gup_test_ioctl+0x68c/0xbb0
> __x64_sys_ioctl+0x99/0xd0
> do_syscall_64+0x60/0x90
> ? syscall_exit_to_user_mode+0x2a/0x50
> ? do_syscall_64+0x6d/0x90
> ? syscall_exit_to_user_mode+0x2a/0x50
> ? do_syscall_64+0x6d/0x90
> ? irqentry_exit_to_user_mode+0xd/0x20
> ? irqentry_exit+0x3f/0x50
> ? exc_page_fault+0x96/0x200
> entry_SYSCALL_64_after_hwframe+0x72/0xdc
> RIP: 0033:0x7f6aaa31aaff
>
> After this change test is able to pass successfully.
>
> Signed-off-by: Ayush Jain <ayush.jain3@amd.com>
> Reviewed-by: Raghavendra K T <raghavendra.kt@amd.com>
> ---
> tools/testing/selftests/mm/hmm-tests.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/mm/hmm-tests.c b/tools/testing/selftests/mm/hmm-tests.c
> index 4adaad1b822f..20294553a5dd 100644
> --- a/tools/testing/selftests/mm/hmm-tests.c
> +++ b/tools/testing/selftests/mm/hmm-tests.c
> @@ -57,9 +57,14 @@ enum {
>
> #define ALIGN(x, a) (((x) + (a - 1)) & (~((a) - 1)))
> /* Just the flags we need, copied from mm.h: */
> +
> +#ifndef FOLL_WRITE
> #define FOLL_WRITE 0x01 /* check pte is writable */
> -#define FOLL_LONGTERM 0x10000 /* mapping lifetime is indefinite */
> +#endif
>
> +#ifndef FOLL_LONGTERM
> +#define FOLL_LONGTERM 0x100 /* mapping lifetime is indefinite */
> +#endif
> FIXTURE(hmm)
> {
> int fd;
Kind of suboptimal that we are passing in FOLL_ flags. mm/gup_test.c
should just have provided an abstraction for that.
Acked-by: David Hildenbrand <david@redhat.com>
--
Cheers,
David / dhildenb
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-08-09 7:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-08 12:43 [PATCH] selftests/mm: FOLL_LONGTERM need to be updated to 0x100 Ayush Jain
2023-08-09 2:31 ` John Hubbard
2023-08-09 7:40 ` David Hildenbrand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox