Author: pjd
Date: Wed Feb  8 09:18:22 2012
New Revision: 231195
URL: http://svn.freebsd.org/changeset/base/231195

Log:
  Allow to set kern.ipc.shmmax from /boot/loader.conf.
  
  MFC after:    1 week

Modified:
  head/sys/kern/sysv_shm.c

Modified: head/sys/kern/sysv_shm.c
==============================================================================
--- head/sys/kern/sysv_shm.c    Wed Feb  8 08:52:40 2012        (r231194)
+++ head/sys/kern/sysv_shm.c    Wed Feb  8 09:18:22 2012        (r231195)
@@ -891,14 +891,14 @@ shminit()
                printf("kern.ipc.shmmaxpgs is now called kern.ipc.shmall!\n");
 #endif
        TUNABLE_ULONG_FETCH("kern.ipc.shmall", &shminfo.shmall);
-
-       /* Initialize shmmax dealing with possible overflow. */
-       for (i = PAGE_SIZE; i > 0; i--) {
-               shminfo.shmmax = shminfo.shmall * i;
-               if (shminfo.shmmax >= shminfo.shmall)
-                       break;
+       if (!TUNABLE_ULONG_FETCH("kern.ipc.shmmax", &shminfo.shmmax)) {
+               /* Initialize shmmax dealing with possible overflow. */
+               for (i = PAGE_SIZE; i > 0; i--) {
+                       shminfo.shmmax = shminfo.shmall * i;
+                       if (shminfo.shmmax >= shminfo.shmall)
+                               break;
+               }
        }
-
        TUNABLE_ULONG_FETCH("kern.ipc.shmmin", &shminfo.shmmin);
        TUNABLE_ULONG_FETCH("kern.ipc.shmmni", &shminfo.shmmni);
        TUNABLE_ULONG_FETCH("kern.ipc.shmseg", &shminfo.shmseg);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to