From owner-freebsd-net@FreeBSD.ORG Tue Jan 3 04:35:32 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CA09106566C for ; Tue, 3 Jan 2012 04:35:32 +0000 (UTC) (envelope-from vijju.singh@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id D81EB8FC08 for ; Tue, 3 Jan 2012 04:35:31 +0000 (UTC) Received: by vbbfr13 with SMTP id fr13so21400000vbb.13 for ; Mon, 02 Jan 2012 20:35:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=BqXFeI4hWFgFQoAPCEnectpJaORdjdGwPwe9wAQ4wW8=; b=g5ndIqQCP0FnwJYP34YR1vtD03cTNc98rcalh2wqeJOV4X/TuLxDdvPWXIjVqj5EXN WNYoqvSdKpafDPki8/4WQeQ1O8bqUr2y6DqUFIFYOiVOVxnVwL6Kxv/t1np8litzpSkl WZ162Ashs8m9mnq2vHNnUJWjlPufqvDRC9tRk= MIME-Version: 1.0 Received: by 10.52.72.46 with SMTP id a14mr13269439vdv.125.1325565331043; Mon, 02 Jan 2012 20:35:31 -0800 (PST) Received: by 10.220.108.144 with HTTP; Mon, 2 Jan 2012 20:35:31 -0800 (PST) Date: Mon, 2 Jan 2012 20:35:31 -0800 Message-ID: From: Vijay Singh To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: Use of spinlocks for TCP callouts X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 04:35:32 -0000 I have see the following call sequence in profiles: called/total parents index %time self descendents called+self name index called/total children 0.02 1.14 3822699/7559737 tcp_do_segment [154] 0.5 0.03 2.26 7559737 callout_reset_on 2.19 0.02 7573352/94883048 spinlock_exit 0.01 0.04 7573352/11975031 callout_lock It is my perception that spinlocks are expensive. Since general TCP locks are sleep mutexes, would there be any merit in building a TCP callout facility using sleep mutexes? I can hack something up and share here but wanted to check if people know of an existing facility that might be used here? -vijay