From owner-freebsd-hackers@FreeBSD.ORG Mon May 13 18:23:46 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B60142A7 for ; Mon, 13 May 2013 18:23:46 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-x231.google.com (mail-wg0-x231.google.com [IPv6:2a00:1450:400c:c00::231]) by mx1.freebsd.org (Postfix) with ESMTP id 4FA2168 for ; Mon, 13 May 2013 18:23:46 +0000 (UTC) Received: by mail-wg0-f49.google.com with SMTP id j13so6437992wgh.4 for ; Mon, 13 May 2013 11:23:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=+/W1Gl9zK8BaJfjd3DuSccNMfA84K+G0HjCXp/M1HzI=; b=0v6Sl+Ny0miPfhdb7LOMroI9Ah9Wpx6D6OUdnf3GPoUM/JUuihDH4FLqDaxFw8haqJ /zAEMaCc/Lw1pKaUgobGIovikb3ld7+D1V6EmotgYSI4X+nGzY35X0DSGAHAjvb2hQGp LwuJQ3jBmXhwBcP6P9K8iUdT9WAjK0LKpc1m248hM9egVX07kpC23GGJorIJT2TEDcwr BGO7gGu3Xj+ZWkuiWwFVS0tsecPkHUMLday0qdeh6yen1+i3KgHUyYPuEOi8ykgiR3v9 3sI1KjO9OO1QhHTxYleDshwe2ReTvlPX6b7WebFFVFlSDmr6+VjYpoKIraZB+86ernID TWTg== MIME-Version: 1.0 X-Received: by 10.180.149.200 with SMTP id uc8mr21410018wib.3.1368469425543; Mon, 13 May 2013 11:23:45 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.58.138 with HTTP; Mon, 13 May 2013 11:23:45 -0700 (PDT) In-Reply-To: <8A02C28F-89CB-4AE3-A91A-89565F041FDE@gmail.com> References: <20130513185357.1c552be5@shy.leonerd.org.uk> <20130513191513.786f4f02@shy.leonerd.org.uk> <8A02C28F-89CB-4AE3-A91A-89565F041FDE@gmail.com> Date: Mon, 13 May 2013 11:23:45 -0700 X-Google-Sender-Auth: e9YpTj3BVnad6tUGRw_ORR-vTcI Message-ID: Subject: Re: Managing userland data pointers in kqueue/kevent From: Adrian Chadd To: Eugen-Andrei Gavriloaie Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org, Paul LeoNerd X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 May 2013 18:23:46 -0000 Just as a data point, I managed 50,000 + connections, at 5,000 + a second, doing a gigabit + of traffic, mid-2000s, with the userland management of all of the socket/disk FD stuff. The biggest overhead at the time was actually the read/write copyin/copyout, NOT the locking overhead of managing this stuff. Why? Because I architected the HTTP side of things to specifically pin FDs to threads, and not allow arbitrary threads to deal with arbitrary FDs. This removed the need for almost all of the state locking that people are concerned about here. Adrian