tech-pkg archive

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

Re: Testing mksh as bootstrap shell



    Date:        Thu, 25 Jun 2020 10:32:49 +0100
    From:        Jonathan Perkin <jperkin%joyent.com@localhost>
    Message-ID:  <20200625093249.GW4999%joyent.com@localhost>

  | I went digging into the xnu archives to see if it is possible we could
  | switch mk/platform/Darwin.mk over to using "ulimit -v" as that appears
  | to be the correct option now.  Apple switched over from RLIMIT_RSS in
  | 10.3.9 (xnu-517.12.7) to RLIMIT_AS in 10.4 (xnu-792), where RLIMIT_RSS
  | was redefined to be a compat alias for RLIMIT_AS.

That's weird, they're two different things (or are intended to be, and
are on NetBSD, though I have no idea how well implemented).  RSS (-m)
is intended to be a limit on physical memory occupied (and is more a hint
to the kernel to more aggressively page out pages from this process if it
is using more than that, and RAM is in short supply), whereas AS (-v)
is a limit on the amount of virtual memory the process is permitted to
own.

I can understand not supporting -m - many systems don't have any good way
of handling that, particularly with so much of a process's addr space being
shared these days ... the accounting for that is messy) but making the
two options equivalent seems bizarre (so I can understand why mksh might want
to not support -m if what it would be doing would be what -v is intended for).

Which you should use depends upon which one you really want to set, if
you'[re trying to allow the process to grab (or not grab) lots of RAM,
and instead page less (or more) then -m, if you're trying to enlarge
(or limit) the virtual addr space for the process, then use -v.

kre

ps: both -m and -v appear to have the same (intended) meaning in most shells.




Home | Main Index | Thread Index | Old Index