From owner-freebsd-current Mon Aug 19 13:59: 8 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 36A4337B400; Mon, 19 Aug 2002 13:59:06 -0700 (PDT) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3A1BA43E91; Mon, 19 Aug 2002 13:59:04 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.12.5/8.12.4) with ESMTP id g7JKx3dc079177; Mon, 19 Aug 2002 13:59:03 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.5/8.12.4/Submit) id g7JKx2j4079175; Mon, 19 Aug 2002 13:59:02 -0700 (PDT) (envelope-from dillon) Date: Mon, 19 Aug 2002 13:59:02 -0700 (PDT) From: Matthew Dillon Message-Id: <200208192059.g7JKx2j4079175@apollo.backplane.com> To: Bruce Evans Cc: "Semen A. Ustimenko" , , Maxim Konovalov , Robert Watson , Subject: Re: sendfile() change (Was: Re: cvs commit: src/sys/kern uipc_syscalls.c) References: <20020820040605.N20882-100000@gamplex.bde.org> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG :> call VOP_GETPAGES() on a block of pages instead of just one. I'm :> guessing that is not being done because it's about 100 lines of code :> to do it right. It's easier just to call vn_rdwr() and let the :> system do the clustering. : :This argument seems to apply to exec_map_first_pages() too. It does :its own blocking to get up to VM_INITIAL_PAGEIN (normally 16) pages :using only about 50 lines of code, but does this slightly wrong. It :doesn't honor the device limit of si_iosize_max, unlike filesystem :code. This used to break exec on zip drives (si_iosize_max used to :be 32K, but VM_INITIAL_PAGEIN pages is 64K bytes on i386's). : :Bruce Yes, it definitely applies. The vm_page_grab() can be replaced with a vm_page_lookup() sequence similar to what we find in do_sendfile(), and everything inside the 'if ((ma[0]->valid & ...' can be ripped out and replaced with a single vn_rdwr() call, if (error) test, and then loop back up to the vm_page_lookup(). There are enough parallels between the sendfile code and the exec_map_first_page() code that a significant portion of both procedures could be shifted to its own procedure which does the read-ahead and returns a single, valid, busied page. I am not volunteering to do this, though, I already have a full plate. -Matt Matthew Dillon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message