From nobody Tue Oct 31 17:06:13 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 4SKc433lNSz4ycy2
	for <current@mlmmj.nyi.freebsd.org>; Tue, 31 Oct 2023 17:06:27 +0000 (UTC)
	(envelope-from jhb@FreeBSD.org)
Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4])
	(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 4SKc433H6nz3f0h;
	Tue, 31 Oct 2023 17:06:27 +0000 (UTC)
	(envelope-from jhb@FreeBSD.org)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1698771987;
	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:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=nVQXcJvTo37mpcM+BubQzBH9z2UxmiQttWUvmSmE880=;
	b=hv9x3cCH7MXKeCu4RKnO4Q7T5/AlqhD81Gs8hWfEIhpLmAe1D3JG6No5hgm2E05huDchK5
	11Pb7ApP4RLOfAYiksSsrUmkpVImG+aVLDh0UEFgGpcxw8kjv2cL91XJ+we1X04LAs0kkQ
	8n2iUgkIkYNsAexbbkPAkK5cFPi5FWtC9dnyMsyOMveRt7LCTdnwGWcgprlQkj4EGuBg/D
	+7Z1ebk4dOSli+ghe9VMCcXzo7PNSRytqUFndSfnbwsOwBTh2/6EhbzMUPOwUWXjCX/Xz4
	qjanZjUjFKHLaMlB2wZmtcYRkdFWPtpxJiFNUtdTa6vhdXP/QUwdapneZL64TA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org;
	s=dkim; t=1698771987;
	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:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=nVQXcJvTo37mpcM+BubQzBH9z2UxmiQttWUvmSmE880=;
	b=BCJ0e/Esd4zCeFu1KIR1ZQ2T+4+qJqZzewgvEhvRI/4GYM0BnN1Ea4t0cOg+7hlegz5ZPd
	iJplsYVSMVCOVuzGHt5jTlOL3JCXpx14sAx+ieAg2Y4uQtDwj8RL4MUtdjMcmwtRwUCeXz
	ld9NgkH37TCrZym65MdOwea8CDPuLFTqEDgLWM4nAcLwc5nu9PGOxNofT0JxTYd3gBwWsD
	uzZW+5N+A3+JL61AIOj0DtuyBjEYYqiPYk7atIHQaN5EaxPafSiJh/FpAGMS7HfjLH6uT0
	aBwOdiLWFslWcRM+KsCoUDjaOHnU/bA8mumCR/hVzwZLVGxtDPJcuX0+xaYuAA==
ARC-Authentication-Results: i=1;
	mx1.freebsd.org;
	none
ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698771987; a=rsa-sha256; cv=none;
	b=pM08izAONSzSW7KqLHMVzLlioUhsUrbS7pA7i42ZHEbnm2ufLhsmmj8ttfa3XM6mR9G9og
	rvTSL7u3pfrfS8CEczRy0PAw7EZsuuJrW7ab132iwRDRCv7cDl2pTF/cndza/aJ9ngRfij
	1yO2UhgngjzjN6gyDm5XOsPhTGs2rGySqAD8HZqZJcFzklxQb/Q7woOpZfhLyYGxasKfdG
	5bdesqbkh8pqRPtcpeDA7sveY6IZsp/l5y5N70Jyl984piIZk6ISgsw1r7DInB9Q1oklJ9
	sJ3PuzDdOVRRNCVspfB3Ts4YY1JOnqEGsGQZl8HhJoc+dKaLjzJo6iqmBVWlPQ==
Received: from [10.0.0.43] (unknown [98.47.13.2])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(Client did not present a certificate)
	(Authenticated sender: jhb)
	by smtp.freebsd.org (Postfix) with ESMTPSA id 4SKc426CxTzkxY;
	Tue, 31 Oct 2023 17:06:26 +0000 (UTC)
	(envelope-from jhb@FreeBSD.org)
Message-ID: <77952261-2fe0-428e-b72c-d805f0273a76@FreeBSD.org>
Date: Tue, 31 Oct 2023 10:06:13 -0700
List-Id: Discussions about the use of FreeBSD-current <freebsd-current.freebsd.org>
List-Archive: https://lists.freebsd.org/archives/freebsd-current
List-Help: <mailto:freebsd-current+help@freebsd.org>
List-Post: <mailto:freebsd-current@freebsd.org>
List-Subscribe: <mailto:freebsd-current+subscribe@freebsd.org>
List-Unsubscribe: <mailto:freebsd-current+unsubscribe@freebsd.org>
Sender: owner-freebsd-current@freebsd.org
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: KTLS thread on 14.0-RC3
Content-Language: en-US
To: Zhenlei Huang <zlei@FreeBSD.org>, Gordon Bergling <gbe@freebsd.org>
Cc: FreeBSD Current <current@freebsd.org>, gallatin@FreeBSD.org
References: <ZT4pKpw35P-J-Q_T@bastion.ttyv0.de>
 <F6D87896-038C-4152-AFBD-68B0DDC71801@FreeBSD.org>
 <53AC8651-141E-4950-84D9-FD94E8B353FD@FreeBSD.org>
From: John Baldwin <jhb@FreeBSD.org>
In-Reply-To: <53AC8651-141E-4950-84D9-FD94E8B353FD@FreeBSD.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

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.

-- 
John Baldwin