From nobody Sun Mar 17 16:56:30 2024 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 4TyPK23RCnz5DkQ6; Sun, 17 Mar 2024 16:56:38 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from www121.sakura.ne.jp (www121.sakura.ne.jp [153.125.133.21]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4TyPK16Dc6z47xL; Sun, 17 Mar 2024 16:56:36 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Authentication-Results: mx1.freebsd.org; none Received: from kalamity.joker.local (123-1-21-232.area1b.commufa.jp [123.1.21.232]) (authenticated bits=0) by www121.sakura.ne.jp (8.17.1/8.17.1/[SAKURA-WEB]/20201212) with ESMTPA id 42HGuUxg063722; Mon, 18 Mar 2024 01:56:31 +0900 (JST) (envelope-from junchoon@dec.sakura.ne.jp) Date: Mon, 18 Mar 2024 01:56:30 +0900 From: Tomoaki AOKI To: "Drew Gallatin" Cc: "Nuno Teixeira" , tuexen@freebsd.org, garyj@gmx.de, current@freebsd.org, net@freebsd.org, "Randall Stewart" Subject: Re: Request for Testing: TCP RACK Message-Id: <20240318015630.ad95863f2f4d52e779ff0af5@dec.sakura.ne.jp> In-Reply-To: References: <42C327BD-6CE4-43AA-A1AE-3BEC08D623DB@freebsd.org> <78D1FF09-71A3-4486-B934-D8332F54B237@freebsd.org> <20240316104053.20bef8c2@ernst.home> <20240316115128.33d11f7b@ernst.home> <7367F29A-D52B-4828-B79A-AA2667E81E7D@freebsd.org> <4FF534F6-B35D-4596-8D1E-226AD1347AC8@freebsd.org> <6e795e9c-8de4-4e02-9a96-8fabfaa4e66f@app.fastmail.com> Organization: Junchoon corps X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) 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 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:7684, ipnet:153.125.128.0/18, country:JP] X-Rspamd-Queue-Id: 4TyPK16Dc6z47xL On Sun, 17 Mar 2024 11:40:54 -0400 "Drew Gallatin" wrote: > Resending with the patch as an attachment. > > Drew > > On Sun, Mar 17, 2024, at 11:39 AM, Drew Gallatin wrote: > > I don't have the full context, but it seems like the complaint is a performance regression in bonnie++ and perhaps other things when tcp_hpts is loaded, even when it is not used. Is that correct? > > > > If so, I suspect its because we drive the tcp_hpts_softclock() routine from userret(), in order to avoid tons of timer interrupts and context switches. To test this theory, you could apply a patch like: > > > > diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c > > index e9a16cd0b36e..54b540c97123 100644 > > --- a/sys/kern/subr_trap.c > > +++ b/sys/kern/subr_trap.c > > @@ -138,7 +138,7 @@ userret(struct thread *td, struct trapframe *frame) > > * Software Timer Support for Network Processing" > > * by Mohit Aron and Peter Druschel. > > */ > > - tcp_hpts_softclock(); > > + /*tcp_hpts_softclock();*/ > > /* > > * Let the scheduler adjust our priority etc. > > */ > > > > > > If that fixes it, I suspect we should either make this hook optional for casual users of tcp_hpts(), or add some kind of "last called" timestamp to prevent it being called over and over and over on workloads which are syscall heavy. > > > > Note that for non-casual users of hpts (like Netflix, with hundreds of thousands of TCP connections managed by hpts), this call is a huge win, so I think we'd prefer that it remain in some form. > > > > Drew Controlled via RW or RWTUN sysctl/tunable? -- Tomoaki AOKI