From owner-svn-src-all@FreeBSD.ORG Thu Jul 14 14:18:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D14A106566B; Thu, 14 Jul 2011 14:18:14 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C9328FC08; Thu, 14 Jul 2011 14:18:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6EEIEEX032983; Thu, 14 Jul 2011 14:18:14 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6EEIEjo032975; Thu, 14 Jul 2011 14:18:14 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201107141418.p6EEIEjo032975@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 14 Jul 2011 14:18:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224016 - in head: sys/compat/linux sys/conf sys/kern sys/sys usr.bin/ipcs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2011 14:18:14 -0000 Author: bz Date: Thu Jul 14 14:18:14 2011 New Revision: 224016 URL: http://svn.freebsd.org/changeset/base/224016 Log: Remove semaphore map entry count "semmap" field and its tuning option that is highly recommended to be adjusted in too much documentation while doing nothing in FreeBSD since r2729 (rev 1.1). ipcs(1) needs to be recompiled as it is accessing _KERNEL private variables. Reviewed by: jhb (before comment change on linux code) Sponsored by: Sandvine Incorporated Modified: head/sys/compat/linux/linux_ipc.c head/sys/conf/NOTES head/sys/conf/options head/sys/kern/sysv_sem.c head/sys/sys/sem.h head/usr.bin/ipcs/ipc.c head/usr.bin/ipcs/ipcs.c Modified: head/sys/compat/linux/linux_ipc.c ============================================================================== --- head/sys/compat/linux/linux_ipc.c Thu Jul 14 14:15:21 2011 (r224015) +++ head/sys/compat/linux/linux_ipc.c Thu Jul 14 14:18:14 2011 (r224016) @@ -575,7 +575,15 @@ linux_semctl(struct thread *td, struct l return (error); case LINUX_IPC_INFO: case LINUX_SEM_INFO: - bcopy(&seminfo, &linux_seminfo, sizeof(linux_seminfo) ); + bcopy(&seminfo, &linux_seminfo.semmni, sizeof(linux_seminfo) - + sizeof(linux_seminfo.semmap) ); + /* + * Linux does not use the semmap field either but populates it + * with the defined value from SEMMAP, which really is redefined + * to SEMMNS, which they define as SEMMNI * SEMMSL. + * Try to simulate this returning our dynamic semmns value. + */ + linux_seminfo.semmap = linux_seminfo.semmns; /* XXX BSD equivalent? #define used_semids 10 #define used_sems 10 Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Jul 14 14:15:21 2011 (r224015) +++ head/sys/conf/NOTES Thu Jul 14 14:18:14 2011 (r224016) @@ -2833,9 +2833,6 @@ options VERBOSE_SYSINIT ##################################################################### # SYSV IPC KERNEL PARAMETERS # -# Maximum number of entries in a semaphore map. -options SEMMAP=31 - # Maximum number of System V semaphores that can be used on the system at # one time. options SEMMNI=11 Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu Jul 14 14:15:21 2011 (r224015) +++ head/sys/conf/options Thu Jul 14 14:18:14 2011 (r224016) @@ -164,7 +164,6 @@ MSGMNI opt_sysvipc.h MSGSEG opt_sysvipc.h MSGSSZ opt_sysvipc.h MSGTQL opt_sysvipc.h -SEMMAP opt_sysvipc.h SEMMNI opt_sysvipc.h SEMMNS opt_sysvipc.h SEMMNU opt_sysvipc.h Modified: head/sys/kern/sysv_sem.c ============================================================================== --- head/sys/kern/sysv_sem.c Thu Jul 14 14:15:21 2011 (r224015) +++ head/sys/kern/sysv_sem.c Thu Jul 14 14:18:14 2011 (r224016) @@ -149,9 +149,6 @@ struct sem_undo { #endif /* shouldn't need tuning */ -#ifndef SEMMAP -#define SEMMAP 30 /* # of entries in semaphore map */ -#endif #ifndef SEMMSL #define SEMMSL SEMMNS /* max # of semaphores per id */ #endif @@ -182,7 +179,6 @@ struct sem_undo { * semaphore info struct */ struct seminfo seminfo = { - SEMMAP, /* # of entries in semaphore map */ SEMMNI, /* # of semaphore identifiers */ SEMMNS, /* # of semaphores in system */ SEMMNU, /* # of undo structures in system */ @@ -194,8 +190,6 @@ struct seminfo seminfo = { SEMAEM /* adjust on exit max value */ }; -SYSCTL_INT(_kern_ipc, OID_AUTO, semmap, CTLFLAG_RW, &seminfo.semmap, 0, - "Number of entries in the semaphore map"); SYSCTL_INT(_kern_ipc, OID_AUTO, semmni, CTLFLAG_RDTUN, &seminfo.semmni, 0, "Number of semaphore identifiers"); SYSCTL_INT(_kern_ipc, OID_AUTO, semmns, CTLFLAG_RDTUN, &seminfo.semmns, 0, @@ -255,7 +249,6 @@ seminit(void) { int i, error; - TUNABLE_INT_FETCH("kern.ipc.semmap", &seminfo.semmap); TUNABLE_INT_FETCH("kern.ipc.semmni", &seminfo.semmni); TUNABLE_INT_FETCH("kern.ipc.semmns", &seminfo.semmns); TUNABLE_INT_FETCH("kern.ipc.semmnu", &seminfo.semmnu); Modified: head/sys/sys/sem.h ============================================================================== --- head/sys/sys/sem.h Thu Jul 14 14:15:21 2011 (r224015) +++ head/sys/sys/sem.h Thu Jul 14 14:18:14 2011 (r224016) @@ -107,8 +107,7 @@ union semun { * semaphore info struct */ struct seminfo { - int semmap, /* # of entries in semaphore map */ - semmni, /* # of semaphore identifiers */ + int semmni, /* # of semaphore identifiers */ semmns, /* # of semaphores in system */ semmnu, /* # of undo structures in system */ semmsl, /* max # of semaphores per id */ Modified: head/usr.bin/ipcs/ipc.c ============================================================================== --- head/usr.bin/ipcs/ipc.c Thu Jul 14 14:15:21 2011 (r224015) +++ head/usr.bin/ipcs/ipc.c Thu Jul 14 14:18:14 2011 (r224016) @@ -73,8 +73,7 @@ struct nlist symbols[] = { X(shmseg, sizeof(u_long)) \ X(shmall, sizeof(u_long)) -#define SEMINFO_XVEC X(semmap, sizeof(int)) \ - X(semmni, sizeof(int)) \ +#define SEMINFO_XVEC X(semmni, sizeof(int)) \ X(semmns, sizeof(int)) \ X(semmnu, sizeof(int)) \ X(semmsl, sizeof(int)) \ Modified: head/usr.bin/ipcs/ipcs.c ============================================================================== --- head/usr.bin/ipcs/ipcs.c Thu Jul 14 14:15:21 2011 (r224015) +++ head/usr.bin/ipcs/ipcs.c Thu Jul 14 14:18:14 2011 (r224016) @@ -474,8 +474,6 @@ print_ksemtotal(struct seminfo seminfo) { printf("seminfo:\n"); - printf("\tsemmap: %12d\t(# of entries in semaphore map)\n", - seminfo.semmap); printf("\tsemmni: %12d\t(# of semaphore identifiers)\n", seminfo.semmni); printf("\tsemmns: %12d\t(# of semaphores in system)\n",