From owner-svn-src-head@FreeBSD.ORG Tue Nov 4 05:35:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4061F1BB; Tue, 4 Nov 2014 05:35:27 +0000 (UTC) Received: from mail-wg0-x22e.google.com (mail-wg0-x22e.google.com [IPv6:2a00:1450:400c:c00::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14254163; Tue, 4 Nov 2014 05:35:25 +0000 (UTC) Received: by mail-wg0-f46.google.com with SMTP id x13so12650679wgg.19 for ; Mon, 03 Nov 2014 21:35:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=fLHxoG8Pxqcb5navipgI+SxLI8CLgfUjhLBwOBP2VSM=; b=vOTekxj8Qh0eDCZnOyGr+izgQWFtgWQVIMQcitntIUBWzFSbRnVXa3QQoRRqOSYvpP Bi5NUdINhmO3KVDY9Qee6jLdCtRvPWvYgtDKLWV5wfAwh9g0bkugtLKeL3Yfm61u9REB cN4s/l61HwlUdqqnw0yTJ8ZElN1jEGofAeBhXdtkXiuN9STJFHszv08vBeFnUiZ1y0rA XU7iAWsbqwuqMkgt7OtrRA5do7YuUvDdZrr+ok6yZEq5FYdZANUVbyOR87kcvRgv97U/ F1t+2wU88fGcULkz5TECnLG6XX5l3FwHRrpuTTRxJJJNsD5NsP1UKhrMeEX3VLuAYcLn cUtw== X-Received: by 10.194.9.1 with SMTP id v1mr459712wja.124.1415079323897; Mon, 03 Nov 2014 21:35:23 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id bg10sm24430824wjc.47.2014.11.03.21.35.22 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 03 Nov 2014 21:35:22 -0800 (PST) Date: Tue, 4 Nov 2014 06:35:20 +0100 From: Mateusz Guzik To: Poul-Henning Kamp Subject: Re: svn commit: r274017 - head/sys/kern Message-ID: <20141104053520.GA4032@dft-labs.eu> 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> <79454.1415043356@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <79454.1415043356@critter.freebsd.dk> User-Agent: Mutt/1.5.21 (2010-09-15) X-Mailman-Approved-At: Tue, 04 Nov 2014 12:31:13 +0000 Cc: Hans Petter Selasky , src-committers@freebsd.org, Mateusz Guzik , jmallett@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Bruce Evans , Konstantin Belousov , Julian Elischer X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 05:35:27 -0000 On Mon, Nov 03, 2014 at 07:35:56PM +0000, Poul-Henning Kamp wrote: > -------- > 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. > I think we can speed up things on amd64 no problem without affecting userspace. amd64's copyinstr (and most likely all others) copy byte by byte. What we can do is copy word size and fall back to byte by byte on page fault. Ten on each iteration check if 0 was encountered. Maybe there will be a way of doing it in even in C without much hassle. -- Mateusz Guzik