From owner-freebsd-transport@freebsd.org Tue Jul 30 12:40:36 2019 Return-Path: Delivered-To: freebsd-transport@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 28906A23D1 for ; Tue, 30 Jul 2019 12:40:36 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E2BE97DC0 for ; Tue, 30 Jul 2019 12:40:35 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by mail-qk1-x72f.google.com with SMTP id t8so46448180qkt.1 for ; Tue, 30 Jul 2019 05:40:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=3/5exdH/2R5NqbdVa0vrbV6ARJrzCjySce1vR3ffFn8=; b=m218VgB+1OQtSRKns8sycpg+UqA1QKSNTF46MKE2bM0icS7n9jZH21MLpiJl3+Umf3 EDrP9rmg87iRchtBFbs+vyLiLWHw0VOHkrZWFyDZ7nKHx4/+ys/dY3KllbkFd7+vpE4h KENAV547sgL5MzlbU82S/u1XUg/8bekdjfhbRDDH28XOXh+rwAmENDP/Yj4YYS8Osrai 0LmwvuV8g9KDmhzt8I8JzFUCHnH1prYfwHpv8KfvKMfDtFNRQZ/yTi91C4jUx9T5TmVh AIGnSARPNa2IwEFN/0wnfFEMpfDFPJyMTKLJwOxmlG9hh/NiN0rDmSe/u0cDqeu/Ir7k A6Pw== X-Gm-Message-State: APjAAAWJSAf9jElvUUYmE06L75hWpcOfzB3TmWIPpDWclxg5zYFuHdJm dOKUT04ntrnna0/EzaKyNT1yCzubDQM= X-Google-Smtp-Source: APXvYqz+chfqGkc99OpN+Bt+elwUDXF5QjN2r8D3mbGiYoIM8Yy2/faf8p9CiSVQ/rJXoGkkT1RZRA== X-Received: by 2002:a37:bac2:: with SMTP id k185mr75330476qkf.211.1564490433949; Tue, 30 Jul 2019 05:40:33 -0700 (PDT) Received: from ?IPv6:2607:fb10:7061:7fd::2a68? ([2607:fb10:7061:7fd::2a68]) by smtp.gmail.com with ESMTPSA id r36sm34675314qte.71.2019.07.30.05.40.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jul 2019 05:40:33 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: tcpcb cleanup? From: Randall Stewart In-Reply-To: Date: Tue, 30 Jul 2019 08:40:32 -0400 Cc: "freebsd-transport@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: To: "Scheffenegger, Richard" X-Mailer: Apple Mail (2.3445.9.1) X-Rspamd-Queue-Id: 0E2BE97DC0 X-Spamd-Bar: --------------- X-Spamd-Result: default: False [-15.48 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MV_CASE(0.50)[]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[cached: alt1.aspmx.l.google.com]; DKIM_TRACE(0.00)[netflix.com:+]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; DMARC_POLICY_ALLOW(-0.50)[netflix.com,reject]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[netflix.com:s=google]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-transport@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; WHITELIST_DMARC(-7.00)[netflix.com:D:+]; RCVD_IN_DNSWL_NONE(0.00)[f.2.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(-3.02)[ip: (-9.51), ipnet: 2607:f8b0::/32(-3.09), asn: 15169(-2.45), country: US(-0.05)]; WHITELIST_SPF_DKIM(-3.00)[netflix.com:d:+,netflix.com:s:+] X-BeenThere: freebsd-transport@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions of transport level network protocols in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jul 2019 12:40:36 -0000 Yes As I said in comments to your removal of the sack field, they have drifted since my first work. I am not too concerned since the first 3 cache lines are the most used = and most important. I do intend to do a re-analysis once I get BBR and the latest Rack in to = see if we could improve things.. though it is doubtful that we will gain much = (but you never know) ;) R > On Jul 29, 2019, at 11:13 PM, Scheffenegger, Richard = wrote: >=20 > Hi, >=20 > I've been looking into the cache line alignment today (because = D18811). >=20 > Found that the commented cache lines only align to line 3 - then they = drift from the comments. >=20 > For example, t_rttupdated is defined as u_long (8 bytes), while it = really only tracks if at least some (small) number of rtt samples were = collected, to start the use of the rtt vars... >=20 > Realistically, a uint8_t with a limited increment (if (x<255) x++) = would serve the very same function... >=20 > Other example: t_sndzerowin (in tcpcb) appears to be only a counter, = better placed into the tcpstat structure, where non-functional counters = belong IMHO. (perhaps a per-session variant). >=20 >=20 >=20 >=20 > And the other variables could probably be defined in the explicit = types (uint16/32/64), to be more certain of the alignment - plus making = sure that alignment boundaries between different sized types don't = result in unintentional shifting of the alignment (like it seems = currently to be the case). >=20 > Another prime example: struct sackhint is 40 bytes, only 24 of these = are actually used; and ideally, sackblks, snd_fack share the same line, = while sackhint and snd_holes would do the same (currently, both are = distributed across 2) .... >=20 >=20 > Any appetite to get the (higher) cache lines aligned in tcpcb? >=20 > Best regards, > Richard >=20 >=20 > _______________________________________________ > freebsd-transport@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-transport > To unsubscribe, send any mail to = "freebsd-transport-unsubscribe@freebsd.org" ------ Randall Stewart rrs@netflix.com