linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lib/test_vmalloc.c: introduce xfail for failing tests
@ 2025-07-02  6:43 Raghavendra K T
  2025-07-02  6:48 ` Dev Jain
  2025-07-04 10:06 ` Uladzislau Rezki
  0 siblings, 2 replies; 7+ messages in thread
From: Raghavendra K T @ 2025-07-02  6:43 UTC (permalink / raw)
  To: raghavendra.kt; +Cc: akpm, urezki, linux-kernel, linux-mm

The test align_shift_alloc_test is expected to fail.
Reporting the test as fail confuses to be a genuine failure.
Introduce widely used xfail sematics to address the issue.

Note: a warn_alloc dump similar to below is still expected:

 Call Trace:
  <TASK>
  dump_stack_lvl+0x64/0x80
  warn_alloc+0x137/0x1b0
  ? __get_vm_area_node+0x134/0x140

Snippet of dmesg after change:

Summary: random_size_align_alloc_test passed: 1 failed: 0 xfailed: 0 ..
Summary: align_shift_alloc_test passed: 0 failed: 0 xfailed: 1 ..
Summary: pcpu_alloc_test passed: 1 failed: 0 xfailed: 0 ..

Signed-off-by: Raghavendra K T <raghavendra.kt@amd.com>
---
 lib/test_vmalloc.c | 36 +++++++++++++++++++++---------------
 1 file changed, 21 insertions(+), 15 deletions(-)

diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c
index 1b0b59549aaf..649f352e2046 100644
--- a/lib/test_vmalloc.c
+++ b/lib/test_vmalloc.c
@@ -396,25 +396,27 @@ vm_map_ram_test(void)
 struct test_case_desc {
 	const char *test_name;
 	int (*test_func)(void);
+	bool xfail;
 };
 
 static struct test_case_desc test_case_array[] = {
-	{ "fix_size_alloc_test", fix_size_alloc_test },
-	{ "full_fit_alloc_test", full_fit_alloc_test },
-	{ "long_busy_list_alloc_test", long_busy_list_alloc_test },
-	{ "random_size_alloc_test", random_size_alloc_test },
-	{ "fix_align_alloc_test", fix_align_alloc_test },
-	{ "random_size_align_alloc_test", random_size_align_alloc_test },
-	{ "align_shift_alloc_test", align_shift_alloc_test },
-	{ "pcpu_alloc_test", pcpu_alloc_test },
-	{ "kvfree_rcu_1_arg_vmalloc_test", kvfree_rcu_1_arg_vmalloc_test },
-	{ "kvfree_rcu_2_arg_vmalloc_test", kvfree_rcu_2_arg_vmalloc_test },
-	{ "vm_map_ram_test", vm_map_ram_test },
+	{ "fix_size_alloc_test", fix_size_alloc_test, },
+	{ "full_fit_alloc_test", full_fit_alloc_test, },
+	{ "long_busy_list_alloc_test", long_busy_list_alloc_test, },
+	{ "random_size_alloc_test", random_size_alloc_test, },
+	{ "fix_align_alloc_test", fix_align_alloc_test, },
+	{ "random_size_align_alloc_test", random_size_align_alloc_test, },
+	{ "align_shift_alloc_test", align_shift_alloc_test, true },
+	{ "pcpu_alloc_test", pcpu_alloc_test, },
+	{ "kvfree_rcu_1_arg_vmalloc_test", kvfree_rcu_1_arg_vmalloc_test, },
+	{ "kvfree_rcu_2_arg_vmalloc_test", kvfree_rcu_2_arg_vmalloc_test, },
+	{ "vm_map_ram_test", vm_map_ram_test, },
 	/* Add a new test case here. */
 };
 
 struct test_case_data {
 	int test_failed;
+	int test_xfailed;
 	int test_passed;
 	u64 time;
 };
@@ -444,7 +446,7 @@ static int test_func(void *private)
 {
 	struct test_driver *t = private;
 	int random_array[ARRAY_SIZE(test_case_array)];
-	int index, i, j;
+	int index, i, j, ret;
 	ktime_t kt;
 	u64 delta;
 
@@ -468,11 +470,14 @@ static int test_func(void *private)
 		 */
 		if (!((run_test_mask & (1 << index)) >> index))
 			continue;
-
 		kt = ktime_get();
 		for (j = 0; j < test_repeat_count; j++) {
-			if (!test_case_array[index].test_func())
+			ret = test_case_array[index].test_func();
+
+			if (!ret && !test_case_array[index].xfail)
 				t->data[index].test_passed++;
+			else if (ret && test_case_array[index].xfail)
+				t->data[index].test_xfailed++;
 			else
 				t->data[index].test_failed++;
 		}
@@ -576,10 +581,11 @@ static void do_concurrent_test(void)
 				continue;
 
 			pr_info(
-				"Summary: %s passed: %d failed: %d repeat: %d loops: %d avg: %llu usec\n",
+				"Summary: %s passed: %d failed: %d xfailed: %d repeat: %d loops: %d avg: %llu usec\n",
 				test_case_array[j].test_name,
 				t->data[j].test_passed,
 				t->data[j].test_failed,
+				t->data[j].test_xfailed,
 				test_repeat_count, test_loop_count,
 				t->data[j].time);
 		}
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] lib/test_vmalloc.c: introduce xfail for failing tests
  2025-07-02  6:43 [PATCH] lib/test_vmalloc.c: introduce xfail for failing tests Raghavendra K T
@ 2025-07-02  6:48 ` Dev Jain
  2025-07-02  8:08   ` Raghavendra K T
  2025-07-04 10:06 ` Uladzislau Rezki
  1 sibling, 1 reply; 7+ messages in thread
From: Dev Jain @ 2025-07-02  6:48 UTC (permalink / raw)
  To: Raghavendra K T; +Cc: akpm, urezki, linux-kernel, linux-mm


On 02/07/25 12:13 pm, Raghavendra K T wrote:
> The test align_shift_alloc_test is expected to fail.
> Reporting the test as fail confuses to be a genuine failure.
> Introduce widely used xfail sematics to address the issue.
>
> Note: a warn_alloc dump similar to below is still expected:
>
>   Call Trace:
>    <TASK>
>    dump_stack_lvl+0x64/0x80
>    warn_alloc+0x137/0x1b0
>    ? __get_vm_area_node+0x134/0x140
>
> Snippet of dmesg after change:
>
> Summary: random_size_align_alloc_test passed: 1 failed: 0 xfailed: 0 ..
> Summary: align_shift_alloc_test passed: 0 failed: 0 xfailed: 1 ..
> Summary: pcpu_alloc_test passed: 1 failed: 0 xfailed: 0 ..
>
> Signed-off-by: Raghavendra K T <raghavendra.kt@amd.com>
> ---

Thanks for doing this, been thinking about this for so long but
I'm lazy : )

>   lib/test_vmalloc.c | 36 +++++++++++++++++++++---------------
>   1 file changed, 21 insertions(+), 15 deletions(-)
>
> diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c
> index 1b0b59549aaf..649f352e2046 100644
> --- a/lib/test_vmalloc.c
> +++ b/lib/test_vmalloc.c
> @@ -396,25 +396,27 @@ vm_map_ram_test(void)
>   struct test_case_desc {
>   	const char *test_name;
>   	int (*test_func)(void);
> +	bool xfail;
>   };
>   
>   static struct test_case_desc test_case_array[] = {
> -	{ "fix_size_alloc_test", fix_size_alloc_test },
> -	{ "full_fit_alloc_test", full_fit_alloc_test },
> -	{ "long_busy_list_alloc_test", long_busy_list_alloc_test },
> -	{ "random_size_alloc_test", random_size_alloc_test },
> -	{ "fix_align_alloc_test", fix_align_alloc_test },
> -	{ "random_size_align_alloc_test", random_size_align_alloc_test },
> -	{ "align_shift_alloc_test", align_shift_alloc_test },
> -	{ "pcpu_alloc_test", pcpu_alloc_test },
> -	{ "kvfree_rcu_1_arg_vmalloc_test", kvfree_rcu_1_arg_vmalloc_test },
> -	{ "kvfree_rcu_2_arg_vmalloc_test", kvfree_rcu_2_arg_vmalloc_test },
> -	{ "vm_map_ram_test", vm_map_ram_test },
> +	{ "fix_size_alloc_test", fix_size_alloc_test, },
> +	{ "full_fit_alloc_test", full_fit_alloc_test, },
> +	{ "long_busy_list_alloc_test", long_busy_list_alloc_test, },
> +	{ "random_size_alloc_test", random_size_alloc_test, },
> +	{ "fix_align_alloc_test", fix_align_alloc_test, },
> +	{ "random_size_align_alloc_test", random_size_align_alloc_test, },
> +	{ "align_shift_alloc_test", align_shift_alloc_test, true },
> +	{ "pcpu_alloc_test", pcpu_alloc_test, },
> +	{ "kvfree_rcu_1_arg_vmalloc_test", kvfree_rcu_1_arg_vmalloc_test, },
> +	{ "kvfree_rcu_2_arg_vmalloc_test", kvfree_rcu_2_arg_vmalloc_test, },
> +	{ "vm_map_ram_test", vm_map_ram_test, },
>   	/* Add a new test case here. */
>   };
>   

Why this change?

>   struct test_case_data {
>   	int test_failed;
> +	int test_xfailed;
>   	int test_passed;
>   	u64 time;
>   };
> @@ -444,7 +446,7 @@ static int test_func(void *private)
>   {
>   	struct test_driver *t = private;
>   	int random_array[ARRAY_SIZE(test_case_array)];
> -	int index, i, j;
> +	int index, i, j, ret;
>   	ktime_t kt;
>   	u64 delta;
>   
> @@ -468,11 +470,14 @@ static int test_func(void *private)
>   		 */
>   		if (!((run_test_mask & (1 << index)) >> index))
>   			continue;
> -
>   		kt = ktime_get();
>   		for (j = 0; j < test_repeat_count; j++) {
> -			if (!test_case_array[index].test_func())
> +			ret = test_case_array[index].test_func();
> +
> +			if (!ret && !test_case_array[index].xfail)
>   				t->data[index].test_passed++;
> +			else if (ret && test_case_array[index].xfail)
> +				t->data[index].test_xfailed++;
>   			else
>   				t->data[index].test_failed++;
>   		}
> @@ -576,10 +581,11 @@ static void do_concurrent_test(void)
>   				continue;
>   
>   			pr_info(
> -				"Summary: %s passed: %d failed: %d repeat: %d loops: %d avg: %llu usec\n",
> +				"Summary: %s passed: %d failed: %d xfailed: %d repeat: %d loops: %d avg: %llu usec\n",
>   				test_case_array[j].test_name,
>   				t->data[j].test_passed,
>   				t->data[j].test_failed,
> +				t->data[j].test_xfailed,
>   				test_repeat_count, test_loop_count,
>   				t->data[j].time);
>   		}


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] lib/test_vmalloc.c: introduce xfail for failing tests
  2025-07-02  6:48 ` Dev Jain
@ 2025-07-02  8:08   ` Raghavendra K T
  2025-07-02  8:13     ` Dev Jain
  0 siblings, 1 reply; 7+ messages in thread
From: Raghavendra K T @ 2025-07-02  8:08 UTC (permalink / raw)
  To: Dev Jain; +Cc: akpm, urezki, linux-kernel, linux-mm



On 7/2/2025 12:18 PM, Dev Jain wrote:
> 
> On 02/07/25 12:13 pm, Raghavendra K T wrote:
>> The test align_shift_alloc_test is expected to fail.
>> Reporting the test as fail confuses to be a genuine failure.
>> Introduce widely used xfail sematics to address the issue.
>>
>> Note: a warn_alloc dump similar to below is still expected:
>>
>>   Call Trace:
>>    <TASK>
>>    dump_stack_lvl+0x64/0x80
>>    warn_alloc+0x137/0x1b0
>>    ? __get_vm_area_node+0x134/0x140
>>
>> Snippet of dmesg after change:
>>
>> Summary: random_size_align_alloc_test passed: 1 failed: 0 xfailed: 0 ..
>> Summary: align_shift_alloc_test passed: 0 failed: 0 xfailed: 1 ..
>> Summary: pcpu_alloc_test passed: 1 failed: 0 xfailed: 0 ..
>>
>> Signed-off-by: Raghavendra K T <raghavendra.kt@amd.com>
>> ---
> 
> Thanks for doing this, been thinking about this for so long but
> I'm lazy : )

:)

> 
>>   lib/test_vmalloc.c | 36 +++++++++++++++++++++---------------
>>   1 file changed, 21 insertions(+), 15 deletions(-)
>>
>> diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c
>> index 1b0b59549aaf..649f352e2046 100644
>> --- a/lib/test_vmalloc.c
>> +++ b/lib/test_vmalloc.c
>> @@ -396,25 +396,27 @@ vm_map_ram_test(void)
>>   struct test_case_desc {
>>       const char *test_name;
>>       int (*test_func)(void);
>> +    bool xfail;
>>   };
>>   static struct test_case_desc test_case_array[] = {
>> -    { "fix_size_alloc_test", fix_size_alloc_test },
>> -    { "full_fit_alloc_test", full_fit_alloc_test },
>> -    { "long_busy_list_alloc_test", long_busy_list_alloc_test },
>> -    { "random_size_alloc_test", random_size_alloc_test },
>> -    { "fix_align_alloc_test", fix_align_alloc_test },
>> -    { "random_size_align_alloc_test", random_size_align_alloc_test },
>> -    { "align_shift_alloc_test", align_shift_alloc_test },
>> -    { "pcpu_alloc_test", pcpu_alloc_test },
>> -    { "kvfree_rcu_1_arg_vmalloc_test", kvfree_rcu_1_arg_vmalloc_test },
>> -    { "kvfree_rcu_2_arg_vmalloc_test", kvfree_rcu_2_arg_vmalloc_test },
>> -    { "vm_map_ram_test", vm_map_ram_test },
>> +    { "fix_size_alloc_test", fix_size_alloc_test, },
>> +    { "full_fit_alloc_test", full_fit_alloc_test, },
>> +    { "long_busy_list_alloc_test", long_busy_list_alloc_test, },
>> +    { "random_size_alloc_test", random_size_alloc_test, },
>> +    { "fix_align_alloc_test", fix_align_alloc_test, },
>> +    { "random_size_align_alloc_test", random_size_align_alloc_test, },
>> +    { "align_shift_alloc_test", align_shift_alloc_test, true },
>> +    { "pcpu_alloc_test", pcpu_alloc_test, },
>> +    { "kvfree_rcu_1_arg_vmalloc_test", kvfree_rcu_1_arg_vmalloc_test, },
>> +    { "kvfree_rcu_2_arg_vmalloc_test", kvfree_rcu_2_arg_vmalloc_test, },
>> +    { "vm_map_ram_test", vm_map_ram_test, },
>>       /* Add a new test case here. */
>>   };
> 
> Why this change?

Perhaps not entirely necessary except for align_shift_alloc_test line,
still updated the field since one more bool field added. But let me know
if you are okay with current state OR need a respin for that?

[...]


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] lib/test_vmalloc.c: introduce xfail for failing tests
  2025-07-02  8:08   ` Raghavendra K T
@ 2025-07-02  8:13     ` Dev Jain
  2025-07-04  9:09       ` Raghavendra K T
  0 siblings, 1 reply; 7+ messages in thread
From: Dev Jain @ 2025-07-02  8:13 UTC (permalink / raw)
  To: Raghavendra K T; +Cc: akpm, urezki, linux-kernel, linux-mm


On 02/07/25 1:38 pm, Raghavendra K T wrote:
>
>
> On 7/2/2025 12:18 PM, Dev Jain wrote:
>>
>> On 02/07/25 12:13 pm, Raghavendra K T wrote:
>>> The test align_shift_alloc_test is expected to fail.
>>> Reporting the test as fail confuses to be a genuine failure.
>>> Introduce widely used xfail sematics to address the issue.
>>>
>>> Note: a warn_alloc dump similar to below is still expected:
>>>
>>>   Call Trace:
>>>    <TASK>
>>>    dump_stack_lvl+0x64/0x80
>>>    warn_alloc+0x137/0x1b0
>>>    ? __get_vm_area_node+0x134/0x140
>>>
>>> Snippet of dmesg after change:
>>>
>>> Summary: random_size_align_alloc_test passed: 1 failed: 0 xfailed: 0 ..
>>> Summary: align_shift_alloc_test passed: 0 failed: 0 xfailed: 1 ..
>>> Summary: pcpu_alloc_test passed: 1 failed: 0 xfailed: 0 ..
>>>
>>> Signed-off-by: Raghavendra K T <raghavendra.kt@amd.com>
>>> ---
>>
>> Thanks for doing this, been thinking about this for so long but
>> I'm lazy : )
>
> :)
>
>>
>>>   lib/test_vmalloc.c | 36 +++++++++++++++++++++---------------
>>>   1 file changed, 21 insertions(+), 15 deletions(-)
>>>
>>> diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c
>>> index 1b0b59549aaf..649f352e2046 100644
>>> --- a/lib/test_vmalloc.c
>>> +++ b/lib/test_vmalloc.c
>>> @@ -396,25 +396,27 @@ vm_map_ram_test(void)
>>>   struct test_case_desc {
>>>       const char *test_name;
>>>       int (*test_func)(void);
>>> +    bool xfail;
>>>   };
>>>   static struct test_case_desc test_case_array[] = {
>>> -    { "fix_size_alloc_test", fix_size_alloc_test },
>>> -    { "full_fit_alloc_test", full_fit_alloc_test },
>>> -    { "long_busy_list_alloc_test", long_busy_list_alloc_test },
>>> -    { "random_size_alloc_test", random_size_alloc_test },
>>> -    { "fix_align_alloc_test", fix_align_alloc_test },
>>> -    { "random_size_align_alloc_test", random_size_align_alloc_test },
>>> -    { "align_shift_alloc_test", align_shift_alloc_test },
>>> -    { "pcpu_alloc_test", pcpu_alloc_test },
>>> -    { "kvfree_rcu_1_arg_vmalloc_test", 
>>> kvfree_rcu_1_arg_vmalloc_test },
>>> -    { "kvfree_rcu_2_arg_vmalloc_test", 
>>> kvfree_rcu_2_arg_vmalloc_test },
>>> -    { "vm_map_ram_test", vm_map_ram_test },
>>> +    { "fix_size_alloc_test", fix_size_alloc_test, },
>>> +    { "full_fit_alloc_test", full_fit_alloc_test, },
>>> +    { "long_busy_list_alloc_test", long_busy_list_alloc_test, },
>>> +    { "random_size_alloc_test", random_size_alloc_test, },
>>> +    { "fix_align_alloc_test", fix_align_alloc_test, },
>>> +    { "random_size_align_alloc_test", random_size_align_alloc_test, },
>>> +    { "align_shift_alloc_test", align_shift_alloc_test, true },
>>> +    { "pcpu_alloc_test", pcpu_alloc_test, },
>>> +    { "kvfree_rcu_1_arg_vmalloc_test", 
>>> kvfree_rcu_1_arg_vmalloc_test, },
>>> +    { "kvfree_rcu_2_arg_vmalloc_test", 
>>> kvfree_rcu_2_arg_vmalloc_test, },
>>> +    { "vm_map_ram_test", vm_map_ram_test, },
>>>       /* Add a new test case here. */
>>>   };
>>
>> Why this change?
>
> Perhaps not entirely necessary except for align_shift_alloc_test line,
> still updated the field since one more bool field added. But let me know
> if you are okay with current state OR need a respin for that?

Oh now I saw the "true", I thought you were adding commas for no reason.

I think that's fine then, but will let Uladzislau decide.


>
> [...]


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] lib/test_vmalloc.c: introduce xfail for failing tests
  2025-07-02  8:13     ` Dev Jain
@ 2025-07-04  9:09       ` Raghavendra K T
  2025-07-04 10:05         ` Uladzislau Rezki
  0 siblings, 1 reply; 7+ messages in thread
From: Raghavendra K T @ 2025-07-04  9:09 UTC (permalink / raw)
  To: urezki; +Cc: akpm, urezki, linux-kernel, linux-mm, Dev Jain



On 7/2/2025 1:43 PM, Dev Jain wrote:
> 
> On 02/07/25 1:38 pm, Raghavendra K T wrote:
>>
>>
>> On 7/2/2025 12:18 PM, Dev Jain wrote:
>>>
>>> On 02/07/25 12:13 pm, Raghavendra K T wrote:
>>>> The test align_shift_alloc_test is expected to fail.
>>>> Reporting the test as fail confuses to be a genuine failure.
>>>> Introduce widely used xfail sematics to address the issue.
>>>>
>>>> Note: a warn_alloc dump similar to below is still expected:
>>>>
>>>>   Call Trace:
>>>>    <TASK>
>>>>    dump_stack_lvl+0x64/0x80
>>>>    warn_alloc+0x137/0x1b0
>>>>    ? __get_vm_area_node+0x134/0x140
>>>>
>>>> Snippet of dmesg after change:
>>>>
>>>> Summary: random_size_align_alloc_test passed: 1 failed: 0 xfailed: 0 ..
>>>> Summary: align_shift_alloc_test passed: 0 failed: 0 xfailed: 1 ..
>>>> Summary: pcpu_alloc_test passed: 1 failed: 0 xfailed: 0 ..
>>>>
>>>> Signed-off-by: Raghavendra K T <raghavendra.kt@amd.com>
>>>> ---
>>>
>>> Thanks for doing this, been thinking about this for so long but
>>> I'm lazy : )
>>
>> :)
>>
>>>
>>>>   lib/test_vmalloc.c | 36 +++++++++++++++++++++---------------
>>>>   1 file changed, 21 insertions(+), 15 deletions(-)
>>>>
>>>> diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c
>>>> index 1b0b59549aaf..649f352e2046 100644
>>>> --- a/lib/test_vmalloc.c
>>>> +++ b/lib/test_vmalloc.c
>>>> @@ -396,25 +396,27 @@ vm_map_ram_test(void)
>>>>   struct test_case_desc {
>>>>       const char *test_name;
>>>>       int (*test_func)(void);
>>>> +    bool xfail;
>>>>   };
>>>>   static struct test_case_desc test_case_array[] = {
>>>> -    { "fix_size_alloc_test", fix_size_alloc_test },
>>>> -    { "full_fit_alloc_test", full_fit_alloc_test },
>>>> -    { "long_busy_list_alloc_test", long_busy_list_alloc_test },
>>>> -    { "random_size_alloc_test", random_size_alloc_test },
>>>> -    { "fix_align_alloc_test", fix_align_alloc_test },
>>>> -    { "random_size_align_alloc_test", random_size_align_alloc_test },
>>>> -    { "align_shift_alloc_test", align_shift_alloc_test },
>>>> -    { "pcpu_alloc_test", pcpu_alloc_test },
>>>> -    { "kvfree_rcu_1_arg_vmalloc_test", 
>>>> kvfree_rcu_1_arg_vmalloc_test },
>>>> -    { "kvfree_rcu_2_arg_vmalloc_test", 
>>>> kvfree_rcu_2_arg_vmalloc_test },
>>>> -    { "vm_map_ram_test", vm_map_ram_test },
>>>> +    { "fix_size_alloc_test", fix_size_alloc_test, },
>>>> +    { "full_fit_alloc_test", full_fit_alloc_test, },
>>>> +    { "long_busy_list_alloc_test", long_busy_list_alloc_test, },
>>>> +    { "random_size_alloc_test", random_size_alloc_test, },
>>>> +    { "fix_align_alloc_test", fix_align_alloc_test, },
>>>> +    { "random_size_align_alloc_test", random_size_align_alloc_test, },
>>>> +    { "align_shift_alloc_test", align_shift_alloc_test, true },
>>>> +    { "pcpu_alloc_test", pcpu_alloc_test, },
>>>> +    { "kvfree_rcu_1_arg_vmalloc_test", 
>>>> kvfree_rcu_1_arg_vmalloc_test, },
>>>> +    { "kvfree_rcu_2_arg_vmalloc_test", 
>>>> kvfree_rcu_2_arg_vmalloc_test, },
>>>> +    { "vm_map_ram_test", vm_map_ram_test, },
>>>>       /* Add a new test case here. */
>>>>   };
>>>
>>> Why this change?
>>
>> Perhaps not entirely necessary except for align_shift_alloc_test line,
>> still updated the field since one more bool field added. But let me know
>> if you are okay with current state OR need a respin for that?
> 
> Oh now I saw the "true", I thought you were adding commas for no reason.
> 
> I think that's fine then, but will let Uladzislau decide.
> 
> 

Uladzislau,

Do you think this patch would be useful? and above change is okay?

Thanks and regards
- Raghu



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] lib/test_vmalloc.c: introduce xfail for failing tests
  2025-07-04  9:09       ` Raghavendra K T
@ 2025-07-04 10:05         ` Uladzislau Rezki
  0 siblings, 0 replies; 7+ messages in thread
From: Uladzislau Rezki @ 2025-07-04 10:05 UTC (permalink / raw)
  To: Raghavendra K T; +Cc: urezki, akpm, linux-kernel, linux-mm, Dev Jain

Hello, Raghavendra!

> 
> On 7/2/2025 1:43 PM, Dev Jain wrote:
> > 
> > On 02/07/25 1:38 pm, Raghavendra K T wrote:
> > > 
> > > 
> > > On 7/2/2025 12:18 PM, Dev Jain wrote:
> > > > 
> > > > On 02/07/25 12:13 pm, Raghavendra K T wrote:
> > > > > The test align_shift_alloc_test is expected to fail.
> > > > > Reporting the test as fail confuses to be a genuine failure.
> > > > > Introduce widely used xfail sematics to address the issue.
> > > > > 
> > > > > Note: a warn_alloc dump similar to below is still expected:
> > > > > 
> > > > >   Call Trace:
> > > > >    <TASK>
> > > > >    dump_stack_lvl+0x64/0x80
> > > > >    warn_alloc+0x137/0x1b0
> > > > >    ? __get_vm_area_node+0x134/0x140
> > > > > 
> > > > > Snippet of dmesg after change:
> > > > > 
> > > > > Summary: random_size_align_alloc_test passed: 1 failed: 0 xfailed: 0 ..
> > > > > Summary: align_shift_alloc_test passed: 0 failed: 0 xfailed: 1 ..
> > > > > Summary: pcpu_alloc_test passed: 1 failed: 0 xfailed: 0 ..
> > > > > 
> > > > > Signed-off-by: Raghavendra K T <raghavendra.kt@amd.com>
> > > > > ---
> > > > 
> > > > Thanks for doing this, been thinking about this for so long but
> > > > I'm lazy : )
> > > 
> > > :)
> > > 
> > > > 
> > > > >   lib/test_vmalloc.c | 36 +++++++++++++++++++++---------------
> > > > >   1 file changed, 21 insertions(+), 15 deletions(-)
> > > > > 
> > > > > diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c
> > > > > index 1b0b59549aaf..649f352e2046 100644
> > > > > --- a/lib/test_vmalloc.c
> > > > > +++ b/lib/test_vmalloc.c
> > > > > @@ -396,25 +396,27 @@ vm_map_ram_test(void)
> > > > >   struct test_case_desc {
> > > > >       const char *test_name;
> > > > >       int (*test_func)(void);
> > > > > +    bool xfail;
> > > > >   };
> > > > >   static struct test_case_desc test_case_array[] = {
> > > > > -    { "fix_size_alloc_test", fix_size_alloc_test },
> > > > > -    { "full_fit_alloc_test", full_fit_alloc_test },
> > > > > -    { "long_busy_list_alloc_test", long_busy_list_alloc_test },
> > > > > -    { "random_size_alloc_test", random_size_alloc_test },
> > > > > -    { "fix_align_alloc_test", fix_align_alloc_test },
> > > > > -    { "random_size_align_alloc_test", random_size_align_alloc_test },
> > > > > -    { "align_shift_alloc_test", align_shift_alloc_test },
> > > > > -    { "pcpu_alloc_test", pcpu_alloc_test },
> > > > > -    { "kvfree_rcu_1_arg_vmalloc_test",
> > > > > kvfree_rcu_1_arg_vmalloc_test },
> > > > > -    { "kvfree_rcu_2_arg_vmalloc_test",
> > > > > kvfree_rcu_2_arg_vmalloc_test },
> > > > > -    { "vm_map_ram_test", vm_map_ram_test },
> > > > > +    { "fix_size_alloc_test", fix_size_alloc_test, },
> > > > > +    { "full_fit_alloc_test", full_fit_alloc_test, },
> > > > > +    { "long_busy_list_alloc_test", long_busy_list_alloc_test, },
> > > > > +    { "random_size_alloc_test", random_size_alloc_test, },
> > > > > +    { "fix_align_alloc_test", fix_align_alloc_test, },
> > > > > +    { "random_size_align_alloc_test", random_size_align_alloc_test, },
> > > > > +    { "align_shift_alloc_test", align_shift_alloc_test, true },
> > > > > +    { "pcpu_alloc_test", pcpu_alloc_test, },
> > > > > +    { "kvfree_rcu_1_arg_vmalloc_test",
> > > > > kvfree_rcu_1_arg_vmalloc_test, },
> > > > > +    { "kvfree_rcu_2_arg_vmalloc_test",
> > > > > kvfree_rcu_2_arg_vmalloc_test, },
> > > > > +    { "vm_map_ram_test", vm_map_ram_test, },
> > > > >       /* Add a new test case here. */
> > > > >   };
> > > > 
> > > > Why this change?
> > > 
> > > Perhaps not entirely necessary except for align_shift_alloc_test line,
> > > still updated the field since one more bool field added. But let me know
> > > if you are okay with current state OR need a respin for that?
> > 
> > Oh now I saw the "true", I thought you were adding commas for no reason.
> > 
> > I think that's fine then, but will let Uladzislau decide.
> > 
> > 
> 
> Uladzislau,
> 
> Do you think this patch would be useful? and above change is okay?
> 
Sorry, i missed this. Yes, i think it makes sense since it confuses
people.

--
Uladzislau Rezki


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] lib/test_vmalloc.c: introduce xfail for failing tests
  2025-07-02  6:43 [PATCH] lib/test_vmalloc.c: introduce xfail for failing tests Raghavendra K T
  2025-07-02  6:48 ` Dev Jain
@ 2025-07-04 10:06 ` Uladzislau Rezki
  1 sibling, 0 replies; 7+ messages in thread
From: Uladzislau Rezki @ 2025-07-04 10:06 UTC (permalink / raw)
  To: Raghavendra K T; +Cc: akpm, urezki, linux-kernel, linux-mm

On Wed, Jul 02, 2025 at 06:43:19AM +0000, Raghavendra K T wrote:
> The test align_shift_alloc_test is expected to fail.
> Reporting the test as fail confuses to be a genuine failure.
> Introduce widely used xfail sematics to address the issue.
> 
> Note: a warn_alloc dump similar to below is still expected:
> 
>  Call Trace:
>   <TASK>
>   dump_stack_lvl+0x64/0x80
>   warn_alloc+0x137/0x1b0
>   ? __get_vm_area_node+0x134/0x140
> 
> Snippet of dmesg after change:
> 
> Summary: random_size_align_alloc_test passed: 1 failed: 0 xfailed: 0 ..
> Summary: align_shift_alloc_test passed: 0 failed: 0 xfailed: 1 ..
> Summary: pcpu_alloc_test passed: 1 failed: 0 xfailed: 0 ..
> 
> Signed-off-by: Raghavendra K T <raghavendra.kt@amd.com>
> ---
>  lib/test_vmalloc.c | 36 +++++++++++++++++++++---------------
>  1 file changed, 21 insertions(+), 15 deletions(-)
> 
> diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c
> index 1b0b59549aaf..649f352e2046 100644
> --- a/lib/test_vmalloc.c
> +++ b/lib/test_vmalloc.c
> @@ -396,25 +396,27 @@ vm_map_ram_test(void)
>  struct test_case_desc {
>  	const char *test_name;
>  	int (*test_func)(void);
> +	bool xfail;
>  };
>  
>  static struct test_case_desc test_case_array[] = {
> -	{ "fix_size_alloc_test", fix_size_alloc_test },
> -	{ "full_fit_alloc_test", full_fit_alloc_test },
> -	{ "long_busy_list_alloc_test", long_busy_list_alloc_test },
> -	{ "random_size_alloc_test", random_size_alloc_test },
> -	{ "fix_align_alloc_test", fix_align_alloc_test },
> -	{ "random_size_align_alloc_test", random_size_align_alloc_test },
> -	{ "align_shift_alloc_test", align_shift_alloc_test },
> -	{ "pcpu_alloc_test", pcpu_alloc_test },
> -	{ "kvfree_rcu_1_arg_vmalloc_test", kvfree_rcu_1_arg_vmalloc_test },
> -	{ "kvfree_rcu_2_arg_vmalloc_test", kvfree_rcu_2_arg_vmalloc_test },
> -	{ "vm_map_ram_test", vm_map_ram_test },
> +	{ "fix_size_alloc_test", fix_size_alloc_test, },
> +	{ "full_fit_alloc_test", full_fit_alloc_test, },
> +	{ "long_busy_list_alloc_test", long_busy_list_alloc_test, },
> +	{ "random_size_alloc_test", random_size_alloc_test, },
> +	{ "fix_align_alloc_test", fix_align_alloc_test, },
> +	{ "random_size_align_alloc_test", random_size_align_alloc_test, },
> +	{ "align_shift_alloc_test", align_shift_alloc_test, true },
> +	{ "pcpu_alloc_test", pcpu_alloc_test, },
> +	{ "kvfree_rcu_1_arg_vmalloc_test", kvfree_rcu_1_arg_vmalloc_test, },
> +	{ "kvfree_rcu_2_arg_vmalloc_test", kvfree_rcu_2_arg_vmalloc_test, },
> +	{ "vm_map_ram_test", vm_map_ram_test, },
>  	/* Add a new test case here. */
>  };
>  
>  struct test_case_data {
>  	int test_failed;
> +	int test_xfailed;
>  	int test_passed;
>  	u64 time;
>  };
> @@ -444,7 +446,7 @@ static int test_func(void *private)
>  {
>  	struct test_driver *t = private;
>  	int random_array[ARRAY_SIZE(test_case_array)];
> -	int index, i, j;
> +	int index, i, j, ret;
>  	ktime_t kt;
>  	u64 delta;
>  
> @@ -468,11 +470,14 @@ static int test_func(void *private)
>  		 */
>  		if (!((run_test_mask & (1 << index)) >> index))
>  			continue;
> -
>  		kt = ktime_get();
>  		for (j = 0; j < test_repeat_count; j++) {
> -			if (!test_case_array[index].test_func())
> +			ret = test_case_array[index].test_func();
> +
> +			if (!ret && !test_case_array[index].xfail)
>  				t->data[index].test_passed++;
> +			else if (ret && test_case_array[index].xfail)
> +				t->data[index].test_xfailed++;
>  			else
>  				t->data[index].test_failed++;
>  		}
> @@ -576,10 +581,11 @@ static void do_concurrent_test(void)
>  				continue;
>  
>  			pr_info(
> -				"Summary: %s passed: %d failed: %d repeat: %d loops: %d avg: %llu usec\n",
> +				"Summary: %s passed: %d failed: %d xfailed: %d repeat: %d loops: %d avg: %llu usec\n",
>  				test_case_array[j].test_name,
>  				t->data[j].test_passed,
>  				t->data[j].test_failed,
> +				t->data[j].test_xfailed,
>  				test_repeat_count, test_loop_count,
>  				t->data[j].time);
>  		}
> -- 
> 2.43.0
> 

Reviewed-by: "Uladzislau Rezki (Sony)" <urezki@gmail.com>

--
Uladzislau Rezki


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-07-04 10:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-02  6:43 [PATCH] lib/test_vmalloc.c: introduce xfail for failing tests Raghavendra K T
2025-07-02  6:48 ` Dev Jain
2025-07-02  8:08   ` Raghavendra K T
2025-07-02  8:13     ` Dev Jain
2025-07-04  9:09       ` Raghavendra K T
2025-07-04 10:05         ` Uladzislau Rezki
2025-07-04 10:06 ` Uladzislau Rezki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).