From owner-freebsd-arch@FreeBSD.ORG Fri Dec 27 22:41:33 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A2B1769D for ; Fri, 27 Dec 2013 22:41:33 +0000 (UTC) Received: from mail-qc0-x22a.google.com (mail-qc0-x22a.google.com [IPv6:2607:f8b0:400d:c01::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 654F11701 for ; Fri, 27 Dec 2013 22:41:33 +0000 (UTC) Received: by mail-qc0-f170.google.com with SMTP id x13so9219860qcv.29 for ; Fri, 27 Dec 2013 14:41:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=QegVfy/AUP17kVkttGoFvnn4iIFDtbJ5CfN+4+6nQVA=; b=U9L8mufoEjaJBEvTmsnjOZYTYw7ohN7eIRaHhcMy2XCvEQ2xjG6jBwj2QVnFHZXfNV bdHZQJujkTyIiebpb07ccxcedr3UsMFaRm0VWxHNvglj7v5KhYWJG9drhJenDmMykOo3 qysRYywdijKGtDuWrIZ9aa5JL2OK7/jawrUYVk8onN2rAgL+ckdhGRiEv5bUv+wF38Pl lyLJy1TZsTeDxWDZZAI9WE9Qz4rqPA249o7csYplPo4TQXuJHY69xJVYqY95/KJf05iD FrNsOuadn9QBX4hPPEagH34V9SAa1zhfXJ2FA1c4QZLWeQ4CfZdfVin8gmckIO7nd27l 6xIA== MIME-Version: 1.0 X-Received: by 10.224.124.195 with SMTP id v3mr84700042qar.55.1388184092590; Fri, 27 Dec 2013 14:41:32 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.52.8 with HTTP; Fri, 27 Dec 2013 14:41:32 -0800 (PST) Date: Fri, 27 Dec 2013 14:41:32 -0800 X-Google-Sender-Auth: DTV0pyj0q4VPLdUmKiwPyGkIlVU Message-ID: Subject: Default knote hash table size is too .. small From: Adrian Chadd To: "freebsd-arch@freebsd.org" Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Dec 2013 22:41:33 -0000 Hi, The default knote hash table size (KN_HASHSIZE) is 64. When doing dirty things with lots of sockets (say, 64k and more) that involve plenty of knote insert/remove (ie, oneshot events - think posix AIO and my upcoming kqueue sendfile notification stuff) it consumes stupid amounts of CPU. I'd like to make this a tunable so people like Adrian at Netflix can bump this to higher values (say 32k) but people like Adrian at Embedded can bump this to lower values (say 64.) Comments? I'll make the change soon if no-one objects. Thanks, -a