From owner-freebsd-net@FreeBSD.ORG Thu Feb 5 19:17:51 2015 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38329BCB for ; Thu, 5 Feb 2015 19:17:51 +0000 (UTC) Received: from mail-ob0-f179.google.com (mail-ob0-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE5F0C01 for ; Thu, 5 Feb 2015 19:17:50 +0000 (UTC) Received: by mail-ob0-f179.google.com with SMTP id wp4so8862101obc.10 for ; Thu, 05 Feb 2015 11:17:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=K95H2kG4fYIelkWijHwyARm8dd/bMQ1a98r6W0mDHgI=; b=g029/uq6aj6u6uEGgKCGA66wSm4przHrOtP0rKk6XeRsZ6lOeweXhN+ufZ7rrVG0EY fv2c5Pu472behrdKbi4glZndhvY7INaP2Xfwj11ZtbsR7F5aCRfI7FUNKaXW4uSiScJY 5r7eIBtVqh2gBMwifdCKC508Em1g7L8dbp4fLfXwSo9XWQotA/D2j+xwesEf4FI5qqhF o430ZqTvLJX+POCFQed50q3yFvUQQIY1aR10bFwNyEhp1R/gDJuGQIi+lmApfoWdoQoG d+AKUwzVvhmc9V5Qe4qajxoccMzn7rZBIMerJkE5Wn00vcRKjUvgaopKn8fs1s5F6+Ef 8oTQ== X-Gm-Message-State: ALoCoQmrc8tVsmMEfOBENiJUVbVhtAP4BqlAM96KIYJpEsxubsUEhpiobIxwIOz2yo9BGk75EDuL X-Received: by 10.202.91.138 with SMTP id p132mr3236847oib.47.1423163864172; Thu, 05 Feb 2015 11:17:44 -0800 (PST) Received: from ?IPv6:2610:160:11:33:5d27:42e6:427e:9a76? ([2610:160:11:33:5d27:42e6:427e:9a76]) by mx.google.com with ESMTPSA id mp3sm30398obb.25.2015.02.05.11.17.43 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Feb 2015 11:17:43 -0800 (PST) Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: Silly experiments with netisr From: Jim Thompson In-Reply-To: Date: Thu, 5 Feb 2015 13:17:42 -0600 Message-Id: References: <54D3BE67.8060502@ignoranthack.me> To: Adrian Chadd X-Mailer: Apple Mail (2.2070.6) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: FreeBSD Net X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2015 19:17:51 -0000 > On Feb 5, 2015, at 1:13 PM, Adrian Chadd wrote: >=20 > On 5 February 2015 at 11:03, Sean Bruno > wrote: >>=20 >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA512 >>=20 >> Some questions came up around the office and we ended up doing some >> quite silly things with lo0 and netcat. >>=20 >> If one runs a continuous netcat on localhost to another netcat = listener >> on localhost that writes the output to /dev/null, netisr gets super = busy >> doing stuff/things. >>=20 >> E.g. >> -- listener running "nc -k -l 10000 > /dev/null" >> - sender running in a while loop "nc -N localhost 10000 < >> /var/tmp/testfile" >>=20 >> Interesting things start happening on the machine. top -SH shows = netisr >> eating up about 1/2 of a cpu core. If you drop the MTU on lo0 to = 1500 >> (so that it looks like something in the real world), netisr will peg = out >> a cpu core. This seems logical, in that smaller MTU means busier >> netisr. Its interesting though. >>=20 >> Looking at some pmcstat things, shows that the system is busilly >> chugging along in tcp_do_segment(). I wonder if this is meaningful = in >> anyway or just "interesting". >>=20 >> PMC: [FR_RETIRED_X86_INSTRUCTIONS] Samples: 267614 (100.0%) , 12350 >> unresolved >=20 > UHm, on a recent intel, use CPU_CLK_UNHALTED instead, so you get an > idea of which instructions are spending the most time doing "stuff". > Some instructions are costlier than others (eg things that cause > memory bus stalls.) >=20 >> %SAMP IMAGE FUNCTION CALLERS >> 5.5 kernel in_cksumdata in_cksum_skip >=20 > .. we're checksumming localhost tcp? :) Of course we are. The more damning part is the 7.0% of samples that pf consumes. Jim >=20 > -adrian >=20 >> 5.0 kernel tcp_output tcp_do_segment:4.2 = tcp_usr_rcvd:0.5 >> 4.6 kernel __rw_wlock_hard tcp_usr_send:3.7 = tcp_usr_rcvd:0.8 >> 3.8 pf.ko pf_test pf_check_in:2.0 pf_check_out:1.8 >> 3.6 kernel sched_idletd fork_exit >> 3.2 pf.ko pf_test_state_tcp pf_test >> 3.1 kernel bzero pf_test:0.8 = pf_test_state_tcp:0.7 >> 3.1 kernel bcopy m_copydata:1.3 = tcp_addoptions:0.7 >> tcp_dooptions:0.5 >> 2.7 kernel tcp_do_segment tcp_input >>=20 >>=20 >> sean >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v2 >>=20 >> iQF8BAEBCgBmBQJU075kXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w >> ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCQUFENDYzMkU3MTIxREU4RDIwOTk3REQx >> MjAxRUZDQTFFNzI3RTY0AAoJEBIB78oecn5kc4kH/02ttXzvapAG2PSML9Ml0Kwf >> XblpOHnrhUU8jsTauGhh8q4C94rb9hFDCzL4cEAI87QMXoBQHi9CWE0v/XdeR+8M >> ajpHlNyd78XbmIKOVksesYWzLbVFjC0A3emnkH4dUX1XD6tJoihVaUQVcrAbNm+I >> p6Z4yXrOXUP9UxBgkCSe5m3Y/K3vcmIPvFSnO/nN/2tckEh6+uuj1n3QyFXkUJJg >> 9erFanvDXr3nOyR6IWXIKxuy1yta32SpOPxywIl81qSBh1n/IOor41WqpzOnlNdM >> d0np+ZD/d+Z9OQJZnuJunCrV6Cv2EFKJe5qBzCdOjLj0KvpNDnFXyndWpeXyvgI=3D >> =3D+FSJ >> -----END PGP SIGNATURE----- >>=20 >>=20 >> _______________________________________________ >> freebsd-net@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-net >> To unsubscribe, send any mail to = "freebsd-net-unsubscribe@freebsd.org" > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net = > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org = "