|
From: <sv...@va...> - 2013-05-12 00:52:45
|
petarj 2013-05-12 01:52:38 +0100 (Sun, 12 May 2013)
New Revision: 13389
Log:
mips: default VKI_SHMLBA to the MIPS Linux kernel value SHMLBA
This change removes option to define shared-memory-alignment for MIPS,
instead default value (0x40000) from MIPS Linux kernel will be used.
Modified files:
trunk/configure.in
trunk/include/vki/vki-mips32-linux.h
trunk/include/vki/vki-mips64-linux.h
Modified: trunk/include/vki/vki-mips64-linux.h (+2 -2)
===================================================================
--- trunk/include/vki/vki-mips64-linux.h 2013-05-11 23:23:27 +01:00 (rev 13388)
+++ trunk/include/vki/vki-mips64-linux.h 2013-05-12 01:52:38 +01:00 (rev 13389)
@@ -88,10 +88,10 @@
#define VKI_MAX_PAGE_SIZE VKI_PAGE_SIZE
//----------------------------------------------------------------------
-// From linux-2.6.35.9/arch/mips/include/asm/shmparam.h
+// From linux-2.6.35.9/arch/mips/include/bits/shm.h
//----------------------------------------------------------------------
-#define VKI_SHMLBA VKI_PAGE_SIZE
+#define VKI_SHMLBA 0x40000
//----------------------------------------------------------------------
// From linux-2.6.35.9/include/asm-mips/signal.h
Modified: trunk/include/vki/vki-mips32-linux.h (+5 -5)
===================================================================
--- trunk/include/vki/vki-mips32-linux.h 2013-05-11 23:23:27 +01:00 (rev 13388)
+++ trunk/include/vki/vki-mips32-linux.h 2013-05-12 01:52:38 +01:00 (rev 13389)
@@ -78,12 +78,12 @@
#define VKI_MAX_PAGE_SHIFT VKI_PAGE_SHIFT
#define VKI_MAX_PAGE_SIZE VKI_PAGE_SIZE
-//----------------------------------------------------------------------
-// From linux-2.6.35.5/arch/mips/include/asm-generic/shmparam.h
-//----------------------------------------------------------------------
+//----------------------------------------------------------------------
+// From linux-2.6.35.9/arch/mips/include/bits/shm.h
+//----------------------------------------------------------------------
+
+#define VKI_SHMLBA 0x40000
-#define VKI_SHMLBA SHM_ALIGNMENT
-
//----------------------------------------------------------------------
// From linux-2.6.35.5/include/asm/signal.h
//----------------------------------------------------------------------
Modified: trunk/configure.in (+0 -30)
===================================================================
--- trunk/configure.in 2013-05-11 23:23:27 +01:00 (rev 13388)
+++ trunk/configure.in 2013-05-12 01:52:38 +01:00 (rev 13389)
@@ -740,37 +740,7 @@
fi
AC_MSG_RESULT([checking for Pagesize... ${psize}k])
-#----------------------------------------------------------------------------
-# Define shm_align for MIPS (--shared-memory-alignment)
-#----------------------------------------------------------------------------
-AC_ARG_WITH(alignment,
- [ --with-alignment= shared memory alignment for MIPS],
- [align=$withval],
- [align=-1]
-)
-mod=`expr $align % 1024`
-
-let "psz=psize*1024*2"
-
-if test "$align" = "-1"; then
- AC_DEFINE([SHM_ALIGNMENT], 2*(1UL << MIPS_PAGE_SHIFT),
- [configured memory alignment 2*PAGE_SIZE])
- AC_MSG_RESULT([checking for shared memory alignment... 2*PAGE_SIZE])
-elif test "$mod" = "0"; then
- if test $align -lt $psz;
- then
- AC_MSG_ERROR([Alignment must be >= PAGE_SIZE])
- else
- AC_DEFINE_UNQUOTED([SHM_ALIGNMENT], ${align},
- [configured memory alignment 2*PAGE_SIZE])
- AC_MSG_RESULT([checking for shared memory alignment... ${align}])
- fi
-else
- AC_MSG_ERROR([Alignment % 1024 must be zero])
-fi
-
-
#----------------------------------------------------------------------------
# Extra fine-tuning of installation directories
#----------------------------------------------------------------------------
|
|
From: John R. <jr...@bi...> - 2013-05-12 02:08:15
|
> petarj 2013-05-12 01:52:38 +0100 (Sun, 12 May 2013) > > New Revision: 13389 > > Log: > mips: default VKI_SHMLBA to the MIPS Linux kernel value SHMLBA > > This change removes option to define shared-memory-alignment for MIPS, > instead default value (0x40000) from MIPS Linux kernel will be used. It would be appropriate to list reasons *why* this change is being made, such as bug numbers that would have been prevented, new architectures or CPU implementations that strongly enforce the kernel default, etc. The change itself hurts because there are going to be programs that used to run (or could have run) under a less-restrictive valgrind on less-restrictive hardware implementations, but won't run in the more-restrictive environment. The increased fragmentation because of larger alignment will cause earlier exhaustion of address space. -- |
|
From: Petar J. <mip...@gm...> - 2013-05-12 03:26:54
|
On Sun, May 12, 2013 at 4:09 AM, John Reiser <jr...@bi...> wrote: > > petarj 2013-05-12 01:52:38 +0100 (Sun, 12 May 2013) > > > > New Revision: 13389 > > > > Log: > > mips: default VKI_SHMLBA to the MIPS Linux kernel value SHMLBA > > > > This change removes option to define shared-memory-alignment for > MIPS, > > instead default value (0x40000) from MIPS Linux kernel will be used. > > It would be appropriate to list reasons *why* this change is being made, > such as bug numbers that would have been prevented, new architectures > or CPU implementations that strongly enforce the kernel default, etc. > The change has been made after running LTP tests on different boards (with different cache sizes) and coming across issues with some of the tests (e.g. shmem_test_03, shmem_test_06, shmem_test_07, shmt02, shmt03, shmt04, shmt05, shmt06, shmt07, shmt08, shmt09, shmt10, shm_test01). > The change itself hurts because there are going to be programs that used > to run > (or could have run) under a less-restrictive valgrind on less-restrictive > hardware implementations, but won't run in the more-restrictive > environment. > The increased fragmentation because of larger alignment will cause > earlier exhaustion of address space. > Theoretically, this is true, yet we are not aware of any program that has this issue. On the other side, a common problem (more often seen after MIPS64 came into Valgrind) is that users can not configure Valgrind correctly, as they do not know minimal correct value to put for share memory alignment. Defaulting value to the kernel default seems to resolve the issues (and I was under impression that other arches in Valgrind do the same, e.g. ARM defaults to 4 * PAGE_SIZE), yet I do agree with the comments you have made and was aware of it. Petar |