From owner-freebsd-net@FreeBSD.ORG Thu Feb 5 19:13:27 2015 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5AF8A738; Thu, 5 Feb 2015 19:13:27 +0000 (UTC) Received: from mail-ig0-x22b.google.com (mail-ig0-x22b.google.com [IPv6:2607:f8b0:4001:c05::22b]) (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 23873BC0; Thu, 5 Feb 2015 19:13:27 +0000 (UTC) Received: by mail-ig0-f171.google.com with SMTP id h15so30873389igd.4; Thu, 05 Feb 2015 11:13:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=ATsH0ZSXL834wu1zbB0qDAO6tVtWY7TmdEqCwg1TJ7A=; b=r3D8eQH5W4GH14N2Ai8MeUiYA5oDNy35cMhfqoBnqD1S05ucV3PSnxPtONUC2F9q/a r//7MEwOt27rozkqdthMDeU2fO2Xs1xpB1idtXXLUrDPc3QNhhtHINnT1Ey/k9LDHohN 72B9u+IMyPRFvmQ10NCcuypYMU2eYIKGvNn/HSTxd4nwvvoexzGslvmtXNzGdvv9qVYO RgwBp9hgUqjKX2K0zqxyWpwj6X/Gf8NLQNVcQz9fQT2p7Dsdlf8sDqhjOBQVYAoTJ502 34iLWn99ukhZJewu9Jb4d39L4FqG8mR3PiIaNzrXvb3N3r1BV7i6zaqlzIqYAKVqc5PM Cs8A== MIME-Version: 1.0 X-Received: by 10.50.164.227 with SMTP id yt3mr10722213igb.32.1423163606577; Thu, 05 Feb 2015 11:13:26 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.17.7 with HTTP; Thu, 5 Feb 2015 11:13:26 -0800 (PST) In-Reply-To: <54D3BE67.8060502@ignoranthack.me> References: <54D3BE67.8060502@ignoranthack.me> Date: Thu, 5 Feb 2015 11:13:26 -0800 X-Google-Sender-Auth: q3IldNk0uGXgF0XkbnHibWi4yes Message-ID: Subject: Re: Silly experiments with netisr From: Adrian Chadd To: Sean Bruno Content-Type: text/plain; charset=UTF-8 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:13:27 -0000 On 5 February 2015 at 11:03, Sean Bruno wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > 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.) > %SAMP IMAGE FUNCTION CALLERS > 5.5 kernel in_cksumdata in_cksum_skip .. we're checksumming localhost tcp? :) -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 > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2 > > iQF8BAEBCgBmBQJU075kXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w > ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCQUFENDYzMkU3MTIxREU4RDIwOTk3REQx > MjAxRUZDQTFFNzI3RTY0AAoJEBIB78oecn5kc4kH/02ttXzvapAG2PSML9Ml0Kwf > XblpOHnrhUU8jsTauGhh8q4C94rb9hFDCzL4cEAI87QMXoBQHi9CWE0v/XdeR+8M > ajpHlNyd78XbmIKOVksesYWzLbVFjC0A3emnkH4dUX1XD6tJoihVaUQVcrAbNm+I > p6Z4yXrOXUP9UxBgkCSe5m3Y/K3vcmIPvFSnO/nN/2tckEh6+uuj1n3QyFXkUJJg > 9erFanvDXr3nOyR6IWXIKxuy1yta32SpOPxywIl81qSBh1n/IOor41WqpzOnlNdM > d0np+ZD/d+Z9OQJZnuJunCrV6Cv2EFKJe5qBzCdOjLj0KvpNDnFXyndWpeXyvgI= > =+FSJ > -----END PGP SIGNATURE----- > > > _______________________________________________ > 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"