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
This commit is contained in:
Bjoern A. Zeeb 2011-07-14 14:18:14 +00:00
parent 682c9e0fed
commit 1080a2c85d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=224016
7 changed files with 11 additions and 18 deletions

View File

@ -575,7 +575,15 @@ linux_semctl(struct thread *td, struct linux_semctl_args *args)
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

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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 */

View File

@ -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)) \

View File

@ -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",