From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 19:36:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 350C39E6; Mon, 3 Nov 2014 19:36:06 +0000 (UTC) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id D52B0EC5; Mon, 3 Nov 2014 19:36:05 +0000 (UTC) Received: from critter.freebsd.dk (unknown [192.168.60.3]) by phk.freebsd.dk (Postfix) with ESMTP id 31CE93BD2B; Mon, 3 Nov 2014 19:35:59 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.9/8.14.9) with ESMTP id sA3JZutc079455; Mon, 3 Nov 2014 19:35:57 GMT (envelope-from phk@phk.freebsd.dk) To: Bruce Evans Subject: Re: svn commit: r274017 - head/sys/kern In-reply-to: <20141104045159.E1605@besplex.bde.org> From: "Poul-Henning Kamp" References: <201411030746.sA37kpPu037113@svn.freebsd.org> <54573AEE.9010602@freebsd.org> <54573B87.7000801@freebsd.org> <54573CD2.1000702@selasky.org> <20141103092132.GH29497@dft-labs.eu> <20141103100847.GK53947@kib.kiev.ua> <20141104045159.E1605@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <79453.1415043356.1@critter.freebsd.dk> Date: Mon, 03 Nov 2014 19:35:56 +0000 Message-ID: <79454.1415043356@critter.freebsd.dk> X-Mailman-Approved-At: Mon, 03 Nov 2014 20:09:47 +0000 Cc: Hans Petter Selasky , Mateusz Guzik , Mateusz Guzik , jmallett@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, src-committers@freebsd.org, Konstantin Belousov , Julian Elischer X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 19:36:06 -0000 -------- In message <20141104045159.E1605@besplex.bde.org>, Bruce Evans writes: >This optimization is probably minor, but reminds me of other syscalls >that would benefit using a single largish allocation up front: >- all vfs calls that start with namei(). They allocate PATH_MAX (1K) > bytes and more. An 8K stack has plently to spare after allocating > 1K. However, if malloc() is used then the PATH_MAX limit shouldn't > exist. Only a limit to prevent denial of service is needed. We should actually roll a new rev of all syscalls which take a path and have them pass strlen(path)+1 into the kernel. That would allow both precise allocation and faster copyin, followed by a check that the last byte is (still) a NUL. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.