From owner-freebsd-hackers@FreeBSD.ORG Sun Dec 19 07:05:23 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE2921065672 for ; Sun, 19 Dec 2010 07:05:23 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from mo-p00-ob.rzone.de (mo-p00-ob.rzone.de [81.169.146.160]) by mx1.freebsd.org (Postfix) with ESMTP id 45F678FC19 for ; Sun, 19 Dec 2010 07:05:22 +0000 (UTC) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQv0cW+St/nW/afgnrylsiWy0ZjV9oQ8J X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de (ip-109-45-229-176.web.vodafone.de [109.45.229.176]) by post.strato.de (jimi mo44) (RZmta 24.8) with (DHE-RSA-AES128-SHA encrypted) ESMTP id j05a46mBJ6o664 for ; Sun, 19 Dec 2010 08:05:20 +0100 (MET) Received: by britannica.bec.de (sSMTP sendmail emulation); Sun, 19 Dec 2010 08:05:15 +0100 Date: Sun, 19 Dec 2010 08:05:15 +0100 From: Joerg Sonnenberger To: freebsd-hackers@freebsd.org Message-ID: <20101219070515.GB2433@britannica.bec.de> Mail-Followup-To: freebsd-hackers@freebsd.org References: <201012182224.oBIMOYfl067212@apollo.backplane.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201012182224.oBIMOYfl067212@apollo.backplane.com> User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: MONITOR/MWAIT question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Dec 2010 07:05:23 -0000 On Sat, Dec 18, 2010 at 02:24:34PM -0800, Matthew Dillon wrote: > Does anyone know if an IRET cancels/triggers a MONITOR event? AMD's Architecture Programmer's Manual explicitly contains: Events that cause an exit from the monitor event pending state include: ... - Any far control transfer that occurs between the MONITOR and the MWAIT. Joerg From owner-freebsd-hackers@FreeBSD.ORG Sun Dec 19 11:23:56 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 971B81065672; Sun, 19 Dec 2010 11:23:56 +0000 (UTC) Date: Sun, 19 Dec 2010 11:23:56 +0000 From: Alexander Best To: freebsd-hackers@freebsd.org Message-ID: <20101219112356.GA18388@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="qDbXVdCdHGoSgWSk" Content-Disposition: inline Subject: getting rid of some -mno-* flags under sys/boot X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Dec 2010 11:23:56 -0000 --qDbXVdCdHGoSgWSk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline hi there, i think some of the -mno-* flags in sys/boot/* can be scrubbed, since they're already being included from ../Makefile.inc. also TARGET cleandir leaves some files behind in i386/gptboot which should be fixed by this patch. cheers. alex -- a13x --qDbXVdCdHGoSgWSk Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="sse.diff" diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile index b91a43b..6e8315e 100644 --- a/sys/boot/i386/boot2/Makefile +++ b/sys/boot/i386/boot2/Makefile @@ -31,7 +31,6 @@ CFLAGS= -Os \ -fno-unit-at-a-time \ -mno-align-long-strings \ -mrtd \ - -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ -D${BOOT2_UFS} \ -DFLAGS=${BOOT_BOOT1_FLAGS} \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ diff --git a/sys/boot/i386/gptboot/Makefile b/sys/boot/i386/gptboot/Makefile index a0fad61..26f7fa0 100644 --- a/sys/boot/i386/gptboot/Makefile +++ b/sys/boot/i386/gptboot/Makefile @@ -26,7 +26,6 @@ CFLAGS= -DBOOTPROG=\"gptboot\" \ -fno-unit-at-a-time \ -mno-align-long-strings \ -mrtd \ - -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ -DGPT \ -D${GPTBOOT_UFS} \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ @@ -61,7 +60,8 @@ gptldr.bin: gptldr.out gptldr.out: gptldr.o ${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o -CLEANFILES+= gptboot.bin gptboot.out gptboot.o sio.o ufsread.o +CLEANFILES+= gptboot.bin gptboot.out gptboot.o cons.o \ + crc32.o drv.o gpt.o sio.o ufsread.o util.o gptboot.bin: gptboot.out objcopy -S -O binary gptboot.out ${.TARGET} diff --git a/sys/boot/i386/gptzfsboot/Makefile b/sys/boot/i386/gptzfsboot/Makefile index 30a5fc7..7f5f287 100644 --- a/sys/boot/i386/gptzfsboot/Makefile +++ b/sys/boot/i386/gptzfsboot/Makefile @@ -23,7 +23,6 @@ CFLAGS= -DBOOTPROG=\"gptzfsboot\" \ -fno-unit-at-a-time \ -mno-align-long-strings \ -mrtd \ - -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ -DGPT -DBOOT2 \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ -DSIOFMT=${B2SIOFMT} \ diff --git a/sys/boot/i386/zfsboot/Makefile b/sys/boot/i386/zfsboot/Makefile index 10616e4..38e8a9f 100644 --- a/sys/boot/i386/zfsboot/Makefile +++ b/sys/boot/i386/zfsboot/Makefile @@ -24,7 +24,6 @@ CFLAGS= -DBOOTPROG=\"zfsboot\" \ -fno-unit-at-a-time \ -mno-align-long-strings \ -mrtd \ - -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ -DBOOT2 \ -DFLAGS=${BOOT_BOOT1_FLAGS} \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ diff --git a/sys/boot/pc98/boot2/Makefile b/sys/boot/pc98/boot2/Makefile index dfd8607..035b5dd 100644 --- a/sys/boot/pc98/boot2/Makefile +++ b/sys/boot/pc98/boot2/Makefile @@ -28,7 +28,6 @@ CFLAGS= -Os \ -fno-unit-at-a-time \ -mno-align-long-strings \ -mrtd \ - -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ -D${BOOT2_UFS} \ -DFLAGS=${BOOT_BOOT1_FLAGS} \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ --qDbXVdCdHGoSgWSk-- From owner-freebsd-hackers@FreeBSD.ORG Sun Dec 19 12:11:10 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 697B71065670 for ; Sun, 19 Dec 2010 12:11:10 +0000 (UTC) (envelope-from roam@ringlet.net) Received: from erengrad.hoster.bg (erengrad.hoster.bg [77.77.142.9]) by mx1.freebsd.org (Postfix) with ESMTP id D9F788FC0C for ; Sun, 19 Dec 2010 12:11:09 +0000 (UTC) Received: from middenheim.hoster.bg (middenheim.hoster.bg [77.77.142.11]) by erengrad.hoster.bg (Postfix) with ESMTP id 7E0A2DCCD6 for ; Sun, 19 Dec 2010 14:11:08 +0200 (EET) Received: from straylight.ringlet.net (unknown [94.155.53.142]) (Authenticated sender: roam@hoster.bg) by mail.hoster.bg (Postfix) with ESMTP id D537D5C07E for ; Sun, 19 Dec 2010 14:10:49 +0200 (EET) Received: from roam (uid 1000) (envelope-from roam@ringlet.net) id 41602d by straylight.ringlet.net (DragonFly Mail Agent) Sun, 19 Dec 2010 14:10:48 +0200 Date: Sun, 19 Dec 2010 14:10:48 +0200 From: Peter Pentchev To: Alexander Best Message-ID: <20101219121048.GA3835@straylight.ringlet.net> Mail-Followup-To: Alexander Best , freebsd-hackers@freebsd.org References: <20101218200937.GA2932@freebsd.org> <20101218204047.GA4214@straylight.ringlet.net> <20101218212431.GA35554@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="azLHFNyN32YCQGCU" Content-Disposition: inline In-Reply-To: <20101218212431.GA35554@freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-MailScanner-ID: D537D5C07E.C949C X-hoster-MailScanner: Found to be clean X-hoster-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=0.001, required 10, autolearn=disabled, UNPARSEABLE_RELAY 0.00) X-hoster-MailScanner-From: roam@ringlet.net X-hoster-MailScanner-To: freebsd-hackers@freebsd.org X-Spam-Status: No Cc: freebsd-hackers@freebsd.org Subject: Re: question about CFLAGS, CXXFLAGS and DEBUG_FLAGS X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Dec 2010 12:11:10 -0000 --azLHFNyN32YCQGCU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 18, 2010 at 09:24:31PM +0000, Alexander Best wrote: > On Sat Dec 18 10, Peter Pentchev wrote: > > On Sat, Dec 18, 2010 at 08:09:37PM +0000, Alexander Best wrote: > > > hi there, > > >=20 > > > i just stumbled over these lines: > > >=20 > > > otaku% grep -n \${DEBUG_FLAGS} /usr/share/mk/bsd.prog.mk > > > 24:CFLAGS+=3D${DEBUG_FLAGS} > > > 25:CXXFLAGS+=3D${DEBUG_FLAGS} > > >=20 > > > is it really necessary to assign the debug flags to both CFLAGS *and*= CXXFLAGS? > >=20 > > Uhm... yes, so they can be used in both C and C++ programs :) > > ...or are you making the mistake I've made too many times (and still > > make sometimes) of confusing CXXFLAGS with CPPFLAGS? :) >=20 > *hehehe* i don't think so. Nah, just making sure, no offense intended :) > i just saw a lot of these lines in buildworld: >=20 > clang++ -O2 -pipe -DNDEBUG -g -I/usr/obj/usr/subversion-src/tmp/legacy/us= r/include -I/usr/subversion-src/gnu/usr.bin/gperf/../../../contrib/gperf/li= b -I/usr/subversion-src/gnu/usr.bin/gperf -g -c /usr/subversion-src/gnu/usr= =2Ebin/gperf/../../../contrib/gperf/lib/hash.cc > clang++: warning: argument unused during compilation: '-g' > clang++: warning: argument unused during compilation: '-g' >=20 > as you can see -g gets specified twice, so i thought maybe adding -g to > CFLAGS makes adding it to CXXFLAGS obsolete. Well, according to my copy of src/share/mk/sys.mk (8.x-STABLE), if the user does not override CXXFLAGS, they are copied from CFLAGS with some exceptions. Thus, it does seem sensible to add -g to both sets of flags - yes, if no CXXFLAGS are specified, the -g will be doubled, but if CXXFLAGS *are* specified in the environment or on the make(1) command line, then only one -g will be added. Maybe a better solution could be to somehow test for empty CXXFLAGS in sys.mk and set another variable that says "we've copied those over", and then only add DEBUG_FLAGS to CXXFLAGS if that variable is not set, but I'm not sure if it's really worth it. Thanks for bringing this up - I wasn't aware of the fact that CXXFLAGS were copied over unless overridden :) Learn something new every day, I guess. G'luck, Peter --=20 Peter Pentchev roam@space.bg roam@ringlet.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 No language can express every thought unambiguously, least of all this one. --azLHFNyN32YCQGCU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAEBCAAGBQJNDfZCAAoJEGUe77AlJ98TCjcQALbJQ9z/8SO8vbjXUNyr7iwl nkZddxwG93iFq0OIpoLp15NS4QFiBRoUo+LUPblVn9SPLDf0LNpgUE+wFyIlyY5S t0N99lqethjqsLsPedim0nSFPDYJnkM1mSod1IKVL5fmq5+Hpwlp6mg4bQZ7kaE1 z5dzzuCqcK8HdUAytU8VQwsmyG3oUklg80YzLAozXWZSjN+yVCxN3ZqrDknxSKWZ 2+cVm5rJmWCdU6f9mQg+h10/EaoPRpUxk7xEtq0CzTbSzceXtKmd8HONPmojpEBt WGZM0UjWMaX1B1MJtXmWrNQX+KAhFpqJMpZFuqwvOe0K9tHnTPS+r/RirirF7/VV aNBd8uqHn9tU4R/TAwbm+0a7S4cTyNuHqJ06kw6o3uh1BAjunoA4CX14dJkkt94v zxz6ci2epSDHwaXhllMO3tSI3x5L/jjI5dQHXQDaOSs1mr5PhLcmlf0N0nEWfjFR Zm5NiQDKP71GKMIcNB62vlew74KQkRa0wXXXSKJ6dRcwaZBVtF6jQPVBlM96xiBk RK4algM1Q/lsoT7Tx+1DFH401bJrt2mwDOY9G91N8G6UJLwhStIv3yWKCKm8iCJB lhL0bW/DJInvS/8FDe0HXuJRI8fLzH68CUB4nlu3lJK0+635xlwEZsY7JR2GA6Ai szUkfqBWS2faof1k3n/3 =crhz -----END PGP SIGNATURE----- --azLHFNyN32YCQGCU-- From owner-freebsd-hackers@FreeBSD.ORG Sun Dec 19 17:42:03 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C9031065670; Sun, 19 Dec 2010 17:42:03 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 572128FC15; Sun, 19 Dec 2010 17:42:01 +0000 (UTC) Received: by wyf19 with SMTP id 19so2134204wyf.13 for ; Sun, 19 Dec 2010 09:42:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=Q1s+x1ahqmS834RBD8yOl12ReuZwhl1vwsJWy24kWiE=; b=QMA8nj7AIfbXMQuIEUbq2mjiVTPBd2NH4tvPz0gdQoVOt/X/qwpcTYnttcvC9hz9XW /K+0IAj156tv+is4e3UDyRVtuyHSW+hKrFsweaMkqyUyC2RCTqWzou0gb/n7TejoFZ0A cORQhjSn5YuliqF95h1QyqkHDALh2HsQ5reSs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=wlZ1U2x0HFxuWSk6M6uzRaS5pspiZ27u73lS7+IcprMq+Y6m2KxhMjupXT3mLP6SQs ISHsajkEt0J9w05Yj9BuATQh0gzIrRgepFH2/1KE1lJ+O6ICBZmRyq/GeVAcfXxFnv6F 8cBTUFnuYPHWxMIO+h907OWNpboqWFCFuDyRs= MIME-Version: 1.0 Received: by 10.216.186.138 with SMTP id w10mr3855233wem.1.1292780521241; Sun, 19 Dec 2010 09:42:01 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.254.226 with HTTP; Sun, 19 Dec 2010 09:42:01 -0800 (PST) In-Reply-To: <20101219112356.GA18388@freebsd.org> References: <20101219112356.GA18388@freebsd.org> Date: Sun, 19 Dec 2010 09:42:01 -0800 X-Google-Sender-Auth: Q4o9E3VSAMNbXC3fFDrWreUT7aA Message-ID: From: Garrett Cooper To: Alexander Best Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org Subject: Re: getting rid of some -mno-* flags under sys/boot X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Dec 2010 17:42:03 -0000 On Sun, Dec 19, 2010 at 3:23 AM, Alexander Best wrote: > hi there, > > i think some of the -mno-* flags in sys/boot/* can be scrubbed, since they're > already being included from ../Makefile.inc. Looks good. > also TARGET cleandir leaves some files behind in i386/gptboot which should be > fixed by this patch. AHA. This might fix the issue I've seen rebuilding stuff with gptzfsboot for a good while now where I have to (on mostly rare occasions with -j24, etc typically after updating my source tree) rebuild it manually. gptzfsboot and zfsboot also need the fix, BTW. The only thing is that these files live under the common directory, so shouldn't common clean them up (I see that common doesn't have a Makefile though, only a Makefile.inc -- ouch)? FWIW though, wouldn't it be better to avoid this accidental bug and unnecessary duplication by doing something like the following? # ... OBJS= zfsboot.o sio.o gpt.o drv.o cons.o util.o CLEANFILES+= gptzfsboot.out ${OBJS} gptzfsboot.out: ${BTXCRT} ${OBJS} # ... Thanks, -Garrett From owner-freebsd-hackers@FreeBSD.ORG Mon Dec 20 11:15:41 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B63B106564A; Mon, 20 Dec 2010 11:15:41 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id AA0CD8FC0C; Mon, 20 Dec 2010 11:15:40 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id NAA13420; Mon, 20 Dec 2010 13:15:36 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1PUdiJ-000HIs-WC; Mon, 20 Dec 2010 13:15:36 +0200 Message-ID: <4D0F3AD6.9080002@freebsd.org> Date: Mon, 20 Dec 2010 13:15:34 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101211 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: Artem Belevich , freebsd-hackers@freebsd.org, FreeBSD-Current References: <20101211215341.0000097c@unknown> <20101213103535.00005f3d@unknown> <4D061E00.7050606@freebsd.org> In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: [dtrace] syscall provider naming convention. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Dec 2010 11:15:41 -0000 on 14/12/2010 05:10 Artem Belevich said the following: > I've posted updated version of the patch here: > https://sites.google.com/site/abc678site/files/dt-systrace.patch.gz > > This patch uses DTrace module field to specify syscall's compat > variant in the syscall probe name. If there are no objections and no pending reviews and comments, then I would like to commit this shortly. > The patch also adds syscall probe for linux32 binaries on amd64. I'll > try to add i386 support soon, too, but I have no i386 box I could > compile and test the changes on. I'll try to get one set up under > VirtualBox later, but for now the patch is for 8-STABLE/amd64 only. It would be nice to get the i386 counterpart too when this goes into the tree. Thanks! -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Mon Dec 20 14:59:09 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E18641065679; Mon, 20 Dec 2010 14:59:08 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B27D78FC18; Mon, 20 Dec 2010 14:59:08 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 697A346B32; Mon, 20 Dec 2010 09:59:08 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 682458A01D; Mon, 20 Dec 2010 09:59:07 -0500 (EST) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Mon, 20 Dec 2010 08:02:21 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20101102; KDE/4.4.5; amd64; ; ) References: <20101219112356.GA18388@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201012200802.21334.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 20 Dec 2010 09:59:07 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: Alexander Best , Garrett Cooper Subject: Re: getting rid of some -mno-* flags under sys/boot X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Dec 2010 14:59:09 -0000 On Sunday, December 19, 2010 12:42:01 pm Garrett Cooper wrote: > On Sun, Dec 19, 2010 at 3:23 AM, Alexander Best wrote: > > hi there, > > > > i think some of the -mno-* flags in sys/boot/* can be scrubbed, since they're > > already being included from ../Makefile.inc. > > Looks good. > > > also TARGET cleandir leaves some files behind in i386/gptboot which should be > > fixed by this patch. > > AHA. This might fix the issue I've seen rebuilding stuff with > gptzfsboot for a good while now where I have to (on mostly rare > occasions with -j24, etc typically after updating my source tree) > rebuild it manually. gptzfsboot and zfsboot also need the fix, BTW. > The only thing is that these files live under the common directory, so > shouldn't common clean them up (I see that common doesn't have a > Makefile though, only a Makefile.inc -- ouch)? > FWIW though, wouldn't it be better to avoid this accidental bug > and unnecessary duplication by doing something like the following? > > # ... > > OBJS= zfsboot.o sio.o gpt.o drv.o cons.o util.o > CLEANFILES+= gptzfsboot.out ${OBJS} > > gptzfsboot.out: ${BTXCRT} ${OBJS} > # ... Yes, an OBJS would be good. Also, gptboot.c was recently changed to not #include ufsread.c, so that explicit dependency can be removed, as can the GPTBOOT_UFS variable. Similar fixes probably apply to gptzfsboot. BTW, the code in common/ is not built into a library, but specific boot programs (typically /boot/loader on different platforms) include specific objects. -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Tue Dec 21 01:21:27 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5B62106564A for ; Tue, 21 Dec 2010 01:21:27 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from tower.berklix.org (tower.berklix.org [83.236.223.114]) by mx1.freebsd.org (Postfix) with ESMTP id 4F5D18FC0A for ; Tue, 21 Dec 2010 01:21:26 +0000 (UTC) Received: from park.js.berklix.net (p5B22DE1F.dip.t-dialin.net [91.34.222.31]) (authenticated bits=0) by tower.berklix.org (8.14.2/8.14.2) with ESMTP id oBL0wvkE005525 for ; Tue, 21 Dec 2010 00:58:58 GMT (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by park.js.berklix.net (8.13.8/8.13.8) with ESMTP id oBL0wxoP060521 for ; Tue, 21 Dec 2010 01:58:59 +0100 (CET) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.3/8.14.3) with ESMTP id oBL117OZ005993 for ; Tue, 21 Dec 2010 02:01:12 +0100 (CET) (envelope-from jhs@fire.js.berklix.net) Message-Id: <201012210101.oBL117OZ005993@fire.js.berklix.net> To: hackers@freebsd.org From: "Julian H. Stacey" Organization: http://www.berklix.com BSD Unix Linux Consultancy, Munich Germany User-agent: EXMH on FreeBSD http://www.berklix.com/free/ X-URL: http://www.berklix.com/~jhs/cv/ Date: Tue, 21 Dec 2010 02:01:07 +0100 Sender: jhs@berklix.com Cc: Subject: Forward to abuse@ button for http://tools.ietf.org/html/rfc5965 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Dec 2010 01:21:28 -0000 Hi hackers@, No reply to this on , so asking on this bigger list -------------- I just posted a question [see below] to exmh-users@redhat.com, A similar question extends for nmh & claws-mail etc: Any tools to auto forward spam into rfc5965 format for abuse@ ? ] To: exmh-users@redhat.com ] Subject: Forward to abuse@ button for http://tools.ietf.org/html/rfc5965 ? ] Date: Sat, 18 Dec 2010 13:11:41 +0100 ] ] Anyone working on an extension to EXMH 2.7.2 01/07/2005 to support ] http://tools.ietf.org/html/rfc5965 ] (spam report format) ? ] ] I just got this bounced back to me: ] -------- ] Date: Fri, 17 Dec 2010 13:44:15 -0800 ] To: "Julian H. Stacey" ] Subject: RE: File for your claim! (fwd) (KMM120695297V22240L0KM) ] From: Yahoo! Mail ] Reply-To: Yahoo! Mail ] MIME-Version: 1.0 ] Content-Type: text/plain; charset = "us-ascii" ] Content-Transfer-Encoding: 7bit ] X-Mailer: KANA Response 7.0.1.142.15 ] ] Thank you for your email, but this address now only accepts messages in ] Abuse Reporting Format (http://tools.ietf.org/html/rfc5965) ] ] To report abuse manually (or to get help with security or abuse related ] issues), please go to Yahoo! Abuse: ] http://abuse.yahoo.com ] ] For questions about using Yahoo! services, please visit Yahoo Help: ] http://help.yahoo.com ] ] Thank you, ] - Yahoo! Customer Care ] ] Note: Please do not reply to this email as replies will not be answered. ] -------- PS Spot the connection ? Yahoo dumps anti spam work on unpaid suckers. Yahoo lays off 4% of staff, http://berklix.com/~jhs/mail/no_rfc5965.html Cheers, Julian - -- Julian Stacey, BSD Unix Linux C Sys Eng Consultants Munich http://berklix.com Mail plain text; Not quoted-printable, or HTML or base 64. Avoid top posting, it cripples itemised cumulative responses. From owner-freebsd-hackers@FreeBSD.ORG Tue Dec 21 09:26:02 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EE5C106564A; Tue, 21 Dec 2010 09:26:02 +0000 (UTC) (envelope-from artemb@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 930B18FC16; Tue, 21 Dec 2010 09:26:01 +0000 (UTC) Received: by qwj9 with SMTP id 9so3559025qwj.13 for ; Tue, 21 Dec 2010 01:26:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=+iM68/Tvhq2O+rCGXcFTHX2eRzgNbWT9Gh65E4tX8io=; b=TBtJf2cbOuaeMrUvcbgAPQK0t8+HLbeRbDq3g7/RI/WzdY3I/L+t5lj4dAZiIMGCag MuvH7fPXUSypzIt763XTjNPXTlWIE+f/7xOfbTJG77mcd4oTB0Eo7bOHuem+vGelrPbk dIGqwrMJxRP4WRsmZNVjegcxVNYZGX7lclJt8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=Nd2n4OeuaHuvSVlhzcVEzhjeqs86DUMhgovKACyjoEPOy8omy2ZB9ht8U674jg9TdW mvaROy01sBBRPYHeuhm6ISLNfat3zu6RysiQYu8ZcXrZGp7Yp1+MdONu6okjugT+Pa6Z tMx0iv1RRQqW9JZ9fpmRnPYPIrVrOi99m94rs= MIME-Version: 1.0 Received: by 10.224.80.198 with SMTP id u6mr5054866qak.113.1292923560485; Tue, 21 Dec 2010 01:26:00 -0800 (PST) Sender: artemb@gmail.com Received: by 10.220.188.141 with HTTP; Tue, 21 Dec 2010 01:26:00 -0800 (PST) In-Reply-To: <4D0F3AD6.9080002@freebsd.org> References: <20101211215341.0000097c@unknown> <20101213103535.00005f3d@unknown> <4D061E00.7050606@freebsd.org> <4D0F3AD6.9080002@freebsd.org> Date: Tue, 21 Dec 2010 01:26:00 -0800 X-Google-Sender-Auth: 5MPCx-vGqqdLmBXDljkq-of7i0Y Message-ID: From: Artem Belevich To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org, FreeBSD-Current Subject: Re: [dtrace] syscall provider naming convention. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Dec 2010 09:26:02 -0000 On Mon, Dec 20, 2010 at 3:15 AM, Andriy Gapon wrote: > It would be nice to get the i386 counterpart too when this goes into the tree. Here's updated version that has syscall:linux32 working on i386, too. https://sites.google.com/site/abc678site/files/dt-systrace-20101221.patch.gz --Artem From owner-freebsd-hackers@FreeBSD.ORG Tue Dec 21 09:27:56 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A453106564A; Tue, 21 Dec 2010 09:27:56 +0000 (UTC) (envelope-from artemb@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1E98A8FC15; Tue, 21 Dec 2010 09:27:55 +0000 (UTC) Received: by qyk36 with SMTP id 36so3556097qyk.13 for ; Tue, 21 Dec 2010 01:27:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=0xdMtA1gdjIFdKBopQTcaLC6csTHreSu39U0APVUnBg=; b=qvDLSdIL1K1/urp9EXACP2h5i49eGJp9d1jpq99Qrtzsw7fCY3J9n6iCGSGTBwFmaA 5tKWCltnY9FGq+sOhWOdWVLnZFUkGJ1hWoaICWUyHiE03KdYnfAfwM702umCZL+3kbSe enwUuM79iOI1B0F/J/XPEBLRySWAZ/aJzaXZo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=fQODJ14vda6upWqIpnTNq591mBxtMCLPjs+pgHNvQWyol+zc0AfWH9a0dCNsjNjUe0 hHQcrQpc6PG5ohNifjkT5rBvoy24AF4p8+fu4OiAuhi1HHuvStCWyKpRrILKP/+hhZBY ix7CjOYMn+HjYlGZn9IdC+9t2XAbOWTWh1cp8= MIME-Version: 1.0 Received: by 10.224.67.136 with SMTP id r8mr5199253qai.63.1292923675165; Tue, 21 Dec 2010 01:27:55 -0800 (PST) Sender: artemb@gmail.com Received: by 10.220.188.141 with HTTP; Tue, 21 Dec 2010 01:27:55 -0800 (PST) In-Reply-To: References: <20101211215341.0000097c@unknown> <20101213103535.00005f3d@unknown> <4D061E00.7050606@freebsd.org> <4D0F3AD6.9080002@freebsd.org> Date: Tue, 21 Dec 2010 01:27:55 -0800 X-Google-Sender-Auth: T8szlCp_BkbfdMIpfPW49-Q49Rs Message-ID: From: Artem Belevich To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org, FreeBSD-Current Subject: Re: [dtrace] syscall provider naming convention. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Dec 2010 09:27:56 -0000 On Tue, Dec 21, 2010 at 1:26 AM, Artem Belevich wrote: > On Mon, Dec 20, 2010 at 3:15 AM, Andriy Gapon wrote: >> It would be nice to get the i386 counterpart too when this goes into the tree. > > Here's updated version that has syscall:linux32 working on i386, too. > > https://sites.google.com/site/abc678site/files/dt-systrace-20101221.patch.gz Forgot to mention. The patch is against stable/8 r216436 --Artem From owner-freebsd-hackers@FreeBSD.ORG Tue Dec 21 09:47:28 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84892106564A; Tue, 21 Dec 2010 09:47:28 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 99C888FC1D; Tue, 21 Dec 2010 09:47:27 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA02978; Tue, 21 Dec 2010 11:47:25 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1PUyoW-000L3q-P5; Tue, 21 Dec 2010 11:47:24 +0200 Message-ID: <4D1077AB.4010707@freebsd.org> Date: Tue, 21 Dec 2010 11:47:23 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101211 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: Artem Belevich References: <20101211215341.0000097c@unknown> <20101213103535.00005f3d@unknown> <4D061E00.7050606@freebsd.org> <4D0F3AD6.9080002@freebsd.org> In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, FreeBSD-Current Subject: Re: [dtrace] syscall provider naming convention. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Dec 2010 09:47:28 -0000 on 21/12/2010 11:27 Artem Belevich said the following: > On Tue, Dec 21, 2010 at 1:26 AM, Artem Belevich wrote: >> On Mon, Dec 20, 2010 at 3:15 AM, Andriy Gapon wrote: >>> It would be nice to get the i386 counterpart too when this goes into the tree. >> >> Here's updated version that has syscall:linux32 working on i386, too. >> >> https://sites.google.com/site/abc678site/files/dt-systrace-20101221.patch.gz > > Forgot to mention. The patch is against stable/8 r216436 The previous version applied fine to head, I think that that should be the case with this version too. I have one comment though. I am not sure about renaming syscall.ko to syscall_freebsd.ko. Perhaps we could keep the old name? Or add a new module under that name that would load native syscall module and all emulation syscall modules (if any)? -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Tue Dec 21 17:56:14 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D9E71065672 for ; Tue, 21 Dec 2010 17:56:14 +0000 (UTC) (envelope-from cliftonr@lava.net) Received: from outgoing03.lava.net (outgoing03.lava.net [IPv6:2001:1888:0:1:202:b3ff:fe1d:6b98]) by mx1.freebsd.org (Postfix) with ESMTP id EE6298FC1D for ; Tue, 21 Dec 2010 17:56:13 +0000 (UTC) Received: from malasada.lava.net (malasada.lava.net [64.65.64.17]) by outgoing03.lava.net (Postfix) with ESMTP id 11E4B103DA; Tue, 21 Dec 2010 07:56:13 -1000 (HST) Received: by malasada.lava.net (Postfix, from userid 102) id F2527196E1C; Tue, 21 Dec 2010 07:56:10 -1000 (HST) Date: Tue, 21 Dec 2010 07:56:10 -1000 From: Clifton Royston To: "Julian H. Stacey" Message-ID: <20101221175610.GC28185@lava.net> Mail-Followup-To: "Julian H. Stacey" , freebsd-hackers@freebsd.org References: <20101221120030.2ECA1106567A@hub.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101221120030.2ECA1106567A@hub.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-hackers@freebsd.org Subject: Re: Forward to abuse@ button for http://tools.ietf.org/html/rfc5965 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Dec 2010 17:56:14 -0000 > Date: Tue, 21 Dec 2010 02:01:07 +0100 > From: "Julian H. Stacey" > Subject: Forward to abuse@ button for > http://tools.ietf.org/html/rfc5965 > To: hackers@freebsd.org > Message-ID: <201012210101.oBL117OZ005993@fire.js.berklix.net> > > Hi hackers@, ... > I just posted a question [see below] to exmh-users@redhat.com, > > A similar question extends for nmh & claws-mail etc: > Any tools to auto forward spam into rfc5965 format for abuse@ ? > > ] To: exmh-users@redhat.com ... > ] From: Yahoo! Mail > ] Reply-To: Yahoo! Mail > ] MIME-Version: 1.0 > ] Content-Type: text/plain; charset = "us-ascii" > ] Content-Transfer-Encoding: 7bit > ] X-Mailer: KANA Response 7.0.1.142.15 > ] > ] Thank you for your email, but this address now only accepts messages in > ] Abuse Reporting Format (http://tools.ietf.org/html/rfc5965) > ] > ] To report abuse manually (or to get help with security or abuse related > ] issues), please go to Yahoo! Abuse: > ] http://abuse.yahoo.com > ] > ] For questions about using Yahoo! services, please visit Yahoo Help: > ] http://help.yahoo.com > ] > ] Thank you, > ] - Yahoo! Customer Care > ] > ] Note: Please do not reply to this email as replies will not be answered. > ] -------- > > PS Spot the connection ? > Yahoo dumps anti spam work on unpaid suckers. Yahoo lays off 4% of staff, > http://berklix.com/~jhs/mail/no_rfc5965.html > > Cheers, > Julian Julian, The only reference I've seen to date on a public tool for ARF formatting are Perl modules - Mail::ARF, Email::ARF, and MIME::ARF; but you should be able to craft something with those. ARF is a variation on the previously existing MIME Multipart/Report format, so you can also look at any MIME generation tools which play well with exmh. Email::ARF is on CPAN and a link to MIME::ARF can be found here: http://wordtothewise.com/resources/arfdeveloper.html John Levine, a long-time FreeBSD user and Internet mail guru, was one of the developers who helped work it through the IETF, so I did some searches on his site (Google search on: "arf site:jl.ly" but don't find anything specifically about tools. However, I can also inform you that that even if you submit a properly formatted ARF report, a good fraction of the time Yahoo! may still bounce it indicating that you must submit an ARF report. I have seen a number of reports of that. Outsourcing, I'm sure. (They also have been known to firmly claim that a number of Yahoo's mail outbounds are not their servers.) AOL will actually process ARF messages and so will some other major providers, so it's still worth doing. -- Clifton -- Clifton Royston -- cliftonr@iandicomputing.com / cliftonr@lava.net President - I and I Computing * http://www.iandicomputing.com/ Custom programming, network design, systems and network consulting services From owner-freebsd-hackers@FreeBSD.ORG Tue Dec 21 23:26:46 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 661C71065670 for ; Tue, 21 Dec 2010 23:26:46 +0000 (UTC) (envelope-from lgj@usenix.org) Received: from lonestar.usenix.org (lonestar.usenix.org [131.106.3.102]) by mx1.freebsd.org (Postfix) with ESMTP id 34AE18FC20 for ; Tue, 21 Dec 2010 23:26:46 +0000 (UTC) Received: from negroni.usenix.org (negroni.usenix.org [131.106.3.145]) (authenticated bits=0) by lonestar.usenix.org (8.14.2/8.14.2) with ESMTP id oBLNPphd006274 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Tue, 21 Dec 2010 15:26:45 -0800 (PST) From: Lionel Garth Jones Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 21 Dec 2010 15:26:45 -0800 Message-Id: To: freebsd-hackers@freebsd.org Mime-Version: 1.0 (Apple Message framework v1082) X-Mailer: Apple Mail (2.1082) X-DCC-USENIX-Metrics: lonestar; whitelist X-Spam-Status: No, score=0.7 required=6.0 tests=ALL_TRUSTED, FH_DATE_PAST_20XX autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on lonestar X-Mailman-Approved-At: Tue, 21 Dec 2010 23:51:42 +0000 Subject: USENIX HotPar'11 Submission Deadline Approaching X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Dec 2010 23:26:46 -0000 On behalf of the Program Committee for the 3rd USENIX Workshop on Hot Topics in Parallelism (HotPar '11), we'd like to invite you to submit position papers. HotPar '11 will bring together researchers and practitioners doing innovative work in the area of parallel computing. Multicore and multithreaded processors are the pervasive computing platform of the future. This trend is driven by limits on energy consumption in computer systems and the poor energy performance of conventional microprocessors. Parallel architectures can potentially mitigate these problems, but this new computer architecture will only be successful if languages, systems, and applications can take advantage of parallel hardware. Navigating this change will require new concurrency-friendly programming paradigms, new methods of application design, new structures for system software, and new models of interaction between applications, compilers, operating systems, and hardware. We request submissions of position papers that propose new directions for research of products in these areas, advocate non-traditional approaches to the problems engendered by parallelism, or potentially generate controversy and discussion. Paper registration (abstract submission) due: Sunday, January 16, 2011, 11:59 p.m. PST Paper submissions due: Tuesday, January 25, 2011, 11:59 p.m. PST More information and submission guidelines are available at http://www.usenix.org/hotpar11/cfpa We look forward to receiving your submissions! Sincerely, Michael McCool, Intel Mendel Rosenblum, Stanford University HotPar '11 Program Co-Chairs hotpar11chairs@usenix.org ------------------------------------------------------------------------ HotPar '11 Call for Papers 3rd USENIX Workshop on Hot Topics in Parallelism (HotPar '11) May 26-27, 2011, Berkeley, CA http://www.usenix.org/hotpar11/cfpa/ Paper registration (abstract submission) due: Sunday, January 16, 2011, 11:59 p.m. PST Paper submissions due: Tuesday, January 25, 2011, 11:59 p.m. PST ----------------------------------------------------------------------- From owner-freebsd-hackers@FreeBSD.ORG Wed Dec 22 20:50:17 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6153D1065672 for ; Wed, 22 Dec 2010 20:50:17 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from tower.berklix.org (tower.berklix.org [83.236.223.114]) by mx1.freebsd.org (Postfix) with ESMTP id D3A188FC0C for ; Wed, 22 Dec 2010 20:50:16 +0000 (UTC) Received: from park.js.berklix.net (p5B22D101.dip.t-dialin.net [91.34.209.1]) (authenticated bits=0) by tower.berklix.org (8.14.2/8.14.2) with ESMTP id oBMKDEFk047264; Wed, 22 Dec 2010 20:13:17 GMT (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by park.js.berklix.net (8.13.8/8.13.8) with ESMTP id oBMKEneG072236; Wed, 22 Dec 2010 21:14:49 +0100 (CET) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.3/8.14.3) with ESMTP id oBMKEcI3028332; Wed, 22 Dec 2010 21:14:44 +0100 (CET) (envelope-from jhs@fire.js.berklix.net) Message-Id: <201012222014.oBMKEcI3028332@fire.js.berklix.net> To: Clifton Royston From: "Julian H. Stacey" Organization: http://www.berklix.com BSD Unix Linux Consultancy, Munich Germany User-agent: EXMH on FreeBSD http://www.berklix.com/free/ X-URL: http://www.berklix.com In-reply-to: Your message "Tue, 21 Dec 2010 07:56:10 -1000." <20101221175610.GC28185@lava.net> Date: Wed, 22 Dec 2010 21:14:38 +0100 Sender: jhs@berklix.com Cc: freebsd-hackers@freebsd.org Subject: Re: Forward to abuse@ button for http://tools.ietf.org/html/rfc5965 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Dec 2010 20:50:17 -0000 Thanks Clifton, most informative :-) Cheers, Julian -- Julian Stacey, BSD Unix Linux C Sys Eng Consultants Munich http://berklix.com Mail plain text; Not quoted-printable, or HTML or base 64. Avoid top posting, it cripples itemised cumulative responses. From owner-freebsd-hackers@FreeBSD.ORG Thu Dec 23 23:18:05 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA0B410656C4 for ; Thu, 23 Dec 2010 23:18:05 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from mail-ew0-f54.google.com (mail-ew0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 087708FC0C for ; Thu, 23 Dec 2010 23:18:04 +0000 (UTC) Received: by ewy24 with SMTP id 24so3537829ewy.13 for ; Thu, 23 Dec 2010 15:18:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=jSANTUQJOvUu/ZgE7r0t2m2UYBKyTerj4OmxbZJjA8s=; b=C0VQb+HwpJyje5T0ylk20ZHA+OJ7iSQGUEWoltTj4q24lxEosphJx6atAswwvyJEsE KpvKWd37pWQ9ALF07FnyJtuEWMsEjkKkgO18R/FwsTkMb9Pe6S9PX7vIZRydY6gZVH6B 8taaiZ/zeUqrw1U41dI3dJDNZpBAumT4WTexQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=lbdCr/nZyFf6AXy/a32POqAUB+73un+G4bWOftUpVP7p+mvvCrMHx5W978+7htDjz2 Dykws8g2r3OKNSIK1YwcM5QSQLpqPcoqkHF19adHybQbYyNxhMmSYYoDUBSUryiq5mPq /pXTYGkk5+SlknCoFHxl9LD7zPZ1fj9Jyd1HQ= Received: by 10.213.20.141 with SMTP id f13mr1324081ebb.36.1293144408082; Thu, 23 Dec 2010 14:46:48 -0800 (PST) Received: from localhost ([212.98.186.134]) by mx.google.com with ESMTPS id t5sm5966779eeh.2.2010.12.23.14.46.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 23 Dec 2010 14:46:47 -0800 (PST) Date: Fri, 24 Dec 2010 00:46:20 +0200 From: Gleb Kurtsou To: freebsd-hackers@freebsd.org Message-ID: <20101223224619.GA21984@tops> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="J/dobhs11T7y2rNN" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Subject: [rfc] Replacing FNV and hash32 with Paul Hsieh's SuperFastHash X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Dec 2010 23:18:05 -0000 --J/dobhs11T7y2rNN Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Hi, I've recently noticed that hash table use in nullfs was inefficient, 1/3 to half of buckets remained unused. I've started investigating it further and came across SuperFastHash hashing function, SFH (SuperFastHash) has BSD license, used in WebKit and other open source projects. Detailed description and Comparision with FNV and Bob Jenkin's hash can be found here: http://www.azillionmonkeys.com/qed/hash.html In my tests SFH (SuperFastHash) was 1.3 to 4 times faster than FNV (it depends on size of data being hashed) e.g. performance of hashing 56 bytes struct (Core i5 CPU, 2 cores + 2 hyperthreads): SFH -- 1339.79 MB/s FNV -- 330.27 MB/s I've prepared a patch to change FNV and hash32 with SFH in the tree. For testing I've used dbench with 16 processes on 1 Gb swap back md device, UFS + SoftUpdates: Old hash (Mb/s): 599.94 600.096 599.536 SFH hash (Mb/s): 612.439 612.341 609.673 It's just ~1% improvement, but dbench is not a VFS metadata intensive benchmark. Subjectively it feels faster accessing maildir mailboxes with ~10.000 messages : ) I'd also wish hash32 (often called Bernstein hash) to be replaced with better function (it might be FNV if not SFH). Hash32 is inappropriate for binary data that results in poor distribution. Thanks, Gleb. --J/dobhs11T7y2rNN Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="sfh.patch.txt" commit 6e19401826b6769fa95b1e4f9e561dec7101082b Author: Gleb Kurtsou Date: Thu Dec 16 08:05:14 2010 +0200 Import Paul Hsieh's SuperFastHash. Replace FNV and Bernstein hash uses with SFH. In most cases Bernstein is simply inappropriate choice. diff --git a/lib/libkvm/kvm_minidump_amd64.c b/lib/libkvm/kvm_minidump_amd64.c index 15630b1..7c9c4dd 100644 --- a/lib/libkvm/kvm_minidump_amd64.c +++ b/lib/libkvm/kvm_minidump_amd64.c @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include @@ -74,26 +74,26 @@ static void hpt_insert(kvm_t *kd, vm_paddr_t pa, int64_t off) { struct hpte *hpte; - uint32_t fnv = FNV1_32_INIT; + uint32_t hash; - fnv = fnv_32_buf(&pa, sizeof(pa), fnv); - fnv &= (HPT_SIZE - 1); + hash = hash_sfh_buf(&pa, sizeof(pa), sizeof(pa)); + hash &= (HPT_SIZE - 1); hpte = malloc(sizeof(*hpte)); hpte->pa = pa; hpte->off = off; - hpte->next = kd->vmst->hpt_head[fnv]; - kd->vmst->hpt_head[fnv] = hpte; + hpte->next = kd->vmst->hpt_head[hash]; + kd->vmst->hpt_head[hash] = hpte; } static int64_t hpt_find(kvm_t *kd, vm_paddr_t pa) { struct hpte *hpte; - uint32_t fnv = FNV1_32_INIT; + uint32_t hash; - fnv = fnv_32_buf(&pa, sizeof(pa), fnv); - fnv &= (HPT_SIZE - 1); - for (hpte = kd->vmst->hpt_head[fnv]; hpte != NULL; hpte = hpte->next) { + hash = hash_sfh_buf(&pa, sizeof(pa), sizeof(pa)); + hash &= (HPT_SIZE - 1); + for (hpte = kd->vmst->hpt_head[hash]; hpte != NULL; hpte = hpte->next) { if (pa == hpte->pa) return (hpte->off); } diff --git a/lib/libkvm/kvm_minidump_arm.c b/lib/libkvm/kvm_minidump_arm.c index d48c1bc..f42f4ca 100644 --- a/lib/libkvm/kvm_minidump_arm.c +++ b/lib/libkvm/kvm_minidump_arm.c @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include @@ -77,26 +77,26 @@ static void hpt_insert(kvm_t *kd, uint64_t pa, int64_t off) { struct hpte *hpte; - uint32_t fnv = FNV1_32_INIT; + uint32_t hash; - fnv = fnv_32_buf(&pa, sizeof(pa), fnv); - fnv &= (HPT_SIZE - 1); + hash = hash_sfh_buf(&pa, sizeof(pa), sizeof(pa)); + hash &= (HPT_SIZE - 1); hpte = malloc(sizeof(*hpte)); hpte->pa = pa; hpte->off = off; - hpte->next = kd->vmst->hpt_head[fnv]; - kd->vmst->hpt_head[fnv] = hpte; + hpte->next = kd->vmst->hpt_head[hash]; + kd->vmst->hpt_head[hash] = hpte; } static int64_t hpt_find(kvm_t *kd, uint64_t pa) { struct hpte *hpte; - uint32_t fnv = FNV1_32_INIT; + uint32_t hash; - fnv = fnv_32_buf(&pa, sizeof(pa), fnv); - fnv &= (HPT_SIZE - 1); - for (hpte = kd->vmst->hpt_head[fnv]; hpte != NULL; hpte = hpte->next) + hash = hash_sfh_buf(&pa, sizeof(pa), sizeof(pa)); + hash &= (HPT_SIZE - 1); + for (hpte = kd->vmst->hpt_head[hash]; hpte != NULL; hpte = hpte->next) if (pa == hpte->pa) return (hpte->off); diff --git a/lib/libkvm/kvm_minidump_i386.c b/lib/libkvm/kvm_minidump_i386.c index 0d31705..343d70e 100644 --- a/lib/libkvm/kvm_minidump_i386.c +++ b/lib/libkvm/kvm_minidump_i386.c @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include @@ -76,26 +76,26 @@ static void hpt_insert(kvm_t *kd, uint64_t pa, int64_t off) { struct hpte *hpte; - uint32_t fnv = FNV1_32_INIT; + uint32_t hash; - fnv = fnv_32_buf(&pa, sizeof(pa), fnv); - fnv &= (HPT_SIZE - 1); + hash = hash_sfh_buf(&pa, sizeof(pa), sizeof(pa)); + hash &= (HPT_SIZE - 1); hpte = malloc(sizeof(*hpte)); hpte->pa = pa; hpte->off = off; - hpte->next = kd->vmst->hpt_head[fnv]; - kd->vmst->hpt_head[fnv] = hpte; + hpte->next = kd->vmst->hpt_head[hash]; + kd->vmst->hpt_head[hash] = hpte; } static int64_t hpt_find(kvm_t *kd, uint64_t pa) { struct hpte *hpte; - uint32_t fnv = FNV1_32_INIT; + uint32_t hash ; - fnv = fnv_32_buf(&pa, sizeof(pa), fnv); - fnv &= (HPT_SIZE - 1); - for (hpte = kd->vmst->hpt_head[fnv]; hpte != NULL; hpte = hpte->next) { + hash = hash_sfh_buf(&pa, sizeof(pa), sizeof(pa)); + hash &= (HPT_SIZE - 1); + for (hpte = kd->vmst->hpt_head[hash]; hpte != NULL; hpte = hpte->next) { if (pa == hpte->pa) return (hpte->off); } diff --git a/lib/libkvm/kvm_minidump_mips.c b/lib/libkvm/kvm_minidump_mips.c index c82e249..a97da93 100644 --- a/lib/libkvm/kvm_minidump_mips.c +++ b/lib/libkvm/kvm_minidump_mips.c @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include @@ -78,26 +78,26 @@ static void hpt_insert(kvm_t *kd, uint64_t pa, int64_t off) { struct hpte *hpte; - uint32_t fnv = FNV1_32_INIT; + uint32_t hash; - fnv = fnv_32_buf(&pa, sizeof(pa), fnv); - fnv &= (HPT_SIZE - 1); + hash = hash_sfh_buf(&pa, sizeof(pa), sizeof(pa)); + hash &= (HPT_SIZE - 1); hpte = malloc(sizeof(*hpte)); hpte->pa = pa; hpte->off = off; - hpte->next = kd->vmst->hpt_head[fnv]; - kd->vmst->hpt_head[fnv] = hpte; + hpte->next = kd->vmst->hpt_head[hash]; + kd->vmst->hpt_head[hash] = hpte; } static int64_t hpt_find(kvm_t *kd, uint64_t pa) { struct hpte *hpte; - uint32_t fnv = FNV1_32_INIT; + uint32_t hash; - fnv = fnv_32_buf(&pa, sizeof(pa), fnv); - fnv &= (HPT_SIZE - 1); - for (hpte = kd->vmst->hpt_head[fnv]; hpte != NULL; hpte = hpte->next) + hash = hash_sfh_buf(&pa, sizeof(pa), sizeof(pa)); + hash &= (HPT_SIZE - 1); + for (hpte = kd->vmst->hpt_head[hash]; hpte != NULL; hpte = hpte->next) if (pa == hpte->pa) return (hpte->off); diff --git a/sys/dev/drm/drm_hashtab.c b/sys/dev/drm/drm_hashtab.c index 360c02b..b638a11 100644 --- a/sys/dev/drm/drm_hashtab.c +++ b/sys/dev/drm/drm_hashtab.c @@ -62,7 +62,7 @@ void drm_ht_verbose_list(struct drm_open_hash *ht, unsigned long key) unsigned int hashed_key; int count = 0; - hashed_key = hash32_buf(&key, sizeof(key), ht->order); + hashed_key = hash_sfh_buf(&key, sizeof(key), ht->order); DRM_DEBUG("Key is 0x%08lx, Hashed key is 0x%08x\n", key, hashed_key); h_list = &ht->table[hashed_key & ht->mask]; LIST_FOREACH(entry, h_list, head) @@ -76,7 +76,7 @@ drm_ht_find_key(struct drm_open_hash *ht, unsigned long key) struct drm_hash_item_list *h_list; unsigned int hashed_key; - hashed_key = hash32_buf(&key, sizeof(key), ht->order); + hashed_key = hash_sfh_buf(&key, sizeof(key), ht->order); h_list = &ht->table[hashed_key & ht->mask]; LIST_FOREACH(entry, h_list, head) { if (entry->key == key) @@ -95,7 +95,7 @@ int drm_ht_insert_item(struct drm_open_hash *ht, struct drm_hash_item *item) unsigned int hashed_key; unsigned long key = item->key; - hashed_key = hash32_buf(&key, sizeof(key), ht->order); + hashed_key = hash_sfh_buf(&key, sizeof(key), ht->order); h_list = &ht->table[hashed_key & ht->mask]; parent = NULL; LIST_FOREACH(entry, h_list, head) { @@ -125,7 +125,7 @@ int drm_ht_just_insert_please(struct drm_open_hash *ht, struct drm_hash_item *it unsigned long mask = (1 << bits) - 1; unsigned long first, unshifted_key = 0; - unshifted_key = hash32_buf(&seed, sizeof(seed), unshifted_key); + unshifted_key = hash_sfh_buf(&seed, sizeof(seed), unshifted_key); first = unshifted_key; do { item->key = (unshifted_key << shift) + add; diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 380aa72..cf28457 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -3096,7 +3096,8 @@ nfsrv_hashfh(fhandle_t *fhp) { uint32_t hashval; - hashval = hash32_buf(&fhp->fh_fid, sizeof(struct fid), 0); + hashval = hash_sfh_buf(&fhp->fh_fid, sizeof(struct fid), + sizeof(struct fid)); return (hashval); } diff --git a/sys/kern/uipc_sem.c b/sys/kern/uipc_sem.c index 5270078..b3a8882 100644 --- a/sys/kern/uipc_sem.c +++ b/sys/kern/uipc_sem.c @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include @@ -86,7 +86,7 @@ __FBSDID("$FreeBSD$"); struct ksem_mapping { char *km_path; - Fnv32_t km_fnv; + uint32_t km_hash; struct ksem *km_ksem; LIST_ENTRY(ksem_mapping) km_link; }; @@ -99,7 +99,7 @@ static struct mtx sem_lock; static u_long ksem_hash; static int ksem_dead; -#define KSEM_HASH(fnv) (&ksem_dictionary[(fnv) & ksem_hash]) +#define KSEM_HASH(h) (&ksem_dictionary[(h) & ksem_hash]) static int nsems = 0; SYSCTL_DECL(_p1003_1b); @@ -117,11 +117,11 @@ static int ksem_create(struct thread *td, const char *path, static void ksem_drop(struct ksem *ks); static int ksem_get(struct thread *td, semid_t id, struct file **fpp); static struct ksem *ksem_hold(struct ksem *ks); -static void ksem_insert(char *path, Fnv32_t fnv, struct ksem *ks); -static struct ksem *ksem_lookup(char *path, Fnv32_t fnv); +static void ksem_insert(char *path, uint32_t hash, struct ksem *ks); +static struct ksem *ksem_lookup(char *path, uint32_t hash); static void ksem_module_destroy(void); static int ksem_module_init(void); -static int ksem_remove(char *path, Fnv32_t fnv, struct ucred *ucred); +static int ksem_remove(char *path, uint32_t hash, struct ucred *ucred); static int sem_modload(struct module *module, int cmd, void *arg); static fo_rdwr_t ksem_read; @@ -316,16 +316,16 @@ ksem_access(struct ksem *ks, struct ucred *ucred) /* * Dictionary management. We maintain an in-kernel dictionary to map - * paths to semaphore objects. We use the FNV hash on the path to + * paths to semaphore objects. We use the hash on the path to * store the mappings in a hash table. */ static struct ksem * -ksem_lookup(char *path, Fnv32_t fnv) +ksem_lookup(char *path, uint32_t hash) { struct ksem_mapping *map; - LIST_FOREACH(map, KSEM_HASH(fnv), km_link) { - if (map->km_fnv != fnv) + LIST_FOREACH(map, KSEM_HASH(hash), km_link) { + if (map->km_hash != hash) continue; if (strcmp(map->km_path, path) == 0) return (map->km_ksem); @@ -335,25 +335,25 @@ ksem_lookup(char *path, Fnv32_t fnv) } static void -ksem_insert(char *path, Fnv32_t fnv, struct ksem *ks) +ksem_insert(char *path, uint32_t hash, struct ksem *ks) { struct ksem_mapping *map; map = malloc(sizeof(struct ksem_mapping), M_KSEM, M_WAITOK); map->km_path = path; - map->km_fnv = fnv; + map->km_hash = hash; map->km_ksem = ksem_hold(ks); - LIST_INSERT_HEAD(KSEM_HASH(fnv), map, km_link); + LIST_INSERT_HEAD(KSEM_HASH(hash), map, km_link); } static int -ksem_remove(char *path, Fnv32_t fnv, struct ucred *ucred) +ksem_remove(char *path, uint32_t hash, struct ucred *ucred) { struct ksem_mapping *map; int error; - LIST_FOREACH(map, KSEM_HASH(fnv), km_link) { - if (map->km_fnv != fnv) + LIST_FOREACH(map, KSEM_HASH(hash), km_link) { + if (map->km_hash != hash) continue; if (strcmp(map->km_path, path) == 0) { #ifdef MAC @@ -413,7 +413,8 @@ ksem_create(struct thread *td, const char *name, semid_t *semidp, mode_t mode, struct ksem *ks; struct file *fp; char *path; - Fnv32_t fnv; + size_t pathlen; + uint32_t hash; int error, fd; if (value > SEM_VALUE_MAX) @@ -449,7 +450,7 @@ ksem_create(struct thread *td, const char *name, semid_t *semidp, mode_t mode, ks->ks_flags |= KS_ANONYMOUS; } else { path = malloc(MAXPATHLEN, M_KSEM, M_WAITOK); - error = copyinstr(name, path, MAXPATHLEN, NULL); + error = copyinstr(name, path, MAXPATHLEN, &pathlen); /* Require paths to start with a '/' character. */ if (error == 0 && path[0] != '/') @@ -461,9 +462,9 @@ ksem_create(struct thread *td, const char *name, semid_t *semidp, mode_t mode, return (error); } - fnv = fnv_32_str(path, FNV1_32_INIT); + hash = hash_sfh_buf(path, pathlen, pathlen); sx_xlock(&ksem_dict_lock); - ks = ksem_lookup(path, fnv); + ks = ksem_lookup(path, hash); if (ks == NULL) { /* Object does not exist, create it if requested. */ if (flags & O_CREAT) { @@ -471,7 +472,7 @@ ksem_create(struct thread *td, const char *name, semid_t *semidp, mode_t mode, if (ks == NULL) error = ENFILE; else { - ksem_insert(path, fnv, ks); + ksem_insert(path, hash, ks); path = NULL; } } else @@ -591,19 +592,20 @@ int ksem_unlink(struct thread *td, struct ksem_unlink_args *uap) { char *path; - Fnv32_t fnv; + size_t pathlen; + uint32_t hash; int error; path = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); - error = copyinstr(uap->name, path, MAXPATHLEN, NULL); + error = copyinstr(uap->name, path, MAXPATHLEN, &pathlen); if (error) { free(path, M_TEMP); return (error); } - fnv = fnv_32_str(path, FNV1_32_INIT); + hash = hash_sfh_buf(path, pathlen, pathlen); sx_xlock(&ksem_dict_lock); - error = ksem_remove(path, fnv, td->td_ucred); + error = ksem_remove(path, hash, td->td_ucred); sx_xunlock(&ksem_dict_lock); free(path, M_TEMP); diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c index cef8317..a8f68b7 100644 --- a/sys/kern/uipc_shm.c +++ b/sys/kern/uipc_shm.c @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include @@ -89,7 +89,7 @@ __FBSDID("$FreeBSD$"); struct shm_mapping { char *sm_path; - Fnv32_t sm_fnv; + uint32_t sm_hash; struct shmfd *sm_shmfd; LIST_ENTRY(shm_mapping) sm_link; }; @@ -100,16 +100,16 @@ static struct sx shm_dict_lock; static struct mtx shm_timestamp_lock; static u_long shm_hash; -#define SHM_HASH(fnv) (&shm_dictionary[(fnv) & shm_hash]) +#define SHM_HASH(h) (&shm_dictionary[(h) & shm_hash]) static int shm_access(struct shmfd *shmfd, struct ucred *ucred, int flags); static struct shmfd *shm_alloc(struct ucred *ucred, mode_t mode); static void shm_dict_init(void *arg); static void shm_drop(struct shmfd *shmfd); static struct shmfd *shm_hold(struct shmfd *shmfd); -static void shm_insert(char *path, Fnv32_t fnv, struct shmfd *shmfd); -static struct shmfd *shm_lookup(char *path, Fnv32_t fnv); -static int shm_remove(char *path, Fnv32_t fnv, struct ucred *ucred); +static void shm_insert(char *path, uint32_t hash, struct shmfd *shmfd); +static struct shmfd *shm_lookup(char *path, uint32_t hash); +static int shm_remove(char *path, uint32_t hash, struct ucred *ucred); static int shm_dotruncate(struct shmfd *shmfd, off_t length); static fo_rdwr_t shm_read; @@ -404,7 +404,7 @@ shm_access(struct shmfd *shmfd, struct ucred *ucred, int flags) /* * Dictionary management. We maintain an in-kernel dictionary to map - * paths to shmfd objects. We use the FNV hash on the path to store + * paths to shmfd objects. We use the hash on the path to store * the mappings in a hash table. */ static void @@ -418,12 +418,12 @@ shm_dict_init(void *arg) SYSINIT(shm_dict_init, SI_SUB_SYSV_SHM, SI_ORDER_ANY, shm_dict_init, NULL); static struct shmfd * -shm_lookup(char *path, Fnv32_t fnv) +shm_lookup(char *path, uint32_t hash) { struct shm_mapping *map; - LIST_FOREACH(map, SHM_HASH(fnv), sm_link) { - if (map->sm_fnv != fnv) + LIST_FOREACH(map, SHM_HASH(hash), sm_link) { + if (map->sm_hash != hash) continue; if (strcmp(map->sm_path, path) == 0) return (map->sm_shmfd); @@ -433,25 +433,25 @@ shm_lookup(char *path, Fnv32_t fnv) } static void -shm_insert(char *path, Fnv32_t fnv, struct shmfd *shmfd) +shm_insert(char *path, uint32_t hash, struct shmfd *shmfd) { struct shm_mapping *map; map = malloc(sizeof(struct shm_mapping), M_SHMFD, M_WAITOK); map->sm_path = path; - map->sm_fnv = fnv; + map->sm_hash = hash; map->sm_shmfd = shm_hold(shmfd); - LIST_INSERT_HEAD(SHM_HASH(fnv), map, sm_link); + LIST_INSERT_HEAD(SHM_HASH(hash), map, sm_link); } static int -shm_remove(char *path, Fnv32_t fnv, struct ucred *ucred) +shm_remove(char *path, uint32_t hash, struct ucred *ucred) { struct shm_mapping *map; int error; - LIST_FOREACH(map, SHM_HASH(fnv), sm_link) { - if (map->sm_fnv != fnv) + LIST_FOREACH(map, SHM_HASH(hash), sm_link) { + if (map->sm_hash != hash) continue; if (strcmp(map->sm_path, path) == 0) { #ifdef MAC @@ -482,7 +482,8 @@ shm_open(struct thread *td, struct shm_open_args *uap) struct shmfd *shmfd; struct file *fp; char *path; - Fnv32_t fnv; + size_t pathlen; + uint32_t hash; mode_t cmode; int fd, error; @@ -511,7 +512,7 @@ shm_open(struct thread *td, struct shm_open_args *uap) shmfd = shm_alloc(td->td_ucred, cmode); } else { path = malloc(MAXPATHLEN, M_SHMFD, M_WAITOK); - error = copyinstr(uap->path, path, MAXPATHLEN, NULL); + error = copyinstr(uap->path, path, MAXPATHLEN, &pathlen); /* Require paths to start with a '/' character. */ if (error == 0 && path[0] != '/') @@ -523,14 +524,14 @@ shm_open(struct thread *td, struct shm_open_args *uap) return (error); } - fnv = fnv_32_str(path, FNV1_32_INIT); + hash = hash_sfh_buf(path, pathlen, pathlen); sx_xlock(&shm_dict_lock); - shmfd = shm_lookup(path, fnv); + shmfd = shm_lookup(path, hash); if (shmfd == NULL) { /* Object does not yet exist, create it if requested. */ if (uap->flags & O_CREAT) { shmfd = shm_alloc(td->td_ucred, cmode); - shm_insert(path, fnv, shmfd); + shm_insert(path, hash, shmfd); } else { free(path, M_SHMFD); error = ENOENT; @@ -597,19 +598,20 @@ int shm_unlink(struct thread *td, struct shm_unlink_args *uap) { char *path; - Fnv32_t fnv; + size_t pathlen; + uint32_t hash; int error; path = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); - error = copyinstr(uap->path, path, MAXPATHLEN, NULL); + error = copyinstr(uap->path, path, MAXPATHLEN, &pathlen); if (error) { free(path, M_TEMP); return (error); } - fnv = fnv_32_str(path, FNV1_32_INIT); + hash = hash_sfh_buf(path, pathlen, pathlen); sx_xlock(&shm_dict_lock); - error = shm_remove(path, fnv, td->td_ucred); + error = shm_remove(path, hash, td->td_ucred); sx_xunlock(&shm_dict_lock); free(path, M_TEMP); diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 30fb28b..61f87df 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include @@ -455,8 +455,8 @@ retry_wlocked: } } - hash = fnv_32_buf(cnp->cn_nameptr, cnp->cn_namelen, FNV1_32_INIT); - hash = fnv_32_buf(&dvp, sizeof(dvp), hash); + hash = hash_sfh_buf(cnp->cn_nameptr, cnp->cn_namelen, cnp->cn_namelen); + hash = hash_sfh_buf(&dvp, sizeof(dvp), hash); LIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { numchecks++; if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && @@ -691,9 +691,9 @@ cache_enter(dvp, vp, cnp) ncp->nc_dvp = dvp; ncp->nc_flag = flag; len = ncp->nc_nlen = cnp->cn_namelen; - hash = fnv_32_buf(cnp->cn_nameptr, len, FNV1_32_INIT); + hash = hash_sfh_buf(cnp->cn_nameptr, len, len); strlcpy(ncp->nc_name, cnp->cn_nameptr, len + 1); - hash = fnv_32_buf(&dvp, sizeof(dvp), hash); + hash = hash_sfh_buf(&dvp, sizeof(dvp), hash); CACHE_WLOCK(); /* diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c index 8911cee..a587c54 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include @@ -1414,19 +1414,19 @@ lagg_hashmbuf(struct mbuf *m, uint32_t key) goto out; eh = mtod(m, struct ether_header *); etype = ntohs(eh->ether_type); - p = hash32_buf(&eh->ether_shost, ETHER_ADDR_LEN, key); - p = hash32_buf(&eh->ether_dhost, ETHER_ADDR_LEN, p); + p = hash_sfh_buf(&eh->ether_shost, ETHER_ADDR_LEN, key); + p = hash_sfh_buf(&eh->ether_dhost, ETHER_ADDR_LEN, p); /* Special handling for encapsulating VLAN frames */ if (m->m_flags & M_VLANTAG) { - p = hash32_buf(&m->m_pkthdr.ether_vtag, + p = hash_sfh_buf(&m->m_pkthdr.ether_vtag, sizeof(m->m_pkthdr.ether_vtag), p); } else if (etype == ETHERTYPE_VLAN) { vlan = lagg_gethdr(m, off, sizeof(*vlan), &vlanbuf); if (vlan == NULL) goto out; - p = hash32_buf(&vlan->evl_tag, sizeof(vlan->evl_tag), p); + p = hash_sfh_buf(&vlan->evl_tag, sizeof(vlan->evl_tag), p); etype = ntohs(vlan->evl_proto); off += sizeof(*vlan) - sizeof(*eh); } @@ -1438,8 +1438,8 @@ lagg_hashmbuf(struct mbuf *m, uint32_t key) if (ip == NULL) goto out; - p = hash32_buf(&ip->ip_src, sizeof(struct in_addr), p); - p = hash32_buf(&ip->ip_dst, sizeof(struct in_addr), p); + p = hash_sfh_buf(&ip->ip_src, sizeof(struct in_addr), p); + p = hash_sfh_buf(&ip->ip_dst, sizeof(struct in_addr), p); break; #endif #ifdef INET6 @@ -1448,10 +1448,10 @@ lagg_hashmbuf(struct mbuf *m, uint32_t key) if (ip6 == NULL) goto out; - p = hash32_buf(&ip6->ip6_src, sizeof(struct in6_addr), p); - p = hash32_buf(&ip6->ip6_dst, sizeof(struct in6_addr), p); + p = hash_sfh_buf(&ip6->ip6_src, sizeof(struct in6_addr), p); + p = hash_sfh_buf(&ip6->ip6_dst, sizeof(struct in6_addr), p); flow = ip6->ip6_flow & IPV6_FLOWLABEL_MASK; - p = hash32_buf(&flow, sizeof(flow), p); /* IPv6 flow label */ + p = hash_sfh_buf(&flow, sizeof(flow), p); /* IPv6 flow label */ break; #endif } diff --git a/sys/netinet/in_var.h b/sys/netinet/in_var.h index cd1d904..a4fda4a 100644 --- a/sys/netinet/in_var.h +++ b/sys/netinet/in_var.h @@ -34,7 +34,7 @@ #define _NETINET_IN_VAR_H_ #include -#include +#include #include struct igmp_ifinfo; @@ -113,7 +113,7 @@ VNET_DECLARE(u_long, in_ifaddrhmask); /* mask for hash table */ #define INADDR_NHASH_LOG2 9 #define INADDR_NHASH (1 << INADDR_NHASH_LOG2) -#define INADDR_HASHVAL(x) fnv_32_buf((&(x)), sizeof(x), FNV1_32_INIT) +#define INADDR_HASHVAL(x) hash_sfh_buf((&(x)), sizeof(x), sizeof(x)) #define INADDR_HASH(x) \ (&V_in_ifaddrhashtbl[INADDR_HASHVAL(x) & V_in_ifaddrhmask]) diff --git a/sys/netinet/siftr.c b/sys/netinet/siftr.c index b5db118..6fca4ca 100644 --- a/sys/netinet/siftr.c +++ b/sys/netinet/siftr.c @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include @@ -353,7 +353,7 @@ siftr_process_pkt(struct pkt_node * pkt_node) sizeof(pkt_node->tcp_foreignport)); counter_list = counter_hash + - (hash32_buf(key, sizeof(key), 0) & siftr_hashmask); + (hash_sfh_buf(key, sizeof(key), sizeof(key)) & siftr_hashmask); /* * If the list is not empty i.e. the hash index has @@ -364,7 +364,7 @@ siftr_process_pkt(struct pkt_node * pkt_node) * Loop through the hash nodes in the list. * There should normally only be 1 hash node in the list, * except if there have been collisions at the hash index - * computed by hash32_buf(). + * computed by hash_sfh_buf(). */ LIST_FOREACH(hash_node, counter_list, nodes) { /* @@ -640,7 +640,7 @@ hash_pkt(struct mbuf *m, uint32_t offset) while (m != NULL) { /* Ensure there is data in the mbuf */ if ((m->m_len - offset) > 0) - hash = hash32_buf(m->m_data + offset, + hash = hash_sfh_buf(m->m_data + offset, m->m_len - offset, hash); m = m->m_next; diff --git a/sys/nfsclient/nfs_node.c b/sys/nfsclient/nfs_node.c index 5b43b3d..821dc2a 100644 --- a/sys/nfsclient/nfs_node.c +++ b/sys/nfsclient/nfs_node.c @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include @@ -113,7 +113,7 @@ nfs_nget(struct mount *mntp, nfsfh_t *fhp, int fhsize, struct nfsnode **npp, int nmp = VFSTONFS(mntp); *npp = NULL; - hash = fnv_32_buf(fhp->fh_bytes, fhsize, FNV1_32_INIT); + hash = hash_sfh_buf(fhp->fh_bytes, fhsize, fhsize); ncmp.fhsize = fhsize; ncmp.fh = fhp; diff --git a/sys/sys/hash_sfh.h b/sys/sys/hash_sfh.h new file mode 100644 index 0000000..bd6d687 --- /dev/null +++ b/sys/sys/hash_sfh.h @@ -0,0 +1,89 @@ +/*- + * Copyright (c) 2010, Paul Hsieh + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. My name, Paul Hsieh, and the names of any other contributors to + * the code use may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SYS_HASH_SFH_H_ +#define _SYS_HASH_SFH_H_ +#include + +static __inline uint32_t +hash_sfh_buf(const void *buf, size_t len, uint32_t hash) +{ + const uint8_t *data = buf; + uint32_t tmp; + int rem; + + if (len <= 0 || data == NULL) + return (0); + + rem = len & 3; + len >>= 2; + +#define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8) \ + +(uint32_t)(((const uint8_t *)(d))[0]) ) + + /* Main loop */ + for (;len > 0; len--) { + hash += get16bits(data); + tmp = (get16bits(data + 2) << 11) ^ hash; + hash = (hash << 16) ^ tmp; + data += 2 * sizeof(uint16_t); + hash += hash >> 11; + } + + /* Handle end cases */ + switch (rem) { + case 3: hash += get16bits(data); + hash ^= hash << 16; + hash ^= data[sizeof(uint16_t)] << 18; + hash += hash >> 11; + break; + case 2: hash += get16bits(data); + hash ^= hash << 11; + hash += hash >> 17; + break; + case 1: hash += *data; + hash ^= hash << 10; + hash += hash >> 1; + } +#undef get16bits + + /* Force "avalanching" of final 127 bits */ + hash ^= hash << 3; + hash += hash >> 5; + hash ^= hash << 4; + hash += hash >> 17; + hash ^= hash << 25; + hash += hash >> 6; + + return (hash); +} +#endif /* !_SYS_HASH_SFH_H_ */ diff --git a/sys/ufs/ufs/ufs_dirhash.c b/sys/ufs/ufs/ufs_dirhash.c index 9c89689..6cd8d0b 100644 --- a/sys/ufs/ufs/ufs_dirhash.c +++ b/sys/ufs/ufs/ufs_dirhash.c @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include @@ -1039,8 +1039,8 @@ ufsdirhash_hash(struct dirhash *dh, char *name, int namelen) * differing only in the last byte are placed close to one * another in the table, which is bad for linear probing. */ - hash = fnv_32_buf(name, namelen, FNV1_32_INIT); - hash = fnv_32_buf(&dh, sizeof(dh), hash); + hash = hash_sfh_buf(name, namelen, namelen); + hash = hash_sfh_buf(&dh, sizeof(dh), hash); return (hash % dh->dh_hlen); } --J/dobhs11T7y2rNN-- From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 24 02:02:06 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E934106564A; Fri, 24 Dec 2010 02:02:06 +0000 (UTC) (envelope-from artemb@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id A253E8FC0A; Fri, 24 Dec 2010 02:02:05 +0000 (UTC) Received: by wwf26 with SMTP id 26so6393040wwf.31 for ; Thu, 23 Dec 2010 18:02:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=11NvMn/qZnBOti0Hf4tzJDrLVvWCwrlpRMEJtad1gjA=; b=Jb/VSrrNJZXPq074PChuhZqjL4TEIAjsBKNUUuMV8VHmMa4KggyS7snHO4bANRcmQZ XqvzEk2uB4ES0oI2UAsXc+qjNSrcNkkCfLkwZN3vucHZQHBnu2rBbyJXxPdjC8UyJQTs KOYqfFykVVtwSKTIznPftrY+7I5BYCl43ipFs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=erYgItU+FnzneyGLBNEBEzacMXbB++qCDRK45fk+w3RBz0kyF5tAGz+LdvbOUapb9R Y3I+DGRLaD/GnETesgaoO0GQR7TPktB6z3+ZCGAleRyXgI2RmsjnZWu1ePJXLnFfJ7rr FlnNaOHta6sDUzVRXRyzgiLd3/qBRMAXluyDg= MIME-Version: 1.0 Received: by 10.227.69.195 with SMTP id a3mr5565040wbj.138.1293156124471; Thu, 23 Dec 2010 18:02:04 -0800 (PST) Sender: artemb@gmail.com Received: by 10.227.129.6 with HTTP; Thu, 23 Dec 2010 18:02:04 -0800 (PST) In-Reply-To: <4D1077AB.4010707@freebsd.org> References: <20101211215341.0000097c@unknown> <20101213103535.00005f3d@unknown> <4D061E00.7050606@freebsd.org> <4D0F3AD6.9080002@freebsd.org> <4D1077AB.4010707@freebsd.org> Date: Thu, 23 Dec 2010 18:02:04 -0800 X-Google-Sender-Auth: TiJgQBvhlh3eUxqrIFXfq33vay4 Message-ID: From: Artem Belevich To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, FreeBSD-Current Subject: Re: [dtrace] syscall provider naming convention. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Dec 2010 02:02:06 -0000 > I have one comment though. =A0I am not sure about renaming syscall.ko to > syscall_freebsd.ko. You mean systrace_freebsd.ko. I've renamed it for consistency with other systrace provider variants. I can change it back. > Perhaps we could keep the old name? =A0Or add a new module > under that name that would load native syscall module and all emulation s= yscall > modules (if any)? I'm not sure that creating an umbrella 'systrace' module is worth it. "kldload /boot/kernel/systrace*" should do that just fine. The reason dtrace exists is that there are number of modules with dtrace providers that are not easily distinguishable by their name. --Artem From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 24 08:45:09 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97E84106567A for ; Fri, 24 Dec 2010 08:45:09 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from mail-ew0-f54.google.com (mail-ew0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 324E38FC15 for ; Fri, 24 Dec 2010 08:45:07 +0000 (UTC) Received: by ewy24 with SMTP id 24so3642222ewy.13 for ; Fri, 24 Dec 2010 00:45:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=ZALWCMiq4WOLL926U9gevj4qQfHRhjcYy9mmSvWEgNc=; b=LkXuRCHtkIVKMM634nkk+tU936XdyaKq+/CYHVziMYfQbC9DWDWMwnjQ7qx+inF/oS zoZN7fpOwco5ZZiU3aaY/eETo6Fsz6u8VEystm+FKsPyfOaAkGvwKi3dc7C4sL/jEzHN cvXuAPrSN+K34Dnupif/GuUH9uXc88c5QgAAM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=u26A3G8M6G/keVN+E1beqyaWZhK+7oXOOQp/2WZIqYxQjawI6cSERl3rDyOCZnNjwW eMty0hyjHxzTOlSahxWHiYmKnqkizItTMANIZdY5k+tgBkGwSW39rzNXlOoB5tJcGT0B H6TzZlTmIV3I9JRe5stM6PH2oY77BJmE324k0= Received: by 10.14.119.129 with SMTP id n1mr5532055eeh.13.1293180306532; Fri, 24 Dec 2010 00:45:06 -0800 (PST) Received: from localhost ([212.98.186.134]) by mx.google.com with ESMTPS id t50sm6268017eeh.12.2010.12.24.00.45.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 24 Dec 2010 00:45:05 -0800 (PST) Date: Fri, 24 Dec 2010 10:44:37 +0200 From: Gleb Kurtsou To: freebsd-hackers@freebsd.org Message-ID: <20101224084437.GA11619@tops> References: <20101223224619.GA21984@tops> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="GvXjxJ+pjyke8COw" Content-Disposition: inline In-Reply-To: <20101223224619.GA21984@tops> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [rfc] Replacing FNV and hash32 with Paul Hsieh's SuperFastHash X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Dec 2010 08:45:09 -0000 --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=utf-8 Content-Disposition: inline On (24/12/2010 00:46), Gleb Kurtsou wrote: > Hi, > > I've recently noticed that hash table use in nullfs was inefficient, 1/3 > to half of buckets remained unused. I've started investigating it Nullfs patch I've forgotten to attach before. It adds vfs.nullfs.buckets tunable to change number of hash table buckets, vfs.nullfs.nodes sysctl to get number of active vnodes, and increases default number of buckets from 16 to 32. Note that nullfs nodes - are currently opened vnodes, so number is so low, one may want to further increase it only if nullfs is heavily used (lots of null mounts and active clients). The patch requires SFH, but might be useful without it if null_hash_mixptr() changed accordingly. > further and came across SuperFastHash hashing function, SFH > (SuperFastHash) has BSD license, used in WebKit and other open source > projects. Detailed description and Comparision with FNV and Bob Jenkin's > hash can be found here: > http://www.azillionmonkeys.com/qed/hash.html > > In my tests SFH (SuperFastHash) was 1.3 to 4 times faster than FNV (it > depends on size of data being hashed) e.g. performance of hashing 56 > bytes struct (Core i5 CPU, 2 cores + 2 hyperthreads): > SFH -- 1339.79 MB/s > FNV -- 330.27 MB/s > > I've prepared a patch to change FNV and hash32 with SFH in the tree. > > For testing I've used dbench with 16 processes on 1 Gb swap back md > device, UFS + SoftUpdates: > Old hash (Mb/s): 599.94 600.096 599.536 > SFH hash (Mb/s): 612.439 612.341 609.673 > > It's just ~1% improvement, but dbench is not a VFS metadata intensive > benchmark. Subjectively it feels faster accessing maildir mailboxes > with ~10.000 messages : ) > > I'd also wish hash32 (often called Bernstein hash) to be replaced with > better function (it might be FNV if not SFH). Hash32 is inappropriate > for binary data that results in poor distribution. > > Thanks, > Gleb. --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="nullfs-sfh.patch.txt" commit dd778e797cbfd821fc43ff74a8d5681ed2b93da1 Author: Gleb Kurtsou Date: Thu Dec 16 08:13:58 2010 +0200 nullfs: Use SFH. Add sysctls to control hash table size Add vfs.nullfs sysctls and tunable to change number hash table buckets Increase default number of buckets to 32 (was 16) diff --git a/sys/fs/nullfs/null_subr.c b/sys/fs/nullfs/null_subr.c index 5717a01..2acd85b 100644 --- a/sys/fs/nullfs/null_subr.c +++ b/sys/fs/nullfs/null_subr.c @@ -36,18 +36,21 @@ #include #include +#include #include #include #include #include #include #include +#include #include #include -#define LOG2_SIZEVNODE 8 /* log2(sizeof struct vnode) */ -#define NNULLNODECACHE 16 +#define NULL_BUCKETS_MIN 16 +#define NULL_BUCKETS_DEFAULT 32 +#define NULL_BUCKETS_TUNABLE "vfs.nullfs.buckets" /* * Null layer cache: @@ -58,7 +61,7 @@ */ #define NULL_NHASH(vp) \ - (&null_node_hashtbl[(((uintptr_t)vp)>>LOG2_SIZEVNODE) & null_node_hash]) + (&null_node_hashtbl[null_hash_mixptr(vp) & null_node_hash]) static LIST_HEAD(null_node_hashhead, null_node) *null_node_hashtbl; static u_long null_node_hash; @@ -70,6 +73,15 @@ MALLOC_DEFINE(M_NULLFSNODE, "nullfs_node", "NULLFS vnode private part"); static struct vnode * null_hashget(struct mount *, struct vnode *); static struct vnode * null_hashins(struct mount *, struct null_node *); +static u_long null_nodes; +static u_long null_buckets = NULL_BUCKETS_DEFAULT; + +SYSCTL_NODE(_vfs, OID_AUTO, nullfs, CTLFLAG_RW, 0, "null file system"); +SYSCTL_ULONG(_vfs_nullfs, OID_AUTO, nodes, CTLFLAG_RD, &null_nodes, 0, + "Allocated nodes"); +SYSCTL_ULONG(_vfs_nullfs, OID_AUTO, buckets, CTLFLAG_RD, &null_buckets, 0, + "Allocated node hash table buckets"); + /* * Initialise cache headers */ @@ -77,10 +89,15 @@ int nullfs_init(vfsp) struct vfsconf *vfsp; { - NULLFSDEBUG("nullfs_init\n"); /* printed during system boot */ - null_node_hashtbl = hashinit(NNULLNODECACHE, M_NULLFSHASH, &null_node_hash); + TUNABLE_ULONG_FETCH(NULL_BUCKETS_TUNABLE, &null_buckets); + if (null_buckets < NULL_BUCKETS_MIN) + null_buckets = NULL_BUCKETS_MIN; + else if (null_buckets > desiredvnodes) + null_buckets = NULL_BUCKETS_DEFAULT; + null_node_hashtbl = hashinit(null_buckets, M_NULLFSHASH, &null_node_hash); mtx_init(&null_hashmtx, "nullhs", NULL, MTX_DEF); + null_nodes = 0; return (0); } @@ -94,6 +111,12 @@ nullfs_uninit(vfsp) return (0); } +static __inline uint32_t +null_hash_mixptr(void *ptr) +{ + return (hash_sfh_buf(&ptr, sizeof(ptr), 33554467UL)); +} + /* * Return a VREF'ed alias for lower vnode if already exists, else 0. * Lower vnode should be locked on entry and will be left locked on exit. @@ -164,6 +187,7 @@ null_hashins(mp, xp) } } LIST_INSERT_HEAD(hd, xp, null_hash); + null_nodes++; mtx_unlock(&null_hashmtx); return (NULLVP); } @@ -264,6 +288,7 @@ null_hashrem(xp) mtx_lock(&null_hashmtx); LIST_REMOVE(xp, null_hash); + null_nodes--; mtx_unlock(&null_hashmtx); } --GvXjxJ+pjyke8COw-- From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 24 15:18:57 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6034106564A for ; Fri, 24 Dec 2010 15:18:57 +0000 (UTC) (envelope-from hedayati.mo@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 718E98FC13 for ; Fri, 24 Dec 2010 15:18:57 +0000 (UTC) Received: by wyf19 with SMTP id 19so6974189wyf.13 for ; Fri, 24 Dec 2010 07:18:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:content-type; bh=VoB3Pv1UP1Or44ZgUTd0W1bSf5MeJ7vNLFl0YEvHvrY=; b=Ds92DXD2YsPTgv5DzEuvThDf6DFwRuK4bgdEncC7B8aHrFMI7HDmWqewccd2TVgwdd RhbZME52ToMZvY6BkfCMGflRHDcSBMEwxL0Hb8+HhkhOtoChTYy8pGaNE8jSO1uMKEJq LOvK4wyVNGE1RRDepFtfil5u4uzTbsi+JFxUA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=QjmLU4yTr8BYOPr4Og464oz9c2zuKwubCcpSpK/lSJ8ecNmeKNBlVM6dI3q5k3sVn5 qslRGwTvK7OEq16uaCSL0hNeOjkymx7SeVPVWmBuWz1INScK+wlwTcenM9Ie3zkH7jd8 41AMgvhmwK7zzXQJvbg9i4v8G1B2On99lGr6M= Received: by 10.227.159.68 with SMTP id i4mr5816620wbx.176.1293202078996; Fri, 24 Dec 2010 06:47:58 -0800 (PST) MIME-Version: 1.0 Received: by 10.227.143.202 with HTTP; Fri, 24 Dec 2010 06:47:18 -0800 (PST) From: Mohammad Hedayati Date: Fri, 24 Dec 2010 18:17:18 +0330 Message-ID: To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Mailman-Approved-At: Fri, 24 Dec 2010 15:30:07 +0000 Subject: Inappropriate ioctl for device X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Dec 2010 15:18:57 -0000 I'm writing a simple char device. So far everything went so good (read/write), but here I'm going to add support for ioctl. int ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *td) { int error = 0; uprintf("Here...\n"); return(error); } and I'm calling it here: len = ioctl(cd, 0); perror("ioctl"); but when runnig it says: ioctl: Inappropriate ioctl for device From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 24 16:01:49 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D818A1065744 for ; Fri, 24 Dec 2010 16:01:49 +0000 (UTC) (envelope-from gljennjohn@googlemail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5E95C8FC0A for ; Fri, 24 Dec 2010 16:01:49 +0000 (UTC) Received: by bwz12 with SMTP id 12so1187017bwz.13 for ; Fri, 24 Dec 2010 08:01:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:reply-to:x-mailer:mime-version :content-type:content-transfer-encoding; bh=Ua3aeTnIZn6REExsjCxI5h1at13ksWvzuievOzh2bh8=; b=VZW2O+OP35XFe460MZCrQEXzVxSZbjh0VUhii8h3rBV//h3vwUD1cffR8YiBi38F6y vueN8H8ennH/GgjogVQSjvKU/8QEmt5tm15z71vwep3bOk9DWvC3zN2x5bRrqM0gNHUQ 1AiVr/iW592oFfyQ6hLQztosVGEj0rhV/bgoo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :x-mailer:mime-version:content-type:content-transfer-encoding; b=SMnw0rmgdLhY0rOOnoRC5fdtZTh9M9mMTnRp0JfrcgKbjwErCzhvL6Riv6ovEGPhEu Y1ZwtiIBRhzLjcM9OM7OWG9CSYu4MX41J0WXGXv9t0vQ57gG6U/nf0LM55NDoLnIyRbe 0H6IYjff3edEQvscsNsZrK0NB9GeBaFsH7FRA= Received: by 10.204.80.70 with SMTP id s6mr3434802bkk.142.1293206508193; Fri, 24 Dec 2010 08:01:48 -0800 (PST) Received: from ernst.jennejohn.org (p578E395D.dip.t-dialin.net [87.142.57.93]) by mx.google.com with ESMTPS id f20sm3749114bkf.4.2010.12.24.08.01.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 24 Dec 2010 08:01:47 -0800 (PST) Date: Fri, 24 Dec 2010 17:01:44 +0100 From: Gary Jennejohn To: Mohammad Hedayati Message-ID: <20101224170144.1d734e3c@ernst.jennejohn.org> In-Reply-To: References: X-Mailer: Claws Mail 3.7.8 (GTK+ 2.18.7; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Inappropriate ioctl for device X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gljennjohn@googlemail.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Dec 2010 16:01:49 -0000 On Fri, 24 Dec 2010 18:17:18 +0330 Mohammad Hedayati wrote: > I'm writing a simple char device. So far everything went so good > (read/write), but here I'm going to add support for ioctl. > > int > ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *td) > { > int error = 0; > uprintf("Here...\n"); > return(error); > } > and I'm calling it here: > > len = ioctl(cd, 0); > perror("ioctl"); > > but when runnig it says: > > ioctl: Inappropriate ioctl for device Carefully read ioctl(2) and consider that you're passing in 0 as the cmd. If you still don't understand your error, post again. Hint: look at /sys/kern/sys_generic.c:^ioctl -- Gary Jennejohn From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 24 16:08:19 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 137FB1065673 for ; Fri, 24 Dec 2010 16:08:19 +0000 (UTC) (envelope-from hedayati.mo@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 9C8F18FC14 for ; Fri, 24 Dec 2010 16:08:18 +0000 (UTC) Received: by wwf26 with SMTP id 26so6862349wwf.31 for ; Fri, 24 Dec 2010 08:08:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=5ru7VlJ6nfIkEHwZ3KASl6m168CD1inKc9U6XhnVCao=; b=FAngF63P8PqjWWdHCQ2s0/73n4tNgMMnuamyoagyj3SqQvBslgbR3aIkHou/Hf9311 AaZWPHQWlmUtERATLvoQH0wn00RwIfbOPOC3lCumrOeb3EVD7pFQpr9Y0guWZkGwClmx 0PhynL+0UCXhcQWEAqeB3g1F94qzSkFtE3KHU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=mL8iQfkgNtsmXIWCoWWWDzg2IuPbK76MC1VIHF2pSDn2tEvEW4WuwAMkgSaYb5HCcC UhmqsKRedPb5SoCstSbqW3JpbcmHHHcThpLGyAxKTwzUG4/gTcgNhP3WAU37Cw4vSahu pV+0XXKwAkaQB0ll9w6gE61Jb8XbcCR8y9yZQ= Received: by 10.227.146.145 with SMTP id h17mr5811747wbv.60.1293206897507; Fri, 24 Dec 2010 08:08:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.227.143.202 with HTTP; Fri, 24 Dec 2010 08:07:37 -0800 (PST) In-Reply-To: <20101224170144.1d734e3c@ernst.jennejohn.org> References: <20101224170144.1d734e3c@ernst.jennejohn.org> From: Mohammad Hedayati Date: Fri, 24 Dec 2010 19:37:37 +0330 Message-ID: To: freebsd-hackers@freebsd.org X-Mailman-Approved-At: Fri, 24 Dec 2010 17:08:17 +0000 Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: Inappropriate ioctl for device X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Dec 2010 16:08:19 -0000 On Fri, Dec 24, 2010 at 7:31 PM, Gary Jennejohn wrote: > On Fri, 24 Dec 2010 18:17:18 +0330 > Mohammad Hedayati wrote: > > > I'm writing a simple char device. So far everything went so good > > (read/write), but here I'm going to add support for ioctl. > > > > int > > ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct > thread *td) > > { > > int error = 0; > > uprintf("Here...\n"); > > return(error); > > } > > and I'm calling it here: > > > > len = ioctl(cd, 0); > > perror("ioctl"); > > > > but when runnig it says: > > > > ioctl: Inappropriate ioctl for device > > Carefully read ioctl(2) and consider that you're passing in 0 as the cmd. > If you still don't understand your error, post again. > > Hint: look at /sys/kern/sys_generic.c:^ioctl > > -- > Gary Jennejohn > It was a misspelling, I'm doing as bellow, if you mean the u_long. unsinged long cmd = 0; len = ioctl(cd, cmd); From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 24 17:44:04 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B14CA106566B for ; Fri, 24 Dec 2010 17:44:04 +0000 (UTC) (envelope-from gljennjohn@googlemail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3597E8FC14 for ; Fri, 24 Dec 2010 17:44:03 +0000 (UTC) Received: by bwz12 with SMTP id 12so1236495bwz.13 for ; Fri, 24 Dec 2010 09:44:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:reply-to:x-mailer:mime-version :content-type:content-transfer-encoding; bh=hGMNWtBqxNhnGbvoguS1uE1BZbzK9noHfm5bDmtyxnc=; b=ay5ivu+S3AXqLTMRJ7ipOI8EMq9O2Gc6R7VDe+VS3kwWFjdizRujghbOyaqby9EdSf WKSYE0odI5J3bFLspPg7Ij472qdj37ey4tzjgkPcOrfIHYeBFwjuY52iFvD1BFTLWDQA 9N/iRvnDug0MwAHhk2YJTKkzcLFTQxHyQyDk8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :x-mailer:mime-version:content-type:content-transfer-encoding; b=gGFwXTNxyLh3h+YHJ1o3wZ5R9kZHFW6TZwAcDiQ9FUOfLt5uf+17cUw/7of8KNNNTy gxkKXvvnAe6eVh/naftY1AQabO5Ur3hn7+whPKAEyXVlpirTyBwFtCPkkcvIWj+nV4Ks dIAAoGT6pCofbrdPPPuVAB81RLQZDggPM5EeA= Received: by 10.204.50.200 with SMTP id a8mr981493bkg.209.1293212642650; Fri, 24 Dec 2010 09:44:02 -0800 (PST) Received: from ernst.jennejohn.org (p578E395D.dip.t-dialin.net [87.142.57.93]) by mx.google.com with ESMTPS id q18sm6323795bka.15.2010.12.24.09.44.00 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 24 Dec 2010 09:44:01 -0800 (PST) Date: Fri, 24 Dec 2010 18:43:57 +0100 From: Gary Jennejohn To: freebsd-hackers@freebsd.org Message-ID: <20101224184357.1e8f03bb@ernst.jennejohn.org> In-Reply-To: References: <20101224170144.1d734e3c@ernst.jennejohn.org> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.18.7; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Mohammad Hedayati Subject: Re: Inappropriate ioctl for device X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gljennjohn@googlemail.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Dec 2010 17:44:04 -0000 On Fri, 24 Dec 2010 19:37:37 +0330 Mohammad Hedayati wrote: > On Fri, Dec 24, 2010 at 7:31 PM, Gary Jennejohn > wrote: > > > On Fri, 24 Dec 2010 18:17:18 +0330 > > Mohammad Hedayati wrote: > > > > > I'm writing a simple char device. So far everything went so good > > > (read/write), but here I'm going to add support for ioctl. > > > > > > int > > > ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct > > thread *td) > > > { > > > int error = 0; > > > uprintf("Here...\n"); > > > return(error); > > > } > > > and I'm calling it here: > > > > > > len = ioctl(cd, 0); > > > perror("ioctl"); > > > > > > but when runnig it says: > > > > > > ioctl: Inappropriate ioctl for device > > > > Carefully read ioctl(2) and consider that you're passing in 0 as the cmd. > > If you still don't understand your error, post again. > > > > Hint: look at /sys/kern/sys_generic.c:^ioctl > > > > -- > > Gary Jennejohn > > > > It was a misspelling, I'm doing as bellow, if you mean the u_long. > > unsinged long cmd = 0; > len = ioctl(cd, cmd); > No, that isn't what I meant. Read the kernel code - cmd = 0 is not legal. -- Gary Jennejohn From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 24 16:17:39 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D132106566C for ; Fri, 24 Dec 2010 16:17:39 +0000 (UTC) (envelope-from hedayati.mo@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id E440F8FC13 for ; Fri, 24 Dec 2010 16:17:38 +0000 (UTC) Received: by wwf26 with SMTP id 26so6868440wwf.31 for ; Fri, 24 Dec 2010 08:17:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=t/D3E5kQPn93J7QqdfXDbPcEwCst154lOljUt61NFyY=; b=KBSb+n6yjzVLz0zHnqDO4T/au+wutokkV9GxDkrxu8tGXDu1CokD81K55jbR1FPJq8 syrOgAxDsgqK/z4O/T1P8ppN/RTduigt4yxi9VKMymTTCegCEZnbXXLNookZZ8KCSEPe GoraikrU146sQnEIyeOGQJb5pTvTt2SFEYVG0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=tsJ8hU66xui5pZ20h0ohX5LfykHZQ1puy8n04M8DPHPHCv7VewnG/DUCtLf6W8rq9q xjiUb2xcUwhao89sT09ZP9RSWa461neGgo+mmUFxiiPhR/rQr/LgXcCaRPUin3hHgHZa W5MUeJ9egWRIJht7XOf+EO9O0Vclp/ROhkQKw= Received: by 10.227.176.134 with SMTP id be6mr5806639wbb.147.1293207457867; Fri, 24 Dec 2010 08:17:37 -0800 (PST) MIME-Version: 1.0 Received: by 10.227.143.202 with HTTP; Fri, 24 Dec 2010 08:16:56 -0800 (PST) In-Reply-To: References: <20101224170144.1d734e3c@ernst.jennejohn.org> From: Mohammad Hedayati Date: Fri, 24 Dec 2010 19:46:56 +0330 Message-ID: To: freebsd-hackers@freebsd.org X-Mailman-Approved-At: Fri, 24 Dec 2010 18:48:23 +0000 Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: Inappropriate ioctl for device X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Dec 2010 16:17:39 -0000 On Fri, Dec 24, 2010 at 7:37 PM, Mohammad Hedayati wrote: > > > On Fri, Dec 24, 2010 at 7:31 PM, Gary Jennejohn > wrote: > >> On Fri, 24 Dec 2010 18:17:18 +0330 >> Mohammad Hedayati wrote: >> >> > I'm writing a simple char device. So far everything went so good >> > (read/write), but here I'm going to add support for ioctl. >> > >> > int >> > ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct >> thread *td) >> > { >> > int error = 0; >> > uprintf("Here...\n"); >> > return(error); >> > } >> > and I'm calling it here: >> > >> > len = ioctl(cd, 0); >> > perror("ioctl"); >> > >> > but when runnig it says: >> > >> > ioctl: Inappropriate ioctl for device >> >> Carefully read ioctl(2) and consider that you're passing in 0 as the cmd. >> If you still don't understand your error, post again. >> >> Hint: look at /sys/kern/sys_generic.c:^ioctl >> >> -- >> Gary Jennejohn >> > > It was a misspelling, I'm doing as bellow, if you mean the u_long. > > unsinged long cmd = 0; > len = ioctl(cd, cmd); > > Thanks, Problem is solved! From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 24 20:00:16 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 000CC106566B; Fri, 24 Dec 2010 20:00:15 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id E98D58FC12; Fri, 24 Dec 2010 20:00:14 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id WAA16252; Fri, 24 Dec 2010 22:00:10 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1PWDo9-0007MM-VE; Fri, 24 Dec 2010 22:00:09 +0200 Message-ID: <4D14FBC8.9060304@freebsd.org> Date: Fri, 24 Dec 2010 22:00:08 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101211 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: Artem Belevich References: <20101211215341.0000097c@unknown> <20101213103535.00005f3d@unknown> <4D061E00.7050606@freebsd.org> <4D0F3AD6.9080002@freebsd.org> <4D1077AB.4010707@freebsd.org> In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, FreeBSD-Current Subject: Re: [dtrace] syscall provider naming convention. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Dec 2010 20:00:16 -0000 on 24/12/2010 04:02 Artem Belevich said the following: >> I have one comment though. I am not sure about renaming syscall.ko to >> syscall_freebsd.ko. > > You mean systrace_freebsd.ko. Yes, thanks. > I've renamed it for consistency with other systrace provider variants. > I can change it back. I think that I would prefer this. If only for POLA reasons. >> Perhaps we could keep the old name? Or add a new module >> under that name that would load native syscall module and all emulation syscall >> modules (if any)? > > I'm not sure that creating an umbrella 'systrace' module is worth it. > "kldload /boot/kernel/systrace*" should do that just fine. The reason > dtrace exists is that there are number of modules with dtrace > providers that are not easily distinguishable by their name. I agree. I am going on vacation and I don't want to risk, so it looks like I will be able to commit your patch after the holidays. Unless someone else beats me to it. -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Sat Dec 25 07:12:30 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 642151065693; Sat, 25 Dec 2010 07:12:30 +0000 (UTC) (envelope-from artemb@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 934FD8FC12; Sat, 25 Dec 2010 07:12:29 +0000 (UTC) Received: by wyf19 with SMTP id 19so7317803wyf.13 for ; Fri, 24 Dec 2010 23:12:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=JfKxe4pS2pVoVnIrWFTMkaocnvqjwkDJcwzDX9Jwosw=; b=F2svTkuF0MjbkQTvsOtgkVZp+kLP2ICOFAIG31PpOzOy0yqoCzLR4Z3wNDsw/UXsvN VRiPA4RLLKZhpOroxVyU/V9uCP3UVE/9CInbUyBK9Kz3ka7qa9M8PiuAoZUiI3frzq4L mXeewGQFpvnhb8cL41TBVWbk8ZCmB8pUA7TDI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=YnGAM6poQ7Sda9ffYUumA5+ofUOuK8vytjs9FbyR/hbXbRH2MVF1GNQy/PPk29cZiE oMesmRI933KfhysQOtvlAsMGcb5wrzGENtv5tuzMMF1bHRbp3eIPSR6IIU9dXjF8Ufg1 TSX6jbeKuhMoBrUY7Isw0YwsSXb6TRGMfwIDI= MIME-Version: 1.0 Received: by 10.227.134.2 with SMTP id h2mr6314101wbt.22.1293261148345; Fri, 24 Dec 2010 23:12:28 -0800 (PST) Sender: artemb@gmail.com Received: by 10.227.129.6 with HTTP; Fri, 24 Dec 2010 23:12:28 -0800 (PST) In-Reply-To: <4D14FBC8.9060304@freebsd.org> References: <20101211215341.0000097c@unknown> <20101213103535.00005f3d@unknown> <4D061E00.7050606@freebsd.org> <4D0F3AD6.9080002@freebsd.org> <4D1077AB.4010707@freebsd.org> <4D14FBC8.9060304@freebsd.org> Date: Fri, 24 Dec 2010 23:12:28 -0800 X-Google-Sender-Auth: JFTZ8Dk3zZBk0aaX_CNGSWPqqjg Message-ID: From: Artem Belevich To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, FreeBSD-Current Subject: Re: [dtrace] syscall provider naming convention. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Dec 2010 07:12:30 -0000 >>> I have one comment though. =A0I am not sure about renaming syscall.ko t= o >>> syscall_freebsd.ko. >> I've renamed it for consistency with other systrace provider variants. >> I can change it back. > > I think that I would prefer this. > If only for POLA reasons. Done. New patch is here: https://sites.google.com/site/abc678site/files/dt-systrace-20101224.patch.g= z By the way, the patch contains several files generated by "make sysent". If the patch is applied to sources other than stable/8@216436, then "make sysent" should be re-done in amd64/linux32, i386/linux and compat/freebsd32. --Artem From owner-freebsd-hackers@FreeBSD.ORG Sat Dec 25 19:29:47 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84E26106564A for ; Sat, 25 Dec 2010 19:29:47 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 3C9EE8FC08 for ; Sat, 25 Dec 2010 19:29:47 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PWZoG-0006Vg-KJ for freebsd-hackers@freebsd.org; Sat, 25 Dec 2010 20:29:44 +0100 Received: from 109.227.31.204 ([109.227.31.204]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 25 Dec 2010 20:29:44 +0100 Received: from ivoras by 109.227.31.204 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 25 Dec 2010 20:29:44 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Ivan Voras Date: Sat, 25 Dec 2010 20:29:33 +0100 Lines: 13 Message-ID: References: <20101223224619.GA21984@tops> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 109.227.31.204 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7 In-Reply-To: <20101223224619.GA21984@tops> Subject: Re: [rfc] Replacing FNV and hash32 with Paul Hsieh's SuperFastHash X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Dec 2010 19:29:47 -0000 On 23.12.2010 23:46, Gleb Kurtsou wrote: > For testing I've used dbench with 16 processes on 1 Gb swap back md > device, UFS + SoftUpdates: > Old hash (Mb/s): 599.94 600.096 599.536 > SFH hash (Mb/s): 612.439 612.341 609.673 > > It's just ~1% improvement, but dbench is not a VFS metadata intensive > benchmark. Subjectively it feels faster accessing maildir mailboxes > with ~10.000 messages : ) Try blogbench if you need metadata-intensive operations, or even fsx. From owner-freebsd-hackers@FreeBSD.ORG Sat Dec 25 20:35:13 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBB36106566B for ; Sat, 25 Dec 2010 20:35:13 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id 61A8A8FC0C for ; Sat, 25 Dec 2010 20:35:13 +0000 (UTC) Received: by mx1.stack.nl (Postfix, from userid 65534) id B21C21DDAA2; Sat, 25 Dec 2010 21:35:10 +0100 (CET) X-Spam-DCC: : scanner01.stack.nl 1282; Body=1 Fuz1=1 Fuz2=1 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on scanner01.stack.nl X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00, DNS_FROM_OPENWHOIS,NO_RELAYS autolearn=no version=3.2.5 X-Spam-Relay-Country: _RELAYCOUNTRY_ Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 623721DD40C for ; Sat, 25 Dec 2010 21:35:08 +0100 (CET) Received: by turtle.stack.nl (Postfix, from userid 1677) id 4494217104; Sat, 25 Dec 2010 21:34:08 +0100 (CET) Date: Sat, 25 Dec 2010 21:34:08 +0100 From: Jilles Tjoelker To: freebsd-hackers@freebsd.org Message-ID: <20101225203408.GA52505@stack.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="M9NhX3UHpAaciwkO" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Removing PATH=...%builtin... from sh X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Dec 2010 20:35:13 -0000 --M9NhX3UHpAaciwkO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Most ash derivatives have an undocumented feature where the presence of an entry "%builtin" in $PATH will cause builtins to be checked at that point of the PATH search, rather than before looking at any directories as documented in the man page (very old versions do document this feature). I would like to remove this feature from sh, as it complicates the code, may violate expectations (for example, /usr/bin/alias is very close to a forkbomb with PATH=/usr/bin:%builtin, only /usr/bin/builtin not being another link saves it) and appears to be unused (all the %builtin google code search finds is in some sort of ash source code). The feature also has a bug in that it does not work properly if there is a PATH assignment before 'type', 'command -v' or 'command -V' and %builtin differs between the set and temporary paths. (This worked in 8.x for 'command'; 'type' ignores PATH assignment in 8.x.) It is true that dash ignores %builtin for the special builtins and the "regular builtins" that are found before PATH, using it only for the other builtins. I could do the same but I think it is not useful enough. See also http://lists.freebsd.org/pipermail/svn-src-head/2010-November/022613.html Which builtins this is about: POSIX special builtins: : . break continue eval exec exit export readonly return set shift times trap unset POSIX commands found before PATH (regular builtins): alias bg cd command false fc fg getopts jobs kill pwd read true umask unalias wait Other POSIX utilities that must be builtins: hash type ulimit Other POSIX utilities: [ echo printf test Non-POSIX utilities that must be builtins: builtin bind chdir jobid local setvar Undocumented builtins: exp let wordexp And for completeness one command that should really be a builtin or otherwise magic: Missing POSIX commands found before PATH (regular builtins): newgrp -- Jilles Tjoelker --M9NhX3UHpAaciwkO Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="sh-builtin-always-first.patch" Index: bin/sh/exec.c =================================================================== --- bin/sh/exec.c (revision 216690) +++ bin/sh/exec.c (working copy) @@ -92,7 +92,6 @@ static struct tblentry *cmdtable[CMDTABLESIZE]; -static int builtinloc = -1; /* index in path of %builtin, or -1 */ int exerrno = 0; /* Last exec error */ @@ -245,8 +244,7 @@ } while ((name = *argptr) != NULL) { if ((cmdp = cmdlookup(name, 0)) != NULL - && (cmdp->cmdtype == CMDNORMAL - || (cmdp->cmdtype == CMDBUILTIN && builtinloc >= 0))) + && cmdp->cmdtype == CMDNORMAL) delete_cmd_entry(); find_command(name, &entry, DO_ERR, pathval()); if (verbose) { @@ -337,8 +335,8 @@ goto success; } - /* If %builtin not in path, check for builtin next */ - if (builtinloc < 0 && (i = find_builtin(name, &spec)) >= 0) { + /* Check for builtin next */ + if ((i = find_builtin(name, &spec)) >= 0) { INTOFF; cmdp = cmdlookup(name, 1); if (cmdp->cmdtype == CMDFUNCTION) @@ -354,7 +352,7 @@ prev = -1; /* where to start */ if (cmdp) { /* doing a rehash */ if (cmdp->cmdtype == CMDBUILTIN) - prev = builtinloc; + prev = -1; else prev = cmdp->param.index; } @@ -366,19 +364,7 @@ stunalloc(fullname); idx++; if (pathopt) { - if (prefix("builtin", pathopt)) { - if ((i = find_builtin(name, &spec)) < 0) - goto loop; - INTOFF; - cmdp = cmdlookup(name, 1); - if (cmdp->cmdtype == CMDFUNCTION) - cmdp = &loc_cmd; - cmdp->cmdtype = CMDBUILTIN; - cmdp->param.index = i; - cmdp->special = spec; - INTON; - goto success; - } else if (prefix("func", pathopt)) { + if (prefix("func", pathopt)) { /* handled below */ } else { goto loop; /* ignore unimplemented options */ @@ -485,8 +471,7 @@ for (pp = cmdtable ; pp < &cmdtable[CMDTABLESIZE] ; pp++) { for (cmdp = *pp ; cmdp ; cmdp = cmdp->next) { - if (cmdp->cmdtype == CMDNORMAL - || (cmdp->cmdtype == CMDBUILTIN && builtinloc >= 0)) + if (cmdp->cmdtype == CMDNORMAL) cmdp->rehash = 1; } } @@ -506,13 +491,11 @@ const char *old, *new; int idx; int firstchange; - int bltin; old = pathval(); new = newval; firstchange = 9999; /* assume no change */ idx = 0; - bltin = -1; for (;;) { if (*old != *new) { firstchange = idx; @@ -523,19 +506,12 @@ } if (*new == '\0') break; - if (*new == '%' && bltin < 0 && prefix("builtin", new + 1)) - bltin = idx; if (*new == ':') { idx++; } new++, old++; } - if (builtinloc < 0 && bltin >= 0) - builtinloc = bltin; /* zap builtins */ - if (builtinloc >= 0 && bltin < 0) - firstchange = 0; clearcmdentry(firstchange); - builtinloc = bltin; } @@ -556,9 +532,7 @@ pp = tblp; while ((cmdp = *pp) != NULL) { if ((cmdp->cmdtype == CMDNORMAL && - cmdp->param.index >= firstchange) - || (cmdp->cmdtype == CMDBUILTIN && - builtinloc >= firstchange)) { + cmdp->param.index >= firstchange)) { *pp = cmdp->next; ckfree(cmdp); } else { --M9NhX3UHpAaciwkO--