procps/ps
Stephen Brennan 31343570e1 Set TZ to avoid repeated stat("/etc/localtime")
With glibc, each time the strftime() function is used (twice per process
in a typical ps -fe run), a stat("/etc/localtime") system call is used
to determine the timezone. Not only does this add extra system call
overhead, but when multiple ps processes are trying to access this
file (or multiple glibc programs using strftime) in parallel, this can
trigger significant lock contention within the OS kernel.

Since ps is not intended to run for long periods of time as a
daemon (during which the system timezone could be altered and PS might
reasonably be expected to adapt its output), there is no benefit to
repeatedly doing this stat(). To stop this behavior, explicitly set the
TZ variable to its default value (:/etc/localtime) whenever it is unset.
glibc will then cache the stat() result.
2020-12-22 11:08:36 +11:00
..
common.h ps: Increase command selection field to 64 2018-05-19 22:10:11 +10:00
COPYING license: update FSF addresses 2012-03-04 08:04:24 +11:00
display.c Set TZ to avoid repeated stat("/etc/localtime") 2020-12-22 11:08:36 +11:00
global.c Closes: #9 ps: Remove Unix98 output limitations 2015-10-26 11:18:52 +11:00
HACKING docs: remove old information from HACKING 2012-01-13 22:42:38 +01:00
help.c ps: add -q/q/--quick-pid option 2014-07-10 21:24:19 +02:00
output.c ps: eliminated inadvertent trailing double semi-colons 2020-04-10 14:35:17 +10:00
parser.c ps: eliminated inadvertent trailing double semi-colons 2020-04-10 14:35:17 +10:00
procps.1 Consolidated patch of previously merged CYGWIN support 2017-09-03 20:59:23 +10:00
ps.1 docs: some manpage fixes 2020-06-04 22:25:26 +10:00
regression procps 010114 2002-02-01 22:47:29 +00:00
select.c ps: Match on truncated 16 char for -C 2020-09-24 22:01:22 +10:00
sortformat.c ps/sortformat.c: Avoid "sep_loc + 1" when sep_loc is NULL. 2018-05-19 07:32:22 +10:00
stacktrace.c misc: eliminate all those remaining gcc -Wall warnings 2017-05-22 21:34:32 +10:00