Bug 286093 - geli thread names appear truncated
Summary: geli thread names appear truncated
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 14.2-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-geom (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-14 13:10 UTC by Anton Saietskii
Modified: 2025-04-19 04:45 UTC (History)
3 users (show)

See Also:


Attachments
sys/geom/eli: If the thread name will be truncated, use the last characters instead of the first ones (5.58 KB, patch)
2025-04-16 12:06 UTC, Fabian Keil
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Saietskii 2025-04-14 13:10:19 UTC
$ ps ax | grep '/[s]wa'
   79  -  DL       0:02.65 [g_eli[0] mirror/swa]
   80  -  DL       0:02.77 [g_eli[1] mirror/swa]
   81  -  DL       0:02.88 [g_eli[2] mirror/swa]
   82  -  DL       0:02.96 [g_eli[3] mirror/swa]
   83  -  DL       0:02.63 [g_eli[4] mirror/swa]
   84  -  DL       0:02.93 [g_eli[5] mirror/swa]
   85  -  DL       0:02.60 [g_eli[6] mirror/swa]
   86  -  DL       0:02.88 [g_eli[7] mirror/swa]
$ geli status mirror/swap.eli
           Name  Status  Components
mirror/swap.eli  ACTIVE  mirror/swap
$

Expected: [g_eli[0] mirror/swap] and so on.
Comment 1 Ed Maste freebsd_committer freebsd_triage 2025-04-15 19:52:47 UTC
This is expected: the kernel thread name is only MAXCOMLEN (19) bytes, so anything longer is truncated.

We could remove _ (and perhaps also []) to make it shorter, without materially impacting clarity.

geli[0] mirror/swap
geli[1] mirror/swap
...

or

geli0 mirror/swap
geli1 mirror/swap
Comment 2 Anton Saietskii 2025-04-15 20:44:09 UTC
(In reply to Ed Maste from comment #1)

Saving a few chars in geli prefix wouldn't really help here as we can also encrypt diskids (this one I have now in addition to glabel), gptids which are much longer and won't fit anyway...
Thanks for describing exact reason though, it led me to review D38119 where jhb@'s comment particularly interesting -- looks like it wouldn't be possible just bump value, even on my local machine. Because of this, I wouldn't mind if this PR will be closed if not kept as feature request.
Comment 3 Fabian Keil 2025-04-16 12:06:24 UTC
Created attachment 259606 [details]
sys/geom/eli: If the thread name will be truncated, use the last characters instead of the first ones

In ElectroBSD the g_eli thread number is only included if there's more
than one thread and the thread name is truncated by using the last
characters instead of the first which are usually more meaningful.