From owner-freebsd-net@FreeBSD.ORG Thu Feb 5 19:19:29 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 9EC1BC6F for ; Thu, 5 Feb 2015 19:19:29 +0000 (UTC) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AC1FC10 for ; Thu, 5 Feb 2015 19:19:28 +0000 (UTC) Received: from [192.168.200.212] (unknown [50.136.155.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 55E7E1941DD for ; Thu, 5 Feb 2015 19:19:28 +0000 (UTC) Message-ID: <54D3C23F.5090501@ignoranthack.me> Date: Thu, 05 Feb 2015 11:19:27 -0800 From: Sean Bruno Reply-To: sbruno@freebsd.org User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 CC: FreeBSD Net Subject: Re: Silly experiments with netisr References: <54D3BE67.8060502@ignoranthack.me> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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:19:29 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 02/05/15 11:13, Adrian Chadd wrote: > On 5 February 2015 at 11:03, Sean Bruno > wrote: >> > Some questions came up around the office and we ended up doing > some quite silly things with lo0 and netcat. > > 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. > > E.g. -- listener running "nc -k -l 10000 > /dev/null" - sender > running in a while loop "nc -N localhost 10000 < > /var/tmp/testfile" > > 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. > > 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". > > PMC: [FR_RETIRED_X86_INSTRUCTIONS] Samples: 267614 (100.0%) , > 12350 unresolved > >> 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.) Oh right. Hrm, running this on an AMD system. I should have thought about that one. > > %SAMP IMAGE FUNCTION CALLERS 5.5 kernel > in_cksumdata in_cksum_skip > >> .. we're checksumming localhost tcp? :) > Yeah, and the ipv6 checksumming cannot be turned off apparently. % ifconfig lo0 lo0: flags=8049 metric 0 mtu 1500 options=600000 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 inet 127.0.0.1 netmask 0xff000000 nd6 options=21 groups: lo % ifconfig lo0 -rxcsum6 ifconfig: -rxcsum6: Operation not supported > > >> -adrian > > 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 > > > sean >> >> >> _______________________________________________ >> 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" > > -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAEBCgBmBQJU08I8XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCQUFENDYzMkU3MTIxREU4RDIwOTk3REQx MjAxRUZDQTFFNzI3RTY0AAoJEBIB78oecn5kY5MH/jrcOjCOsMSq7Y3iDgqh6m2j 10X2u5i1KlDqxYG09zWQ6PHYxedIrginz95hUQLV8AK/q+Y9Fm+77AFDlceB6Wgf DH9qBIu2guYGpmYfVVE9UXl5QMbCr/75oY8fZYzOaQPbUY2RzCNkMVkUdUVZaKip qcuA335uDbMfR/McFVaH7Q/Brk20wfdMf120AZBv5NPTQ6U3kHQS8lCLb8zdD/sa smccmlt/Ucu2ikFrKtiG+z7YuzmlT2n2wpj8/xi8gpWCGUrj10G4XdRCMobZQdyJ dftuPcCJAm+wGo7t4gYozVyGyeq8EiqGvv+QuKWd6gvzMndDnmxWo4GiBhC6ad4= =zIxK -----END PGP SIGNATURE-----