NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: semaphores options



    Date:        Mon, 08 Apr 2019 20:37:39 -0700
    From:        "Greg A. Woods" <woods%planix.com@localhost>
    Message-ID:  <m1hDhZs-0036tPC@more.local>


  | This commit adds a great big ugly "#if XXX_PRG" around all the related
  | SysV IPC settings in sys/conf/param.c, i.e. it entirely removes all
  | support for "options SEMMNI=NNN" and related.

That makes some sense.

  | Perhaps this only affects kernels which have the SysV IPC code baked in,
  | though I've no idea how the so-called modular world is supposed to work

If anything it would be the other way.   The point is that one set of modules
are made, which are loadable into any compatible kernel.   No one kernel
config file controls the module builds (it cannot really, which one would
be the right one?) so there's no real way to control config that way.

For kernels with the modules built in, it could be made to work, but that
then makes those modules different from the loadable ones, which I guess is
not a good idea.

But this provides an opportunity for the proverbial someone to fix all
this properly - kernel config time limits hasn't been the right way to
handle this kind of thing for decades.

All these limits ought to be dynamically controllable via sysctl.

That proverbial someone just needs to make that happen (which is unlikely
to be trivial - converting code that has assumed a fix constant limit into
code where the limit can be changed, either way, any time at all, often
involves a significany rewrite of the code.)

  | The real underlying problem may be that none of the SysV IPC options
  | from options(4) where ever properly set up with "defflag" or "defparam"
  | in the appropriate "files" file (sys/kern/files.kern probably), or as we
  | used to say, they were never "defopt'ed" for config.  See config(5).

They probably were (or might have) - but ...

  | Having "options FOO=1234" worked without "defparam" if the use was in
  | sys/conf/param.c, but it doesn't seem to work with the new regime.

You're right, it doesn't.   Nor should it really, it is the wrong way.

  | Maybe it would work again if "defparam" lines were added to the right
  | place.

No, it wouldn't.

  | # sysctl kern.ipc
  | kern.ipc.sysvmsg = 1
  | kern.ipc.sysvsem = 1
  | kern.ipc.sysvshm = 1
  | kern.ipc.shmmax = 2097152000
  | kern.ipc.shmmni = 128
  | kern.ipc.shmseg = 128
  | kern.ipc.shmmaxpgs = 512000
  | kern.ipc.shm_use_phys = 0
  | kern.ipc.msgmni = 200
  | kern.ipc.msgseg = 16384
  | kern.ipc.semmni = 10
  | kern.ipc.semmns = 60
  | kern.ipc.semmnu = 30

If those values are writable, then you know the solution!
If not, then someone(TPS) needs to make that possible first.

I don't know (or really care).   The SysV IPC/SHM/Sem stuff has
always been an ugly anachronism to me.

kre



Home | Main Index | Thread Index | Old Index