From c98012dff972e52b8909c7db5a786cf51fd7f213 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sun, 7 Nov 2021 11:45:01 +0100 Subject: [PATCH 264/325] g_eli: Don't include the thread number in the process name if there's only one thread Increases the chances that the provider isn't truncated as shown below (using ElectroBSD-20211105-d40b6832c298): last pid: 83498; load averages: 2.30, 1.84, 1.78 up 0+18:39:06 11:45:39 125 processes: 3 running, 121 sleeping, 1 waiting CPU: 42.2% user, 32.5% nice, 14.9% system, 7.6% interrupt, 2.7% idle Mem: 1125M Active, 406M Inact, 108M Laundry, 2092M Wired, 131M Free ARC: 1020M Total, 365M MFU, 376M MRU, 14M Anon, 17M Header, 248M Other, 1017M Target 468M Compressed, 658M Uncompressed, 1.41:1 Ratio Swap: 16G Total, 294M Used, 16G Free, 1% Inuse PID JID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND 4126 4 _tor 4 93 0 1099M 690M CPU1 1 812:03 68.34% /usr/local/bin/tor -f /usr/local/etc/tor/torrc --PidFile /var/run/tor/tor.pid --RunAsDaemon 1 --DataDirectory /var/db/tor 33494 10 _tor 4 37 0 795M 392M kqread 0 296:39 24.45% /usr/local/bin/tor -f /usr/local/etc/tor/torrc --PidFile /var/run/tor/tor.pid --RunAsDaemon 1 --DataDirectory /var/db/tor 12 0 root 18 -52 - 0B 288K WAIT 1 166:22 14.37% [intr] 11 0 root 2 155 ki31 0B 32K RUN 0 549:39 5.24% [idle] 28 0 root 317 -16 - 0B 5088K spa->s 0 2:06 3.89% [zpool-rpool] 25 0 root 1 20 - 0B 16K geli:w 0 1:20 2.30% [g_eli[0] gpt/rpool-] 24 0 root 1 20 - 0B 16K geli:w 1 1:20 2.30% [g_eli[0] gpt/rpool-] 27 0 root 1 20 - 0B 16K geli:w 1 1:20 2.29% [g_eli[0] gpt/rpool-] 26 0 root 1 20 - 0B 16K geli:w 1 1:20 2.29% [g_eli[0] gpt/rpool-] 62912 0 root 1 20 - 0B 16K geli:w 0 18:15 0.92% [g_eli[0] gpt/dpool-] 26878 0 root 1 20 - 0B 16K geli:w 1 18:16 0.91% [g_eli[0] gpt/dpool-] 97173 0 root 1 20 - 0B 16K geli:w 1 18:16 0.90% [g_eli[0] gpt/dpool-] 17460 0 root 1 20 - 0B 16K geli:w 1 18:17 0.88% [g_eli[0] gpt/dpool-] Obtained from: ElectroBSD --- sys/geom/eli/g_eli.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c index 5aaaf44c92ad..1d4cc14c9f7d 100644 --- a/sys/geom/eli/g_eli.c +++ b/sys/geom/eli/g_eli.c @@ -888,9 +888,14 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, struct g_provider *bpp, } goto failed; } - - error = kproc_create(g_eli_worker, wr, &wr->w_proc, 0, 0, - "g_eli[%u] %s", i, bpp->name); + /* Only include the thread number if there's more than one */ + if (threads == 1) { + error = kproc_create(g_eli_worker, wr, &wr->w_proc, 0, 0, + "g_eli %s", bpp->name); + } else { + error = kproc_create(g_eli_worker, wr, &wr->w_proc, 0, 0, + "g_eli[%u] %s", i, bpp->name); + } if (error != 0) { g_eli_freesession(wr); free(wr, M_ELI); -- 2.32.0