* [LTP] [PATCH][RFC]Testcases mbind01.c and get_mempolicy01 fails with EINVAL
@ 2009-11-03 9:17 Sharyathi Nagesh
2009-11-03 9:35 ` liubo
0 siblings, 1 reply; 3+ messages in thread
From: Sharyathi Nagesh @ 2009-11-03 9:17 UTC (permalink / raw)
To: ltp-list, Subrata Modak; +Cc: Rishikesh K. Rajak
[-- Attachment #1: Type: text/plain, Size: 1417 bytes --]
Hi
We observed that LTP test cases are failing when run on some of the distros
Problem Statement:
I observed that test cases mbind01.c and get_mempolicy01.c are failing during call to
get_mempolicy() with error -EINVAL.
In the kernel code the error comes from
----------------------------------------------------------------
SYSCALL_DEFINE5(get_mempolicy, int __user *, policy,
unsigned long __user *, nmask, unsigned long, maxnode,
unsigned long, addr, unsigned long, flags)
{
int err;
int uninitialized_var(pval);
nodemask_t nodes;
if (nmask != NULL && maxnode < MAX_NUMNODES)
return -EINVAL;
<== in the kernel code,
MAX_NUMNODES comes to 512
----------------------------------------------------------------
Analysis:
When kernel config option 'configure maximum number of SMP processors and NUMA node' is
set MAX_NUMNODES will be initialized to 512 and any call to get_mempolicy() with maxnode
value less than that cause the test to fail.
----------------------------------------------------------------
Fix:
increase the default maxnode value in the test case to reflect this value. maxnode value
comes from numaif.h and this patch increase the value to 512 from earlier 128.
Note:
I will submit it in the format, once the patch is accepted
Thanks
Yeehaw
[-- Attachment #2: increase_maxnode_to_sync_with_kernel.patch --]
[-- Type: text/x-patch, Size: 1218 bytes --]
This patch fixes the issues noticed while running test case mbind01.c. The test case failed while making call to get_mempolicy system call. The system call fails with kernel returning -EINVAL. This issues is observed due to compatibiliy issue between kernel and ltp code. When kernel configure option 'configure maximum number of SMP processors and NUMA node' is enabled kernel will initialize MAX_NUMNODES variable to 512. In the user space while calling get_mempolicy if user pass any value lesser than 512 for maxnode, the system calls fails with EINVAL. This patch addresses the issue by increasing the maxnode value to 512
Signed-off-by: Sharyathi Nagesh <sharyath@in.ibm.com>
Index: ltp/testcases/kernel/syscalls/utils/numaif.h
===================================================================
--- ltp.orig/testcases/kernel/syscalls/utils/numaif.h 2009-06-23 19:51:32.000000000 +0530
+++ ltp/testcases/kernel/syscalls/utils/numaif.h 2009-10-20 09:16:00.000000000 +0530
@@ -29,7 +29,7 @@
#include "./include_j_h.h"
#include "linux_syscall_numbers.h"
-#define NUMA_NUM_NODES 128
+#define NUMA_NUM_NODES 512
typedef struct {
unsigned long n[NUMA_NUM_NODES/(sizeof(unsigned long)*8)];
} nodemask_t;
[-- Attachment #3: Type: text/plain, Size: 399 bytes --]
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
[-- Attachment #4: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH][RFC]Testcases mbind01.c and get_mempolicy01 fails with EINVAL
2009-11-03 9:17 [LTP] [PATCH][RFC]Testcases mbind01.c and get_mempolicy01 fails with EINVAL Sharyathi Nagesh
@ 2009-11-03 9:35 ` liubo
2009-11-07 1:16 ` Sharyathi Nagesh
0 siblings, 1 reply; 3+ messages in thread
From: liubo @ 2009-11-03 9:35 UTC (permalink / raw)
To: Sharyathi Nagesh; +Cc: Rishikesh K. Rajak, ltp-list
[-- Attachment #1.1: Type: text/plain, Size: 2437 bytes --]
Hi
On 11/03/2009 05:17 PM, Sharyathi Nagesh wrote:
> Hi
> We observed that LTP test cases are failing when run on some of
> the distros
>
> Problem Statement:
>
> I observed that test cases mbind01.c and get_mempolicy01.c are
> failing during call to get_mempolicy() with error -EINVAL.
> In the kernel code the error comes from
> ----------------------------------------------------------------
>
> SYSCALL_DEFINE5(get_mempolicy, int __user *, policy,
> unsigned long __user *, nmask, unsigned long, maxnode,
> unsigned long, addr, unsigned long, flags)
> {
> int err;
> int uninitialized_var(pval);
> nodemask_t nodes;
>
> if (nmask != NULL && maxnode < MAX_NUMNODES)
> return -EINVAL;
> <== in the kernel code,
> MAX_NUMNODES comes to 512
Is it better that "MAX_NUMNODES" get from configure file?
For different platforms may have different MAX_NUMNODES.
Regards--
Liu Bo
> ----------------------------------------------------------------
> Analysis:
>
> When kernel config option 'configure maximum number of SMP
> processors and NUMA node' is set MAX_NUMNODES will be initialized to
> 512 and any call to get_mempolicy() with maxnode value less than that
> cause the test to fail.
> ----------------------------------------------------------------
> Fix:
> increase the default maxnode value in the test case to reflect
> this value. maxnode value comes from numaif.h and this patch increase
> the value to 512 from earlier 128.
>
> Note:
> I will submit it in the format, once the patch is accepted
>
> Thanks
> Yeehaw
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> ------------------------------------------------------------------------
>
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
>
[-- Attachment #1.2: Type: text/html, Size: 4074 bytes --]
[-- Attachment #2: Type: text/plain, Size: 399 bytes --]
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
[-- Attachment #3: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH][RFC]Testcases mbind01.c and get_mempolicy01 fails with EINVAL
2009-11-03 9:35 ` liubo
@ 2009-11-07 1:16 ` Sharyathi Nagesh
0 siblings, 0 replies; 3+ messages in thread
From: Sharyathi Nagesh @ 2009-11-07 1:16 UTC (permalink / raw)
To: liubo; +Cc: Rishikesh K. Rajak, ltp-list
Liu
Excuse me for the late response. I looked into Kconfig file and it looks that what you
are saying is correct assessment.
This is what Kconfig file under arch/x86 says
---------------------------------------------------------------------------------------
config MAXSMP
bool "Configure Maximum number of SMP Processors and NUMA Nodes"
depends on X86_64 && SMP && DEBUG_KERNEL && EXPERIMENTAL
---------------------------------------------------------------------------------------
So this value is changed only specific to x86_64 arch
And check for ppc64 didn't reveal any modification to the MAX_NUMNODE value.
As you put it reading this value from configure file appears to be a better idea
Thanks
Sharyathi
On Tuesday 03 November 2009 03:05 PM, liubo wrote:
>> int uninitialized_var(pval);
>> nodemask_t nodes;
>>
>> if (nmask != NULL&& maxnode< MAX_NUMNODES)
>> return -EINVAL;
>> <== in the kernel code,
>> MAX_NUMNODES comes to 512
>
> Is it better that "MAX_NUMNODES" get from configure file?
>
> For different platforms may have different MAX_NUMNODES.
>
>
> Regards--
> Liu Bo
>
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-11-06 13:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-03 9:17 [LTP] [PATCH][RFC]Testcases mbind01.c and get_mempolicy01 fails with EINVAL Sharyathi Nagesh
2009-11-03 9:35 ` liubo
2009-11-07 1:16 ` Sharyathi Nagesh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox