From owner-freebsd-arch Tue Mar 4 11:30: 2 2003 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1F8AC37B401 for ; Tue, 4 Mar 2003 11:30:01 -0800 (PST) Received: from mail26a.sbc-webhosting.com (mail26a.sbc-webhosting.com [216.173.237.36]) by mx1.FreeBSD.org (Postfix) with SMTP id 3578F43FBD for ; Tue, 4 Mar 2003 11:29:58 -0800 (PST) (envelope-from alc@imimic.com) Received: from www.imimic.com (64.143.12.21) by mail26a.sbc-webhosting.com (RS ver 1.0.77vs) with SMTP id 0503806170; Tue, 4 Mar 2003 14:29:31 -0500 (EST) Message-ID: <3E64FEA0.CCA21C7@imimic.com> Date: Tue, 04 Mar 2003 13:29:36 -0600 From: "Alan L. Cox" Organization: iMimic Networking, Inc. X-Mailer: Mozilla 4.8 [en] (X11; U; Linux 2.4.2 i386) X-Accept-Language: en MIME-Version: 1.0 To: arch@freebsd.org, Sean Chittenden Subject: Re: Should sendfile() to return ENOBUFS? Content-Type: text/plain; charset=x-user-defined Content-Transfer-Encoding: 7bit X-Loop-Detect: 1 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Sean, The current sf_buf implementation has a simple problem that could account for your frequent blocking. Let me describe an extreme example that will make it clear. Suppose you have a web server that delivers nothing but a single file of 8 pages, or 32K bytes of data, to its clients. Here's the punchline: If you had 1,000 concurrent requests, you could wind up allocating 8,000 sf_bufs. Given that the main purpose of the sf_buf is simply to provide an in-kernel virtual address for the page, one sf_buf per page should suffice. Sf_bufs are already reference counted. So, the principle change would be to add a directory data structure that could answer the question "Does this page already have an allocated sf_buf?" Regards, Alan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message