From nobody Wed Nov 01 01:01:32 2023 X-Original-To: current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SKpcQ4n7Kz4yR9l for ; Wed, 1 Nov 2023 01:01:42 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SKpcQ4L3jz3Mmf; Wed, 1 Nov 2023 01:01:42 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698800502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FhmwNQxwUeEmBjqoRw200ufn2KYn0CbJx3yukAUk2gA=; b=NYlskJaxOtNv/7MpOJXQTtdiEEu6Svfr3qBdH5pYPeV61gkrJfQKZVIeVbhesBSaOxdR5t eBSNlHih6uXGBEO9jRUpkg5NjyKGi2ibpIps3DgDoxM6iddhlA9dtMX8W5jTynbw0MoODl THA/33KZyzWa37EJ+FA7ol2QGnzAOPx1W+uTsFag8EZcjtcWTG3+sBkMzx0nEsPG2RzhXS mF0H5//Cf1DnMcqUjhDd2xhzI5lerUHGwxXtbr+ec2znI9q1mzuSuRGZ7jqONKOz04Y173 r1QmU0jZcXqKWBNUvzLabylesT2IR0ULUYf86ugRS33R3JDuW5rAnxJVhmfR7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698800502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FhmwNQxwUeEmBjqoRw200ufn2KYn0CbJx3yukAUk2gA=; b=X2pLRyQZiSXnI7SrDa7EX+vEsIO9LgJknqa/hEhhPuLInK8mVzLu0VmVrBkz1t5RI42r3s kDezOK3+NyLCVgQzJWrYhJPYVnGflu0z0eXbs/z8KWg9tuI3bW6qkjk/rdRfTPqjE4CC9h cXldD/EdVWNmPFZNQU7qdk5LvkIzpHaOu32rmEtcfEO0u7goN1+U8kguzeyvNUjdfgX22h Br0ZXgP8DB5tVCCkKm3gHRVgt5v8REkfmeYMJhzV+Q9syzMKwhbvsWEoE6bzdMTYTDPdC5 CfvP9oOkCPuP3ycBEItHtqsRbZdCS9JYrgfKlG/Arwt8zEuF8x6tYkvJPEwNHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698800502; a=rsa-sha256; cv=none; b=QDZw33TSjY0Ic4ydHrnjPh/At88eWr8db3QSEpiPTKiBTCjXFYVNPiQXGp0OKY/g2wSDik xfaOFtAKQy/7+0zs/f10bR9jU/uebzCaPb0xjozV+RzR3HImcLHKnNmdwmlDp/ta0A00FX rnrDOF/jdbJ5REYgHaSNySILY+1uQMW5/rI+u+iGC2sHy/W3KBqouy0VdhPUOq4ncF2i/h Eh86N9Ocg7uiJAMif/egotHofzPwdf6+L1l/kpH6NBFgQnTA3Zl72n0rh/L5CmpqfTtEFN JwMu95jOu4xJ9rredWMsoDkdfv0atJDpggt6JE7owRFqIC9o6y10SnkMKZg+Jg== Received: from smtpclient.apple (unknown [IPv6:2001:19f0:6001:9db:98f0:9fe0:3545:10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: zlei/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4SKpcN4Fpmzsqs; Wed, 1 Nov 2023 01:01:40 +0000 (UTC) (envelope-from zlei@FreeBSD.org) From: Zhenlei Huang Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_E2A72CED-7518-44EF-9F30-A7D526AA07AC" List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.4\)) Subject: Re: KTLS thread on 14.0-RC3 Date: Wed, 1 Nov 2023 09:01:32 +0800 In-Reply-To: Cc: John Baldwin , Gordon Bergling , FreeBSD Current , gallatin@freebsd.org To: Rick Macklem References: <53AC8651-141E-4950-84D9-FD94E8B353FD@FreeBSD.org> <77952261-2fe0-428e-b72c-d805f0273a76@FreeBSD.org> X-Mailer: Apple Mail (2.3696.120.41.1.4) --Apple-Mail=_E2A72CED-7518-44EF-9F30-A7D526AA07AC Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Nov 1, 2023, at 8:37 AM, Rick Macklem = wrote: >=20 > On Tue, Oct 31, 2023 at 10:06=E2=80=AFAM John Baldwin > wrote: >>=20 >> On 10/30/23 3:41 AM, Zhenlei Huang wrote: >>>=20 >>>=20 >>>> On Oct 30, 2023, at 12:09 PM, Zhenlei Huang = wrote: >>>>=20 >>>>=20 >>>>=20 >>>>> On Oct 29, 2023, at 5:43 PM, Gordon Bergling = wrote: >>>>>=20 >>>>> Hi, >>>>>=20 >>>>> I am currently building a new system, which should be based on = 14.0-RELEASE. >>>>> Therefor I am tracking releng/14.0 since its creation and updating = it currently >>>>> via the usualy buildworld steps. >>>>>=20 >>>>> What I have noticed recently is, that the [KTLS] is missing. I = have a stable/13 >>>>> system which shows the [KTLS] thread and a very recent -CURRENT = that also shows >>>>> the [KTLS] thread. >>>>>=20 >>>>> The stable/13 and releng/14.0 systems both use the GENERIC kernel, = without any >>>>> custom modifications. >>>>>=20 >>>>> Loaded KLDs are also the same. >>>>>=20 >>>>> Did I miss something, or is there something in releng/14.0 = missing, which >>>>> is currenlty enabled in stable/13? >>>>=20 >>>> KTLS shall still work as intended, the creation of it threads is = deferred. >>>>=20 >>>> See a72ee355646c (ktls: Defer creation of threads and zones until = first use) >>>>> Run ktls_init() when the first KTLS session is created rather than >>>>> unconditionally during boot. This avoids creating unused threads = and >>>>> allocating unused resources on systems which do not use KTLS. >>>>=20 >>>> ``` >>>> -SYSINIT(ktls, SI_SUB_SMP + 1, SI_ORDER_ANY, ktls_init, NULL); >>>> ``` >>>=20 >>> Seems 14.0 only create one KTLS thread. >>>=20 >>> IIRC 13.2 create one thread per core. >>=20 >> That part should not be different. There should always be one thread = per core. > Just fyi, I see one thread/core. > Did you happen to do something like "ps ax" instead of "ps axHl"? Yes, I typed "ps auxx". `ps axHl` is the right way to get kernel = threads. Sorry for the noise. >=20 > rick > ps: I also see a reclaim_0 thread. >=20 >>=20 >> -- >> John Baldwin --Apple-Mail=_E2A72CED-7518-44EF-9F30-A7D526AA07AC Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Nov 1, 2023, at 8:37 AM, Rick Macklem <rick.macklem@gmail.com> wrote:

On Tue, Oct 31, 2023 at 10:06=E2=80=AFAM John Baldwin = <jhb@freebsd.org> = wrote:

On 10/30/23 3:41 AM, Zhenlei Huang wrote:


On Oct 30, 2023, at = 12:09 PM, Zhenlei Huang <zlei@FreeBSD.org> wrote:



On Oct 29, 2023, at 5:43 PM, Gordon Bergling <gbe@freebsd.org> = wrote:

Hi,

I = am currently building a new system, which should be based on = 14.0-RELEASE.
Therefor I am tracking releng/14.0 since its = creation and updating it currently
via the usualy = buildworld steps.

What I have noticed = recently is, that the [KTLS] is missing. I have a stable/13
system which shows the [KTLS] thread and a very recent = -CURRENT that also shows
the [KTLS] thread.

The stable/13 and releng/14.0 systems both use = the GENERIC kernel, without any
custom modifications.

Loaded KLDs are also the same.
Did I miss something, or is there something in releng/14.0 = missing, which
is currenlty enabled in stable/13?

KTLS shall still work as = intended, the creation of it threads is deferred.

See a72ee355646c (ktls: Defer creation of threads and zones = until first use)
Run = ktls_init() when the first KTLS session is created rather than
unconditionally during boot.  This avoids creating = unused threads and
allocating unused resources on systems = which do not use KTLS.

```
-SYSINIT(ktls, SI_SUB_SMP + 1, SI_ORDER_ANY, ktls_init, = NULL);
```

Seems = 14.0 only create one KTLS thread.

IIRC 13.2 = create one thread per core.

That= part should not be different.  There should always be one thread = per core.
Just fyi, I see one thread/core.
Did you = happen to do something like "ps ax" instead of "ps axHl"?

Yes, I typed "ps auxx".  `ps = axHl` is the right way to get kernel threads.
Sorry for the = noise.


rick
ps: I also = see a reclaim_0 thread.


--
John = Baldwin



= --Apple-Mail=_E2A72CED-7518-44EF-9F30-A7D526AA07AC--