Skip to contentSkip to conversation

hugeshmat01 isn't adapt to mips with 64bit ELF

PATCH In review Shang Yanfeng 2 participants 5 messages Dec 27, 2011 – Feb 23, 2012 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hugeshmat01 isn't adapt to mips with 64bit ELF

Because userspace memory in mips with 64bit ELF is lower than 2^40, so shmat failed.

---
 .../kernel/mem/hugetlb/hugeshmat/hugeshmat01.c     |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c +5 -1
index 6f270ce..67bd4b0 100644
@@ -67,7 +67,11 @@ unsigned long huge_pages_shm_to_be_allocated;
 #define CASE1		20		/* memory location.		   */
 
 #if __WORDSIZE==64
+#if defined(__mips__)
+#define UNALIGNED      0x1000000eee
+#else
 #define UNALIGNED      0x10000000eee
+#endif
 #else
 #define UNALIGNED      0x60000eee
 #endif
@@ -279,4 +283,4 @@ cleanup(void)
 	 */
 	TEST_CLEANUP;
 
-}
\ No newline at end of file
+}
Signature · 13 lines
1.6.3.1


------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#1 lore raw

Hi!

Quoted 14 lines

Because userspace memory in mips with 64bit ELF is lower than 2^40, so shmat failed.

---
 .../kernel/mem/hugetlb/hugeshmat/hugeshmat01.c     |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c +0 -0
index 6f270ce..67bd4b0 100644
@@ -67,7 +67,11 @@ unsigned long huge_pages_shm_to_be_allocated;
 #define CASE1		20		/* memory location.		   */

testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c unsigned long huge_pages_shm_to_be_allocated; · line 77

Quoted 10 lines
testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c +4 -0
 
 #if __WORDSIZE==64
+#if defined(__mips__)
+#define UNALIGNED      0x1000000eee
+#else
 #define UNALIGNED      0x10000000eee
+#endif
 #else
 #define UNALIGNED      0x60000eee
 #endif

I wonder why we need such #ifdef for 64 bit systems in the first place, or is the unaligned address 0x60000eee too low for 64 bit system?

Garrett, Mike any clue?

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

Hi!

Quoted 17 lines
Quoted 17 lines

testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c unsigned long huge_pages_shm_to_be_allocated; · line 77

Quoted 13 lines
testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c +4 -0
 
 #define CASE1		20		/* memory location.		   */
 #if __WORDSIZE==64
+#if defined(__mips__)
+#define UNALIGNED      0x1000000eee
+#else
 #define UNALIGNED      0x10000000eee
+#endif
 #else
 #define UNALIGNED      0x60000eee
 #endif

I wonder why we need such #ifdef for 64 bit systems in the first place, or is the unaligned address 0x60000eee too low for 64 bit system?

Quoted 4 lines
Quoted 1 line

Garrett, Mike any clue?

i can only guess that the author was attempting to locate a highly-unlikely- to-be-used memory location

Hmm, okay. So what we need is to create library function that returns highly-unlikely memory location (I've seen this code in several places and I would like to avoid the duplication).

Signature · 12 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

Hi!

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

I wonder why we need such #ifdef for 64 bit systems in the first place, or is the unaligned address 0x60000eee too low for 64 bit system?

Garrett, Mike any clue?

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

i can only guess that the author was attempting to locate a highly-unlikely- to-be-used memory location

Hmm, okay. So what we need is to create library function that returns highly-unlikely memory location (I've seen this code in several places and I would like to avoid the duplication).

adding a helper to libltp sounds reasonable

Hmm, couldn't find the other places, maybe my memory is just playing tricks with me. I guess I will commit this as it is and create a library when I get around other usages.

Signature · 12 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#6 lore raw
In reply to Shang Yanfeng

Hi!

Quoted 4 lines

Because userspace memory in mips with 64bit ELF is lower than 2^40, so shmat failed.

For now commited as it is, thanks.

Signature · 12 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list