From owner-freebsd-arch@FreeBSD.ORG Sun Oct 30 00:27:16 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E66C1065672 for ; Sun, 30 Oct 2011 00:27:16 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 1BAD98FC0A for ; Sun, 30 Oct 2011 00:27:15 +0000 (UTC) Received: by vws11 with SMTP id 11so6563419vws.13 for ; Sat, 29 Oct 2011 17:27:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=WHIUtkp7H6zi/GDHdUN/287LhnU0M7IICfPtRogOjtk=; b=uqMUx2CIXEFYhU+Ysp+/hf6lMNyk9ovFft0zsPsVBOe9MmbVAxitDxeOEvNdkz9gNm 6ZoItSmyZM8odZJ3aGzcvD2TVHd81wHNGeo3AMuNr7xNI2/Aq7K/kCdx+7Lz1blOLm4d RuYtqYXjLVUDOSyinA8Wf1Ie25b6FcCC87W04= MIME-Version: 1.0 Received: by 10.52.34.100 with SMTP id y4mr2029381vdi.66.1319933119714; Sat, 29 Oct 2011 17:05:19 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.52.164.101 with HTTP; Sat, 29 Oct 2011 17:05:19 -0700 (PDT) In-Reply-To: <458756137.20111030024046@serebryakov.spb.ru> References: <201110281426.00013.jhb@freebsd.org> <4EAB550E.3060603@FreeBSD.org> <458756137.20111030024046@serebryakov.spb.ru> Date: Sun, 30 Oct 2011 11:05:19 +1100 X-Google-Sender-Auth: 1NhiLTh5bcCPUmjhNkR54FCadd4 Message-ID: From: Adrian Chadd To: Lev Serebryakov Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: arch@freebsd.org Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 00:27:16 -0000 2011/10/30 Lev Serebryakov : > Hello, Doug. > You wrote 29 =D0=BE=D0=BA=D1=82=D1=8F=D0=B1=D1=80=D1=8F 2011 =D0=B3., 5:2= 1:18: > >>> You can read the description of posix_fadvise() (which this implements)= here: >> If you want a real-world consumer of posix_fadvise you can take a look >> at net-p2p/libtorrent-rasterbar15. The code is ifdef'ed out for FreeBSD >> because we don't have that yet, but it should be obvious how to >> re-enable it. There are a few clients that use that lib, qbittorrent is >> probably the most straightforward. > =C2=A0net-p2p/transmission-daemon could be used, too. It shows very poor > performance on UFS (90% in pread() call and 50% of wall time to > saturate 40Mbit/s channel from fast disk) compared to Linux, where > such interface exists. ... why? Squid/Lusca doesn't suffer that way. Adrian From owner-freebsd-arch@FreeBSD.ORG Sun Oct 30 09:01:54 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A154106564A; Sun, 30 Oct 2011 09:01:54 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from onlyone.friendlyhosting.spb.ru (onlyone.friendlyhosting.spb.ru [IPv6:2a01:4f8:131:60a2::2]) by mx1.freebsd.org (Postfix) with ESMTP id C18EF8FC08; Sun, 30 Oct 2011 09:01:53 +0000 (UTC) Received: from lion.home.serebryakov.spb.ru (unknown [IPv6:2001:470:923f:1:504f:9791:43c0:21ab]) (Authenticated sender: lev@serebryakov.spb.ru) by onlyone.friendlyhosting.spb.ru (Postfix) with ESMTPA id 805744AC1C; Sun, 30 Oct 2011 13:01:52 +0400 (MSK) Date: Sun, 30 Oct 2011 13:01:43 +0400 From: Lev Serebryakov Organization: FreeBSD Project X-Priority: 3 (Normal) Message-ID: <908954806.20111030130143@serebryakov.spb.ru> To: Adrian Chadd In-Reply-To: References: <201110281426.00013.jhb@freebsd.org> <4EAB550E.3060603@FreeBSD.org> <458756137.20111030024046@serebryakov.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: arch@freebsd.org Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: lev@FreeBSD.org List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 09:01:54 -0000 Hello, Adrian. You wrote 30 =D0=BE=D0=BA=D1=82=D1=8F=D0=B1=D1=80=D1=8F 2011 =D0=B3., 4:05:= 19: >>>> You can read the description of posix_fadvise() (which this implements= ) here: >>> If you want a real-world consumer of posix_fadvise you can take a look >>> at net-p2p/libtorrent-rasterbar15. The code is ifdef'ed out for FreeBSD >>> because we don't have that yet, but it should be obvious how to >>> re-enable it. There are a few clients that use that lib, qbittorrent is >>> probably the most straightforward. >> =C2=A0net-p2p/transmission-daemon could be used, too. It shows very poor >> performance on UFS (90% in pread() call and 50% of wall time to >> saturate 40Mbit/s channel from fast disk) compared to Linux, where >> such interface exists. > ... why? Squid/Lusca doesn't suffer that way. I don't know. But I could show your results of typical ktrace, where transmission-daemon spends 590 seconds of 600 (Wall time) in pread() syscall , and real read speed is only about 30Mbit/s (and this FS could be read at speed about 300MiB/s, 100 times faster, with linear read). --=20 // Black Lion AKA Lev Serebryakov From owner-freebsd-arch@FreeBSD.ORG Sun Oct 30 11:10:33 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9253106567A for ; Sun, 30 Oct 2011 11:10:33 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from onlyone.friendlyhosting.spb.ru (onlyone.friendlyhosting.spb.ru [IPv6:2a01:4f8:131:60a2::2]) by mx1.freebsd.org (Postfix) with ESMTP id 92DB58FC15 for ; Sun, 30 Oct 2011 11:10:33 +0000 (UTC) Received: from lion.home.serebryakov.spb.ru (unknown [IPv6:2001:470:923f:1:504f:9791:43c0:21ab]) (Authenticated sender: lev@serebryakov.spb.ru) by onlyone.friendlyhosting.spb.ru (Postfix) with ESMTPA id 9937B4AC31 for ; Sun, 30 Oct 2011 15:10:32 +0400 (MSK) Date: Sun, 30 Oct 2011 15:10:23 +0400 From: Lev Serebryakov X-Priority: 3 (Normal) Message-ID: <457576448.20111030151023@serebryakov.spb.ru> To: arch@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: quoted-printable Cc: Subject: /etc/localtime problems X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 11:10:33 -0000 Hello, Arch. Now, /etc/localtime is copy of one of files from /usr/share/zoneinfo. It is created at install time or with "tzsetup" utility. IMHO, it is bad practice. For example, Russia changed rules (cancelled Winter Time). Ok, our database was updated properly (r223629 and MFCes), but "make buildworld installworld && mergemaster" doesn't touch /etc/localtime! So, every administrator of every FreeBSD server in Russia needs not to forget to update this file manually. It looks not good. IMHO, /etc/localtime should be symlink (in such case "installworld" or "freebsd-update" will fix problem), or "mergemaster" should know about this file and update it too... --=20 // Black Lion AKA Lev Serebryakov From owner-freebsd-arch@FreeBSD.ORG Sun Oct 30 11:44:45 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F835106564A; Sun, 30 Oct 2011 11:44:45 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id B57928FC08; Sun, 30 Oct 2011 11:44:44 +0000 (UTC) Received: by vws11 with SMTP id 11so6759318vws.13 for ; Sun, 30 Oct 2011 04:44:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=lai8vpDZM0AYYnfsnJULmldr6V/vvZWnwHJ6VjtRD0Y=; b=qCTzg89NuVVqUWJtJ6W2sReic4419Cm0nnHC2pjIJO5NqkchJ6QFE0GkPq6WxQGmoU VIJu1jpgxwg/l1bj08lOe0mUa/9bMaIDjauKuIwBNFYI0SA98NjS56vxu70hvl/XWNAd zRPgGXAeYUZRA1MpInVOqJ5Ev/eVhz6zNlfKA= MIME-Version: 1.0 Received: by 10.52.100.70 with SMTP id ew6mr2493920vdb.49.1319975083531; Sun, 30 Oct 2011 04:44:43 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.52.164.101 with HTTP; Sun, 30 Oct 2011 04:44:43 -0700 (PDT) In-Reply-To: <908954806.20111030130143@serebryakov.spb.ru> References: <201110281426.00013.jhb@freebsd.org> <4EAB550E.3060603@FreeBSD.org> <458756137.20111030024046@serebryakov.spb.ru> <908954806.20111030130143@serebryakov.spb.ru> Date: Sun, 30 Oct 2011 22:44:43 +1100 X-Google-Sender-Auth: MrKh8i-uQyKhSJCYDZmHDiEjGW4 Message-ID: From: Adrian Chadd To: lev@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: arch@freebsd.org Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 11:44:45 -0000 On 30 October 2011 20:01, Lev Serebryakov wrote: > =A0 I don't know. But I could show your results of typical ktrace, where > =A0transmission-daemon spends 590 seconds of 600 (Wall time) in > =A0pread() syscall , and real read speed is only about 30Mbit/s (and > =A0this FS could be read at speed about 300MiB/s, 100 times faster, > =A0with linear read). Is the app doing multi-threaded disk IO? How random is the IO? How is fadvise being used in the torrent client? Is it being used to force in data into cache? I'm not knocking the fadvise work (far from it!), I'd just like to better understand what's going on here. adrian From owner-freebsd-arch@FreeBSD.ORG Sun Oct 30 11:49:15 2011 Return-Path: Delivered-To: arch@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98E34106564A; Sun, 30 Oct 2011 11:49:15 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 1A9BD8FC14; Sun, 30 Oct 2011 11:49:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id p9UBXnhG042809; Sun, 30 Oct 2011 15:33:49 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id p9UBXn3Z042808; Sun, 30 Oct 2011 15:33:49 +0400 (MSK) (envelope-from ache) Date: Sun, 30 Oct 2011 15:33:49 +0400 From: Andrey Chernov To: Lev Serebryakov Message-ID: <20111030113348.GA42759@vniz.net> References: <457576448.20111030151023@serebryakov.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <457576448.20111030151023@serebryakov.spb.ru> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: arch@FreeBSD.ORG Subject: Re: /etc/localtime problems X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 11:49:15 -0000 On Sun, Oct 30, 2011 at 03:10:23PM +0400, Lev Serebryakov wrote: > Hello, Arch. > > Now, /etc/localtime is copy of one of files from > /usr/share/zoneinfo. It is created at install time or with "tzsetup" > utility. > > IMHO, it is bad practice. For example, Russia changed rules > (cancelled Winter Time). Ok, our database was updated properly > (r223629 and MFCes), but "make buildworld installworld && mergemaster" > doesn't touch /etc/localtime! So, every administrator of every FreeBSD > server in Russia needs not to forget to update this file manually. > > It looks not good. > > IMHO, /etc/localtime should be symlink (in such case "installworld" > or "freebsd-update" will fix problem), or "mergemaster" should know > about this file and update it too... I generally use symlink too, but the root of problem is that /usr mount can be delayed (NFS, etc.) -- http://ache.vniz.net/ From owner-freebsd-arch@FreeBSD.ORG Sun Oct 30 11:52:42 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8343106564A; Sun, 30 Oct 2011 11:52:42 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from onlyone.friendlyhosting.spb.ru (onlyone.friendlyhosting.spb.ru [IPv6:2a01:4f8:131:60a2::2]) by mx1.freebsd.org (Postfix) with ESMTP id A8F608FC13; Sun, 30 Oct 2011 11:52:42 +0000 (UTC) Received: from lion.home.serebryakov.spb.ru (unknown [IPv6:2001:470:923f:1:504f:9791:43c0:21ab]) (Authenticated sender: lev@serebryakov.spb.ru) by onlyone.friendlyhosting.spb.ru (Postfix) with ESMTPA id E67F94AC1C; Sun, 30 Oct 2011 15:52:40 +0400 (MSK) Date: Sun, 30 Oct 2011 15:52:31 +0400 From: Lev Serebryakov Organization: FreeBSD Project X-Priority: 3 (Normal) Message-ID: <1855260864.20111030155231@serebryakov.spb.ru> To: Adrian Chadd In-Reply-To: References: <201110281426.00013.jhb@freebsd.org> <4EAB550E.3060603@FreeBSD.org> <458756137.20111030024046@serebryakov.spb.ru> <908954806.20111030130143@serebryakov.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: quoted-printable Cc: arch@freebsd.org, lev@freebsd.org Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: lev@FreeBSD.org List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 11:52:43 -0000 Hello, Adrian. You wrote 30 =EE=EA=F2=FF=E1=F0=FF 2011 =E3., 15:44:43: >> =A0 I don't know. But I could show your results of typical ktrace, where >> =A0transmission-daemon spends 590 seconds of 600 (Wall time) in >> =A0pread() syscall , and real read speed is only about 30Mbit/s (and >> =A0this FS could be read at speed about 300MiB/s, 100 times faster, >> =A0with linear read). > Is the app doing multi-threaded disk IO? How random is the IO? No, it is single-threaded, but I/O is very random one. This single thread serves many (up to 128 in my setup, and this limit often reached) clients. Typical "logical" block for client is about 1-2MiB, and many clients download several consequent logical blocks. But basic I/O size in transmission is only 32Kb. > How is fadvise being used in the torrent client? Is it being used to > force in data into cache? Yep. With fadvice() transmission notify kernel about logical block (1-2MiB, depends on torrent itself) as "will need" and read from it when client ready to receive next 32KiB portion. Without fadvice() it looks like completely random I/O with 32KiB blocks (with total size of files about 1TiB in my case!). I have very large vfs.read_max, but it doesn't help much :( --=20 // Black Lion AKA Lev Serebryakov From owner-freebsd-arch@FreeBSD.ORG Sun Oct 30 11:53:26 2011 Return-Path: Delivered-To: arch@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90E8F1065672; Sun, 30 Oct 2011 11:53:26 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from onlyone.friendlyhosting.spb.ru (onlyone.friendlyhosting.spb.ru [IPv6:2a01:4f8:131:60a2::2]) by mx1.freebsd.org (Postfix) with ESMTP id 568A28FC14; Sun, 30 Oct 2011 11:53:26 +0000 (UTC) Received: from lion.home.serebryakov.spb.ru (unknown [IPv6:2001:470:923f:1:504f:9791:43c0:21ab]) (Authenticated sender: lev@serebryakov.spb.ru) by onlyone.friendlyhosting.spb.ru (Postfix) with ESMTPA id 6E5ED4AC2D; Sun, 30 Oct 2011 15:53:25 +0400 (MSK) Date: Sun, 30 Oct 2011 15:53:16 +0400 From: Lev Serebryakov Organization: FreeBSD Project X-Priority: 3 (Normal) Message-ID: <501950672.20111030155316@serebryakov.spb.ru> To: Andrey Chernov In-Reply-To: <20111030113348.GA42759@vniz.net> References: <457576448.20111030151023@serebryakov.spb.ru> <20111030113348.GA42759@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: quoted-printable Cc: arch@FreeBSD.ORG, Lev Serebryakov Subject: Re: /etc/localtime problems X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: lev@FreeBSD.org List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 11:53:26 -0000 Hello, Andrey. You wrote 30 =EE=EA=F2=FF=E1=F0=FF 2011 =E3., 15:33:49: >> Now, /etc/localtime is copy of one of files from >> /usr/share/zoneinfo. It is created at install time or with "tzsetup" >> utility. >>=20 >> IMHO, it is bad practice. For example, Russia changed rules >> (cancelled Winter Time). Ok, our database was updated properly >> (r223629 and MFCes), but "make buildworld installworld && mergemaster" >> doesn't touch /etc/localtime! So, every administrator of every FreeBSD >> server in Russia needs not to forget to update this file manually. >>=20 >> It looks not good. >>=20 >> IMHO, /etc/localtime should be symlink (in such case "installworld" >> or "freebsd-update" will fix problem), or "mergemaster" should know >> about this file and update it too... > I generally use symlink too, but the root of problem is that /usr mount > can be delayed (NFS, etc.) Yep, I understand this problem, and thought about it. IMHO, mergemaster solution will be better, as virtually anybody uses it after source upgrades. But it will not help in case of binary upgrades :( --=20 // Black Lion AKA Lev Serebryakov From owner-freebsd-arch@FreeBSD.ORG Sun Oct 30 11:57:25 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07A51106566C; Sun, 30 Oct 2011 11:57:25 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7F62B8FC0C; Sun, 30 Oct 2011 11:57:24 +0000 (UTC) Received: by vws11 with SMTP id 11so6763146vws.13 for ; Sun, 30 Oct 2011 04:57:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=RoIq4wxrcTMEwNW/Jlh/8XdoOwC9HXs4xeAHear/YSo=; b=U4rr/WxBrpfaedI6w3ZsmzE4YD30t4nrvxUZpO0B9k2NZAVb8MiWSsAfBcLUblBqWO 2mXhI+nj9A2d7xkJTqCQfHW8Wh/99cH0csVsRMMDOk2jOBpvjdfFSTIVymNL1s7w7VRg A5qe0G/eAFCgh5GrMwTH0VpUb4mNz7qGtb/+Y= MIME-Version: 1.0 Received: by 10.52.36.237 with SMTP id t13mr2501963vdj.45.1319975843791; Sun, 30 Oct 2011 04:57:23 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.52.164.101 with HTTP; Sun, 30 Oct 2011 04:57:23 -0700 (PDT) In-Reply-To: <1855260864.20111030155231@serebryakov.spb.ru> References: <201110281426.00013.jhb@freebsd.org> <4EAB550E.3060603@FreeBSD.org> <458756137.20111030024046@serebryakov.spb.ru> <908954806.20111030130143@serebryakov.spb.ru> <1855260864.20111030155231@serebryakov.spb.ru> Date: Sun, 30 Oct 2011 22:57:23 +1100 X-Google-Sender-Auth: uYKyLQVHFbo2bZEEOAxCFhUgwOY Message-ID: From: Adrian Chadd To: lev@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: arch@freebsd.org Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 11:57:25 -0000 Right, that's why Squid/Lusca sucks much less there. The IO is done using a pool of threads. I bet in the torrent client case, massive speedups could be done with correct use of either IO threads, or the POSIX AIO library. I'm all for using fadvise() to hint to the OS about what's about to happen (and I'll start leveraging it myself once it hits the tree) but there are other ways to skin this cat.. Adrian From owner-freebsd-arch@FreeBSD.ORG Sun Oct 30 12:03:41 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4340D106567A; Sun, 30 Oct 2011 12:03:41 +0000 (UTC) (envelope-from lev@freebsd.org) Received: from onlyone.friendlyhosting.spb.ru (onlyone.friendlyhosting.spb.ru [IPv6:2a01:4f8:131:60a2::2]) by mx1.freebsd.org (Postfix) with ESMTP id 048458FC14; Sun, 30 Oct 2011 12:03:41 +0000 (UTC) Received: from lion.home.serebryakov.spb.ru (unknown [IPv6:2001:470:923f:1:504f:9791:43c0:21ab]) (Authenticated sender: lev@serebryakov.spb.ru) by onlyone.friendlyhosting.spb.ru (Postfix) with ESMTPA id B24284AC1C; Sun, 30 Oct 2011 16:03:39 +0400 (MSK) Date: Sun, 30 Oct 2011 16:03:30 +0400 From: Lev Serebryakov X-Priority: 3 (Normal) Message-ID: <1124900347.20111030160330@serebryakov.spb.ru> To: Adrian Chadd In-Reply-To: References: <201110281426.00013.jhb@freebsd.org> <4EAB550E.3060603@FreeBSD.org> <458756137.20111030024046@serebryakov.spb.ru> <908954806.20111030130143@serebryakov.spb.ru> <1855260864.20111030155231@serebryakov.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: quoted-printable Cc: arch@freebsd.org, lev@freebsd.org Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 12:03:41 -0000 Hello, Adrian. You wrote 30 =EE=EA=F2=FF=E1=F0=FF 2011 =E3., 15:57:23: > I bet in the torrent client case, massive speedups could be done with > correct use of either IO threads, or the POSIX AIO library. > I'm all for using fadvise() to hint to the OS about what's about to > happen (and I'll start leveraging it myself once it hits the tree) but > there are other ways to skin this cat.. Yes, but all "general-purpose" software is Linux-oriented. Replace simple model in transmission (I've thought about it) is not very simple task, and I don't think, that authors (Linux- and MacOS X-oriented) is not interested. --=20 // Black Lion AKA Lev Serebryakov From owner-freebsd-arch@FreeBSD.ORG Sun Oct 30 12:13:43 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6438D106564A; Sun, 30 Oct 2011 12:13:43 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 001A98FC08; Sun, 30 Oct 2011 12:13:42 +0000 (UTC) Received: by vws11 with SMTP id 11so6768924vws.13 for ; Sun, 30 Oct 2011 05:13:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=xL4yG3RigPAUjAEqPIVdgtjroXN5GBga303DBFZa7IM=; b=lbizREuOP2rZl8oTGcNkfRCPd7LuFcaFm32qom/VZkooYJHAXwbtUcNhX16cr/8wbz ClQdAN0sFt7gNwEYc+VO6rTPMlyIukJcR6lGLU+0bDuFjgUDQENn6kfIFmj9bPoL0r0Y u9DNstkufC4F92mNhbt27PUEF2MKbff5JtZq0= MIME-Version: 1.0 Received: by 10.52.34.100 with SMTP id y4mr2515403vdi.66.1319976822249; Sun, 30 Oct 2011 05:13:42 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.52.164.101 with HTTP; Sun, 30 Oct 2011 05:13:42 -0700 (PDT) In-Reply-To: <1124900347.20111030160330@serebryakov.spb.ru> References: <201110281426.00013.jhb@freebsd.org> <4EAB550E.3060603@FreeBSD.org> <458756137.20111030024046@serebryakov.spb.ru> <908954806.20111030130143@serebryakov.spb.ru> <1855260864.20111030155231@serebryakov.spb.ru> <1124900347.20111030160330@serebryakov.spb.ru> Date: Sun, 30 Oct 2011 23:13:42 +1100 X-Google-Sender-Auth: hHRlIHSnt26VVFKjDPUKi_K4RHA Message-ID: From: Adrian Chadd To: Lev Serebryakov Content-Type: text/plain; charset=ISO-8859-1 Cc: arch@freebsd.org Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 12:13:43 -0000 Yup, and the Linux AIO code is a bit silly. The last time I checked, it issued one outstanding read/write per FD, so you were't exactly going to get great parallel IO on a single file with their POSIX AIO support. :) I kinda hope that's changed. Adrian From owner-freebsd-arch@FreeBSD.ORG Sun Oct 30 13:43:15 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C645106564A; Sun, 30 Oct 2011 13:43:15 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id C273D8FC13; Sun, 30 Oct 2011 13:43:14 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 2A16B3592EB; Sun, 30 Oct 2011 14:43:14 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 10AD528468; Sun, 30 Oct 2011 14:43:14 +0100 (CET) Date: Sun, 30 Oct 2011 14:43:13 +0100 From: Jilles Tjoelker To: Lev Serebryakov Message-ID: <20111030134313.GA94944@stack.nl> References: <457576448.20111030151023@serebryakov.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <457576448.20111030151023@serebryakov.spb.ru> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: arch@freebsd.org Subject: Re: /etc/localtime problems X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 13:43:15 -0000 On Sun, Oct 30, 2011 at 03:10:23PM +0400, Lev Serebryakov wrote: > Now, /etc/localtime is copy of one of files from > /usr/share/zoneinfo. It is created at install time or with "tzsetup" > utility. > IMHO, it is bad practice. For example, Russia changed rules > (cancelled Winter Time). Ok, our database was updated properly > (r223629 and MFCes), but "make buildworld installworld && mergemaster" > doesn't touch /etc/localtime! So, every administrator of every FreeBSD > server in Russia needs not to forget to update this file manually. > It looks not good. > IMHO, /etc/localtime should be symlink (in such case "installworld" > or "freebsd-update" will fix problem), or "mergemaster" should know > about this file and update it too... Recent tzsetup(8) (in 10.x, 9.x and recent 8.x but not in any release) stores the choice in /var/db/zoneinfo, allowing "tzsetup -r" to install the new version of the previous time zone. This happens automatically on installworld, but for some reason not on freebsd-update install. However, this only works if the new tzsetup(8) was run at least once to select the time zone (there is no code to create /var/db/zoneinfo from which /usr/share/zoneinfo file matches /etc/localtime). Code to create /var/db/zoneinfo could be something like if [ ! -s /var/db/zoneinfo ] && [ -s /etc/localtime ]; then zone=$(cd /usr/share/zoneinfo && for z in */* */*/* *; do if cmp -s "$z" /etc/localtime; then echo "$z"; break; fi done) if [ -n "$zone" ]; then echo "$zone" >/var/db/zoneinfo; fi fi It should be run against the old /usr/share/zoneinfo and assumes the /etc/localtime is up-to-date against that. -- Jilles Tjoelker From owner-freebsd-arch@FreeBSD.ORG Sun Oct 30 16:20:39 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 792A5106564A; Sun, 30 Oct 2011 16:20:39 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 356508FC12; Sun, 30 Oct 2011 16:20:39 +0000 (UTC) Received: from 63.imp.bsdimp.com (63.imp.bsdimp.com [10.0.0.63]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p9UGIVCM058126 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Sun, 30 Oct 2011 10:18:31 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=koi8-r From: Warner Losh X-Priority: 3 (Normal) In-Reply-To: <501950672.20111030155316@serebryakov.spb.ru> Date: Sun, 30 Oct 2011 10:18:22 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <9B19F4A4-FBA6-43DD-9FF6-C360AC3A7E59@bsdimp.com> References: <457576448.20111030151023@serebryakov.spb.ru> <20111030113348.GA42759@vniz.net> <501950672.20111030155316@serebryakov.spb.ru> To: lev@freebsd.org X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Sun, 30 Oct 2011 10:18:31 -0600 (MDT) Cc: arch@freebsd.org Subject: Re: /etc/localtime problems X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 16:20:39 -0000 On Oct 30, 2011, at 5:53 AM, Lev Serebryakov wrote: > Hello, Andrey. > You wrote 30 =CF=CB=D4=D1=C2=D2=D1 2011 =C7., 15:33:49: >=20 >>> Now, /etc/localtime is copy of one of files from >>> /usr/share/zoneinfo. It is created at install time or with "tzsetup" >>> utility. >>>=20 >>> IMHO, it is bad practice. For example, Russia changed rules >>> (cancelled Winter Time). Ok, our database was updated properly >>> (r223629 and MFCes), but "make buildworld installworld && = mergemaster" >>> doesn't touch /etc/localtime! So, every administrator of every = FreeBSD >>> server in Russia needs not to forget to update this file manually. >>>=20 >>> It looks not good. >>>=20 >>> IMHO, /etc/localtime should be symlink (in such case "installworld" >>> or "freebsd-update" will fix problem), or "mergemaster" should know >>> about this file and update it too... >=20 >> I generally use symlink too, but the root of problem is that /usr = mount >> can be delayed (NFS, etc.) > Yep, I understand this problem, and thought about it. IMHO, > mergemaster solution will be better, as virtually anybody uses it > after source upgrades. But it will not help in case of binary > upgrades :( After the big USA DST fiasco a few years ago I thought we had a script = to figure out which file was currently installed into /etc/localtime and = copy the right new one over it. Warner= From owner-freebsd-arch@FreeBSD.ORG Sun Oct 30 21:36:08 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 795CE106567D; Sun, 30 Oct 2011 21:36:08 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id D4B5E14F4C9; Sun, 30 Oct 2011 21:35:29 +0000 (UTC) Message-ID: <4EADC321.4050409@FreeBSD.org> Date: Sun, 30 Oct 2011 14:35:29 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:7.0.1) Gecko/20111001 Thunderbird/7.0.1 MIME-Version: 1.0 To: Lev Serebryakov References: <457576448.20111030151023@serebryakov.spb.ru> In-Reply-To: <457576448.20111030151023@serebryakov.spb.ru> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: multipart/mixed; boundary="------------000607020809040905000505" Cc: arch@freebsd.org Subject: Re: /etc/localtime problems X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 21:36:08 -0000 This is a multi-part message in MIME format. --------------000607020809040905000505 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 10/30/2011 04:10, Lev Serebryakov wrote: > Hello, Arch. > > Now, /etc/localtime is copy of one of files from > /usr/share/zoneinfo. It is created at install time or with "tzsetup" > utility. > > IMHO, it is bad practice. For example, Russia changed rules > (cancelled Winter Time). Ok, our database was updated properly > (r223629 and MFCes), but "make buildworld installworld && mergemaster" > doesn't touch /etc/localtime! So, every administrator of every FreeBSD > server in Russia needs not to forget to update this file manually. > > It looks not good. > > IMHO, /etc/localtime should be symlink (in such case "installworld" > or "freebsd-update" will fix problem), or "mergemaster" should know > about this file and update it too... Thanks for bringing this to our attention. The symlink is problematic both because of the possibility of /usr being mounted late, and also for single-user mode. What do you think of the attached patch? I think it will handle the situation. Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ --------------000607020809040905000505 Content-Type: text/plain; name="mm-tzsetup.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="mm-tzsetup.diff" Index: mergemaster.sh =================================================================== --- mergemaster.sh (revision 226748) +++ mergemaster.sh (working copy) @@ -1311,6 +1311,19 @@ esac echo '' +if [ -f /var/db/zoneinfo ]; then + echo "*** Reinstalling `cat /var/db/zoneinfo` as /etc/localtime" + tzsetup -r +else + echo "*** There is no /var/db/zoneinfo file to update /etc/localtime." + echo -n ' Would you like to run tzsetup? y or n [y] ' + read ANSWER + case "$ANSWER" in + y|'') tzsetup ;; + esac +fi + +echo '' if [ -r "${MM_EXIT_SCRIPT}" ]; then . "${MM_EXIT_SCRIPT}" --------------000607020809040905000505-- From owner-freebsd-arch@FreeBSD.ORG Mon Oct 31 14:58:32 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4CD71065675 for ; Mon, 31 Oct 2011 14:58:32 +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 7DB858FC1D for ; Mon, 31 Oct 2011 14:58:32 +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 3396046B06; Mon, 31 Oct 2011 10:58:32 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A27528A02E; Mon, 31 Oct 2011 10:58:31 -0400 (EDT) From: John Baldwin To: Jilles Tjoelker Date: Mon, 31 Oct 2011 10:24:07 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: <201110281426.00013.jhb@freebsd.org> <20111029214057.GB90408@stack.nl> In-Reply-To: <20111029214057.GB90408@stack.nl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201110311024.07580.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 31 Oct 2011 10:58:31 -0400 (EDT) Cc: arch@freebsd.org Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 14:58:32 -0000 On Saturday, October 29, 2011 5:40:58 pm Jilles Tjoelker wrote: > On Fri, Oct 28, 2011 at 02:25:59PM -0400, John Baldwin wrote: > > I have been working for the last week or so on a patch to add an > > fadvise(2) system call. It is somewhat similar to madvise(2) except > > that it operates on a file descriptor instead of a memory region. It > > also only really makes sense for regular files and does not apply to > > other file descriptor types. > > Cool. > > Various other posix_* functions such as posix_spawn() and posix_openpt() > are implemented directly, not as a wrapper around s/posix_//. I think > posix_madvise() is only implemented as a wrapper because madvise() > already existed. Therefore, I don't see a reason why a function named > fadvise would be useful on its own (except if there are existing > applications that use that name). Existing applications use the name and I find it ugly. (I also wish we had a plain fallocate() instead of just posix_fallocate().) However, if other folks prefer not having the wrapper I could update it to use the posix_* name. > If the advice is FADV_SEQUENTIAL, FADV_RANDOM or FADV_NOREUSE and the > file descriptor is invalid (fget() fails), the struct fadvise_info is > leaked. Gah, fixed (I had thought of that case but forgot to update it when converting the advice to be malloc'd vs stored in struct file directly). > The comparisons > > + (fa->fa_start != 0 && fa->fa_start == end + 1) || > + (uap->offset != 0 && fa->fa_end + 1 == uap->offset))) { > > should instead be something like > > + (end != OFF_MAX && fa->fa_start == end + 1) || > + (fa->fa_end != OFF_MAX && fa->fa_end + 1 == uap->offset))) { > > to avoid integer overflow. Hmm, but the expressions will still work in that case, yes? I already check for uap->offset and uap->len being negative earlier (so fa_start and fa_end are always positive), and off_t is signed, so if end is OFF_MAX, then end + 1 will certainly not == fa_start? -- John Baldwin From owner-freebsd-arch@FreeBSD.ORG Mon Oct 31 19:04:00 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B407106564A; Mon, 31 Oct 2011 19:04:00 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 40AF08FC26; Mon, 31 Oct 2011 19:04:00 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id A56EC2A28CF0; Mon, 31 Oct 2011 20:03:59 +0100 (CET) Date: Mon, 31 Oct 2011 20:03:59 +0100 From: Ed Schouten To: John Baldwin Message-ID: <20111031190359.GP2258@hoeg.nl> References: <201110281426.00013.jhb@freebsd.org> <20111029214057.GB90408@stack.nl> <201110311024.07580.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="S0GG+JvAI2G0KxBG" Content-Disposition: inline In-Reply-To: <201110311024.07580.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: arch@freebsd.org, Jilles Tjoelker Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 19:04:00 -0000 --S0GG+JvAI2G0KxBG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi John, * John Baldwin , 20111031 15:24: > Existing applications use the name and I find it ugly. (I also wish we > had a plain fallocate() instead of just posix_fallocate().) However, if > other folks prefer not having the wrapper I could update it to use the > posix_* name. I agree with Jilles. It's easier to introduce namespace pollution than it is to get rid of it afterwards. If the function is called posix_fadvise(), people should just use that. People are constantly complaining about `Linuxisms' when they want to port software to FreeBSD. The word `BSDism' should remain an euphemism. ;-) --=20 Ed Schouten WWW: http://80386.nl/ --S0GG+JvAI2G0KxBG Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJOrvEfAAoJEG5e2P40kaK7srUP/0vFMJBvCKeqC1yP1XrDUgzH G//JCszA2amqaC5wJbrOBTVLfpLPcXKb5+VX7B9dK/hoTcAQ87kp9Osz73whr90+ Vbcxkd+ejpIFCWjdfeo3+t6sI/LuFzW/zDKaaKSMvox9Wpt0Aq9T451SVH9+XM0/ S4IPbM0sXamStUzbC/PpI5165dxQJI+k8NYDic0rDDyr2FOR9X8STFIObvFQwNgL PEz/K/XmiPyNSVVXkQYM0rmOXml9gcS+gKgEZbhLNcQ778tpzUkx1fx5Is99Rgwj JBG8GUludUh+t1gnbpmSrtu0yC1IXzAptc38SwsHGURS0fOtORiOLjabJ/SVpR1i j+J9LXFr9QCR77VPiMrCiS0BhzrTpJabQND8rhvNGg3h191DejuhRMK0VLDqGMJp NgyG58oBeh1+eUS0VHgWi8P/k1EnJlZ+bp7mOndPNDmIbdr3QLc9nonli3X71Pku K9cLf8h2UHHj28pcaOXlrgCYkdVhGHMamUriky10HXtw1+50liPbG2oFMjwCAaa7 yeqkbbxmBnn9SlJouI3LQWc8yfBGFghy+oPQ2MXCne2CI+9LWrke7fAUYhEeHOte 6qUpLTrotDFB6eR3cXzjdSS3rOwQxh5SNEbcgnv8oXhL2ATIOv5OyKuerTBksBZH cnNVlN+WyjszY5r6zocl =1QiN -----END PGP SIGNATURE----- --S0GG+JvAI2G0KxBG-- From owner-freebsd-arch@FreeBSD.ORG Mon Oct 31 20:49:08 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 30F14106566C; Mon, 31 Oct 2011 20:49:08 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id F2E49155743; Mon, 31 Oct 2011 20:48:48 +0000 (UTC) Message-ID: <4EAF09B0.8050603@FreeBSD.org> Date: Mon, 31 Oct 2011 13:48:48 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:7.0.1) Gecko/20111001 Thunderbird/7.0.1 MIME-Version: 1.0 To: Ed Schouten References: <201110281426.00013.jhb@freebsd.org> <20111029214057.GB90408@stack.nl> <201110311024.07580.jhb@freebsd.org> <20111031190359.GP2258@hoeg.nl> In-Reply-To: <20111031190359.GP2258@hoeg.nl> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: arch@freebsd.org, Jilles Tjoelker Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 20:49:08 -0000 On 10/31/2011 12:03, Ed Schouten wrote: > Hi John, > > * John Baldwin , 20111031 15:24: >> Existing applications use the name and I find it ugly. (I also wish we >> had a plain fallocate() instead of just posix_fallocate().) However, if >> other folks prefer not having the wrapper I could update it to use the >> posix_* name. > > I agree with Jilles. It's easier to introduce namespace pollution than > it is to get rid of it afterwards. If the function is called > posix_fadvise(), people should just use that. > > People are constantly complaining about `Linuxisms' when they want to > port software to FreeBSD. The word `BSDism' should remain an euphemism. > ;-) +1 to both points. :) -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-freebsd-arch@FreeBSD.ORG Mon Oct 31 21:17:55 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AE1C1065676 for ; Mon, 31 Oct 2011 21:17:55 +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 61F5B8FC1F for ; Mon, 31 Oct 2011 21:17:55 +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 10FA346B45; Mon, 31 Oct 2011 17:17:55 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A44658A037; Mon, 31 Oct 2011 17:17:54 -0400 (EDT) From: John Baldwin To: Ed Schouten Date: Mon, 31 Oct 2011 17:17:53 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: <201110281426.00013.jhb@freebsd.org> <201110311024.07580.jhb@freebsd.org> <20111031190359.GP2258@hoeg.nl> In-Reply-To: <20111031190359.GP2258@hoeg.nl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201110311717.53476.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 31 Oct 2011 17:17:54 -0400 (EDT) Cc: arch@freebsd.org, Jilles Tjoelker Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 21:17:55 -0000 On Monday, October 31, 2011 3:03:59 pm Ed Schouten wrote: > Hi John, > > * John Baldwin , 20111031 15:24: > > Existing applications use the name and I find it ugly. (I also wish we > > had a plain fallocate() instead of just posix_fallocate().) However, if > > other folks prefer not having the wrapper I could update it to use the > > posix_* name. > > I agree with Jilles. It's easier to introduce namespace pollution than > it is to get rid of it afterwards. If the function is called > posix_fadvise(), people should just use that. They don't. They use fadvise() which is part of Linux's API much as madvise(2) is part of ours. (See the other fork in this thread.) > People are constantly complaining about `Linuxisms' when they want to > port software to FreeBSD. The word `BSDism' should remain an euphemism. > ;-) I think kqueue() is a useful BSDism. I think the attitude that we should have nothing that deviates from an established standard would be harmful if it was actually applied. I also really do think that posix_*() truly is far uglier to read. In the worst case, imagine something like this: char *cp; cp = posix_malloc(posix_strlen(some_string) + 1); posix_strcpy(cp, s); posix_printf("%s\n", cp); *blech* I realize not all symbols will get this treatment, but this will eventually lead to some ugly code the more it is done. I am fine with fully POSIX- compliant code looking ugly, but I'd like for code written for FreeBSD to not be quite so clunky. Yes, POSIX wants to use a clean namespace for new routines going forward, that's fine. However, I think we should provide sane names for our APIs and implement POSIX on top of those. How many folks have actually used posix_madvise() instead of madvise()? And do you really think posix_fadvise() as a function name is not less orthogonal to madvise() than fadvise()? That said, I can update the patch to use the ugly name. Can someone else volunteer to implement a VOP_ADVISE() for UFS that actually does the read- ahead (for FADV_WILLNEED) (or for other filesystems for that matter). ZFS might need to use a custom FADV_DONTNEED as well. -- John Baldwin From owner-freebsd-arch@FreeBSD.ORG Mon Oct 31 21:21:59 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E071106564A; Mon, 31 Oct 2011 21:21:59 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 37B078FC17; Mon, 31 Oct 2011 21:21:58 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 528762A28CF0; Mon, 31 Oct 2011 22:21:57 +0100 (CET) Date: Mon, 31 Oct 2011 22:21:57 +0100 From: Ed Schouten To: John Baldwin Message-ID: <20111031212157.GQ2258@hoeg.nl> References: <201110281426.00013.jhb@freebsd.org> <201110311024.07580.jhb@freebsd.org> <20111031190359.GP2258@hoeg.nl> <201110311717.53476.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wg9FEZT+WCTrEXgJ" Content-Disposition: inline In-Reply-To: <201110311717.53476.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: arch@freebsd.org, Jilles Tjoelker Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 21:21:59 -0000 --wg9FEZT+WCTrEXgJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * John Baldwin , 20111031 22:17: > They don't. They use fadvise() which is part of Linux's API much as=20 > madvise(2) is part of ours. (See the other fork in this thread.) Huh? Wait. It seems fadvise() is only a name used by the Linux kernel. It's not exported by glibc as a symbol. At least not on my laptop (Ubuntu 11.10). > (ed@mekker) ~ $ man fadvise > No manual entry for fadvise > (ed@mekker) ~ $ fgrep -r fadvise /usr/include | grep -v posix_fadvise > /usr/include/x86_64-linux-gnu/bits/syscall.h:#define SYS_fadvise64 __NR_f= advise64 > /usr/include/x86_64-linux-gnu/bits/syscall.h:#define SYS_fadvise64_64 __N= R_fadvise64_64 > /usr/include/x86_64-linux-gnu/asm/unistd_64.h:#define __NR_fadvise64 2= 21 > /usr/include/x86_64-linux-gnu/asm/unistd_64.h:__SYSCALL(__NR_fadvise64, s= ys_fadvise64) > /usr/include/x86_64-linux-gnu/asm/unistd_32.h:#define __NR_fadvise64 250 > /usr/include/x86_64-linux-gnu/asm/unistd_32.h:#define __NR_fadvise64_64 2= 72 > /usr/include/asm-generic/unistd.h:/* mm/fadvise.c */ > /usr/include/asm-generic/unistd.h:#define __NR3264_fadvise64 223 > /usr/include/asm-generic/unistd.h:__SC_COMP(__NR3264_fadvise64, sys_fadvi= se64_64, compat_sys_fadvise64_64) > /usr/include/asm-generic/unistd.h:#define __NR_fadvise64 1053 > /usr/include/asm-generic/unistd.h:__SYSCALL(__NR_fadvise64, sys_fadvise64) > /usr/include/asm-generic/unistd.h:#define __NR_fadvise64 __NR3264_fadvise= 64 > /usr/include/asm-generic/unistd.h:#define __NR_fadvise64_64 __NR3264_fadv= ise64 > (ed@mekker) ~ $ nm -D /lib/x86_64-linux-gnu/libc.so.6 | grep fadvise > 00000000000d59e0 T posix_fadvise > 00000000000d59e0 T posix_fadvise64 --=20 Ed Schouten WWW: http://80386.nl/ --wg9FEZT+WCTrEXgJ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJOrxF1AAoJEG5e2P40kaK7jUQP/3MgNDOIy9KT19oHXut9JKRX yMvC9BKPmHZJ/5V4vF+3hTZDqyCjSvU79y8Z0yeVlRygyYjuQxBhtPlZFsVybXUL rxMgDrbMYUhgqkSrV0jWpK00h1x3B9ei8IHkZOwsUzxKT/mT6kQYJLJ3tebJwk/2 ZdtrODs/YmZ2cqmU0m+2dDCcOa5B2wWkiYZohcIB6QOp2G7Wz/2fCXHEE9JLVMJT BibPib6Qv7MQG0pBTu99fYs4O1wizMFfLuh7Q0agyECvcf0Q7U0KLwDDbzZqh+dX bR3IKjVTRLZPhYDhOQHzVMXByXKP52IYlj1QSHEtiDr5t7Al/r9OX0ynqIcJVY1s PL4SePUDXDoLxRTwfSZSWykQFDjZBzRwLXM9sV+DyP0bccZmeMwLNtR8BhJ7dT5p zA/kYyHzeXPoJCbimTsfG6taMSaHCUWvi1Ob5hytSlOOc7vSFzzDzjGxRPtzusc+ qv6OJAZM692OML8GbLYNhJY9NO69vyL3E/P4sJblNstESYd3AY+GfeJXO5Wh6YAV z9ATBEN5817hjDglWj/hEywAi9y4/g48YA1L7csMk0T5tqvVA9jFwBS+ZU6aQWVM JRMQjSaEY3QGH6fTrlzmBV59F8rhaB/BIU9/U5pyWqWPdJ5TG3ppvEErSZc2ux4A sd+RCKsJ7jC7Nn+5FsGf =nl0q -----END PGP SIGNATURE----- --wg9FEZT+WCTrEXgJ-- From owner-freebsd-arch@FreeBSD.ORG Mon Oct 31 21:22:01 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55CCB1065670; Mon, 31 Oct 2011 21:22:01 +0000 (UTC) (envelope-from yanegomi@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 014CB8FC13; Mon, 31 Oct 2011 21:22:00 +0000 (UTC) Received: by qadz32 with SMTP id z32so7160210qad.13 for ; Mon, 31 Oct 2011 14:22:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=4hJsPLvdFaBmVOy0Nm4aTmKOCXPfpOdqBHuKWlbQ0iw=; b=KOoqQ+K0pYFBE7wmMvTCtHd2np6wuDOcrxAxIkmfMbeVybicWCgpcZjL71tG8fnsPj yHnXihMX5aRI2Rp9ScOM2hZrHcYbXqU2E5ZG+KjWnLKtiu2qWKa7jvBireL+MMP3E6Yi Gt8Ea6XV5GFQOl3yZFMrS651FcRlel5VHxgBI= MIME-Version: 1.0 Received: by 10.182.41.4 with SMTP id b4mr3257532obl.76.1320096120045; Mon, 31 Oct 2011 14:22:00 -0700 (PDT) Received: by 10.182.122.33 with HTTP; Mon, 31 Oct 2011 14:22:00 -0700 (PDT) In-Reply-To: <201110311717.53476.jhb@freebsd.org> References: <201110281426.00013.jhb@freebsd.org> <201110311024.07580.jhb@freebsd.org> <20111031190359.GP2258@hoeg.nl> <201110311717.53476.jhb@freebsd.org> Date: Mon, 31 Oct 2011 14:22:00 -0700 Message-ID: From: Garrett Cooper To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Ed Schouten , Jilles Tjoelker , arch@freebsd.org Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 21:22:01 -0000 On Mon, Oct 31, 2011 at 2:17 PM, John Baldwin wrote: > On Monday, October 31, 2011 3:03:59 pm Ed Schouten wrote: >> Hi John, >> >> * John Baldwin , 20111031 15:24: >> > Existing applications use the name and I find it ugly. =A0(I also wish= we >> > had a plain fallocate() instead of just posix_fallocate().) =A0However= , if >> > other folks prefer not having the wrapper I could update it to use the >> > posix_* name. >> >> I agree with Jilles. It's easier to introduce namespace pollution than >> it is to get rid of it afterwards. If the function is called >> posix_fadvise(), people should just use that. > > They don't. =A0They use fadvise() which is part of Linux's API much as > madvise(2) is part of ours. =A0(See the other fork in this thread.) > >> People are constantly complaining about `Linuxisms' when they want to >> port software to FreeBSD. The word `BSDism' should remain an euphemism. >> ;-) > > I think kqueue() is a useful BSDism. =A0I think the attitude that we shou= ld have > nothing that deviates from an established standard would be harmful if it= was > actually applied. > > I also really do think that posix_*() truly is far uglier to read. =A0In = the > worst case, imagine something like this: > > =A0 =A0 =A0 =A0char *cp; > > =A0 =A0 =A0 =A0cp =3D posix_malloc(posix_strlen(some_string) + 1); > =A0 =A0 =A0 =A0posix_strcpy(cp, s); > =A0 =A0 =A0 =A0posix_printf("%s\n", cp); > > *blech* > > I realize not all symbols will get this treatment, but this will eventual= ly > lead to some ugly code the more it is done. =A0I am fine with fully POSIX= - > compliant code looking ugly, but I'd like for code written for FreeBSD to= not > be quite so clunky. =A0Yes, POSIX wants to use a clean namespace for new > routines going forward, that's fine. =A0However, I think we should provid= e sane > names for our APIs and implement POSIX on top of those. =A0How many folks= have > actually used posix_madvise() instead of madvise()? =A0And do you really = think > posix_fadvise() as a function name is not less orthogonal to madvise() th= an > fadvise()? int fadvise(...); #ifdef _POSIX_SOURCE #define posix_fadvise fadvise #endif Done :P? posix_* IMO is a mistake that really should be controlled via the _POSIX_SOURCE macro. > > > That said, I can update the patch to use the ugly name. =A0Can someone el= se > volunteer to implement a VOP_ADVISE() for UFS that actually does the read= - > ahead (for FADV_WILLNEED) (or for other filesystems for that matter). =A0= ZFS > might need to use a custom FADV_DONTNEED as well. From owner-freebsd-arch@FreeBSD.ORG Mon Oct 31 21:24:42 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FD0C106564A; Mon, 31 Oct 2011 21:24:42 +0000 (UTC) (envelope-from yanegomi@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 AB0398FC13; Mon, 31 Oct 2011 21:24:41 +0000 (UTC) Received: by qadz32 with SMTP id z32so7162688qad.13 for ; Mon, 31 Oct 2011 14:24:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=erurtAvl12T9px9dWiAxFPf4Gr78n/CB8N5Bsh4Px7o=; b=GYEl65L30D6kGNGYBuY1ZAoqdxvKv/lEu161G9bXr7EtSlluzLWFEPsm1NgTvTMkDk luBZ7Optmh2zebkPKIl2fdfPMYlAlK3oIk+bFNiY/+bx5wqs1Sy8TTTBm4dwaGnEofP2 84k7MnOsyisvEoN84rvpUznnIvRTuILy5pDmQ= MIME-Version: 1.0 Received: by 10.182.7.10 with SMTP id f10mr3273120oba.56.1320096281006; Mon, 31 Oct 2011 14:24:41 -0700 (PDT) Received: by 10.182.122.33 with HTTP; Mon, 31 Oct 2011 14:24:40 -0700 (PDT) In-Reply-To: <20111031212157.GQ2258@hoeg.nl> References: <201110281426.00013.jhb@freebsd.org> <201110311024.07580.jhb@freebsd.org> <20111031190359.GP2258@hoeg.nl> <201110311717.53476.jhb@freebsd.org> <20111031212157.GQ2258@hoeg.nl> Date: Mon, 31 Oct 2011 14:24:40 -0700 Message-ID: From: Garrett Cooper To: Ed Schouten Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: arch@freebsd.org, Jilles Tjoelker Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 21:24:42 -0000 On Mon, Oct 31, 2011 at 2:21 PM, Ed Schouten wrote: > * John Baldwin , 20111031 22:17: >> They don't. =A0They use fadvise() which is part of Linux's API much as >> madvise(2) is part of ours. =A0(See the other fork in this thread.) > > Huh? Wait. It seems fadvise() is only a name used by the Linux kernel. > It's not exported by glibc as a symbol. At least not on my laptop > (Ubuntu 11.10). Many developers incorrectly dig into system headers on Linux, so that's probably why they prefix the API. -Garrett From owner-freebsd-arch@FreeBSD.ORG Mon Oct 31 22:16:28 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35949106564A; Mon, 31 Oct 2011 22:16:28 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id EE8BB8FC0A; Mon, 31 Oct 2011 22:16:27 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 5DA2C2A28CF0; Mon, 31 Oct 2011 23:16:27 +0100 (CET) Date: Mon, 31 Oct 2011 23:16:27 +0100 From: Ed Schouten To: John Baldwin Message-ID: <20111031221627.GR2258@hoeg.nl> References: <201110281426.00013.jhb@freebsd.org> <201110311024.07580.jhb@freebsd.org> <20111031190359.GP2258@hoeg.nl> <201110311717.53476.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rKoHqF+aPLVth8b2" Content-Disposition: inline In-Reply-To: <201110311717.53476.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: arch@freebsd.org, Jilles Tjoelker Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 22:16:28 -0000 --rKoHqF+aPLVth8b2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi John, * John Baldwin , 20111031 22:17: > I also really do think that posix_*() truly is far uglier to read. In th= e=20 > worst case, imagine something like this: >=20 > char *cp; >=20 > cp =3D posix_malloc(posix_strlen(some_string) + 1); > posix_strcpy(cp, s); > posix_printf("%s\n", cp); >=20 > *blech* I do agree it's ugly, but at least it's standardized. The fact is that it's easier to explain to someone "this code doesn't build on $NONBSD, because $NONBSD lacks POSIX conformance" than saying "this code doesn't build on $NONBSD because it uses BSD-specific crap". As I mentioned previously, there is no fadvise() on Linux. There's no gain in compatibility by implementing it -- it's just syntactic sugar. Maybe we can find a compromise. My main objection is that the current patch adds some redundancy that will stay part of our ABI. Also, having two different symbols makes debugging a bit harder, because you must not forget to place multiple breakpoints, maybe even preload multiple symbols. What if we implement everything using the POSIX naming scheme, but put this in : > #if _BSD_SOURCE > #define FADV_NORMAL POSIX_FADV_NORMAL > #define ... > > static inline int > fadvise(int _fd, off_t _offset, off_t _len, int _advice) > { > > return (fadvise(_fd, _offset, _len, _advice)); > } > #endif That way userspace code still has the liberty of using the shorthand notation, without being a burden on the ABI. But please, don't let me stop you from committing your work as is. I'm happy either way. :-) --=20 Ed Schouten WWW: http://80386.nl/ --rKoHqF+aPLVth8b2 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJOrx47AAoJEG5e2P40kaK7WRAP/0+Y1XCZQsDDUXNa0khvIH5y wxUA8h+1AYXQakTNC2RienRGe85EbDedbcyQT/eqaEJEb1rK0sZwjlVO8HX0miLT wbz9diwEItQmLf+V84hY4qBAWlG0yzvK7MnfkqT7kAaujlOZC3ZUuFt2DmuzpeYu Ar+ciZHVaR61pmXuDDTTE+wgBUYLlK4KZTqhub8fyDJq7J5lSv+OXbhuXRTJmj4O uajz8P5YyFW/d/WD1LrAFQkPJlR+CPksQNKKO+WdbXE6w/0Iw21qB5uneP6f0Ek7 igwIGiy+vT0uFYa04ehACAj99i0cRsGX4yYtTL4vCa1x9QAtthk6EUa1emKfDPJO DEMoKuE5kgoHYeiNLsXF4BPHf0m9KpapzWBjjgRQS+Efoo6qCY7nAvae6qpxA9cx Xj/w+He+IdD7Esk51yjvei9ge0tLzXq9hw4uPhLA/IQknt1PswgDTdPqJuOEOzJa nyPFIHP9pqLz7GT+u1hgxI7kKN+AkTXvrcRDz++k0TAja7Ux0ReOeuQFoetGmriP F0tyYf7JeP+bkwY/hZcxErC8viWbiW/4YN4hHIwnDrMRnzw3W/shWWpwtQx1XW5E moMsz5DAzyUlAky16f/+y8eLmWFemnN3KJxN5SBhf6cl5FwY9rts3PdPM+TgLHfc /14PS2FninFw9u+OxSFc =H2f4 -----END PGP SIGNATURE----- --rKoHqF+aPLVth8b2-- From owner-freebsd-arch@FreeBSD.ORG Mon Oct 31 22:20:44 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 01D13106564A; Mon, 31 Oct 2011 22:20:44 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id DFB2414EC4A; Mon, 31 Oct 2011 22:20:41 +0000 (UTC) Message-ID: <4EAF1F39.1090008@FreeBSD.org> Date: Mon, 31 Oct 2011 15:20:41 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:7.0.1) Gecko/20111001 Thunderbird/7.0.1 MIME-Version: 1.0 To: Ed Schouten References: <201110281426.00013.jhb@freebsd.org> <201110311024.07580.jhb@freebsd.org> <20111031190359.GP2258@hoeg.nl> <201110311717.53476.jhb@freebsd.org> <20111031221627.GR2258@hoeg.nl> In-Reply-To: <20111031221627.GR2258@hoeg.nl> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: arch@freebsd.org, Jilles Tjoelker Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 22:20:44 -0000 On 10/31/2011 15:16, Ed Schouten wrote: > What if we implement everything using the POSIX naming scheme, but put > this in : My concern about that is that we're teaching people who start learning programming with our sources to do non-standard stuff. I don't see anyone in this thread saying that we should go back and change things that we already have. But if we're going to implement a new thing, giving it the standard name (however ugly, and I agree that it's ugly) is almost certainly the right way to go. Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-freebsd-arch@FreeBSD.ORG Mon Oct 31 22:56:13 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E923D1065674; Mon, 31 Oct 2011 22:56:13 +0000 (UTC) (envelope-from wollman@hergotha.csail.mit.edu) Received: from hergotha.csail.mit.edu (wollman-1-pt.tunnel.tserv4.nyc4.ipv6.he.net [IPv6:2001:470:1f06:ccb::2]) by mx1.freebsd.org (Postfix) with ESMTP id 846338FC1C; Mon, 31 Oct 2011 22:56:13 +0000 (UTC) Received: from hergotha.csail.mit.edu (localhost [127.0.0.1]) by hergotha.csail.mit.edu (8.14.4/8.14.4) with ESMTP id p9VMuCoZ075728; Mon, 31 Oct 2011 18:56:12 -0400 (EDT) (envelope-from wollman@hergotha.csail.mit.edu) Received: (from wollman@localhost) by hergotha.csail.mit.edu (8.14.4/8.14.4/Submit) id p9VMuCG2075727; Mon, 31 Oct 2011 18:56:12 -0400 (EDT) (envelope-from wollman) Date: Mon, 31 Oct 2011 18:56:12 -0400 (EDT) From: Garrett Wollman Message-Id: <201110312256.p9VMuCG2075727@hergotha.csail.mit.edu> To: dougb@freebsd.org X-Newsgroups: mit.lcs.mail.freebsd-arch In-Reply-To: <4EAF1F39.1090008@FreeBSD.org> References: <201110281426.00013.jhb@freebsd.org> <201110311024.07580.jhb@freebsd.org> <20111031190359.GP2258@hoeg.nl> <201110311717.53476.jhb@freebsd.org> <20111031221627.GR2258@hoeg.nl> Organization: none X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (hergotha.csail.mit.edu [127.0.0.1]); Mon, 31 Oct 2011 18:56:12 -0400 (EDT) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=disabled version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on hergotha.csail.mit.edu Cc: arch@freebsd.org Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 22:56:14 -0000 In article <4EAF1F39.1090008@FreeBSD.org>, dougb@freebsd.org writes: >I don't see anyone in this thread saying that we should go back and >change things that we already have. But if we're going to implement a >new thing, giving it the standard name (however ugly, and I agree that >it's ugly) is almost certainly the right way to go. The existence of the posix_* names indicates that the pre-existing implementations, on which POSIX based its standard, had some conflict over the function's semantics or signature; the use of the reserved posix_ namespace allows pre-existing implementations to support pre-existing applications without conflicting with the requirements of the standard. The committee generally doesn't do this when all implementations agree on the name (or when it's just making stuff up, as it sometimes does). If I were asked what color this bikeshed should be, I would suggest that the most standard-compliant thing to do would be to name the public interface according to the standard, but I would not object to a set of macros which provided unprefixed names iff __BSD_VISIBLE. That way, use of the official POSIX interface does not depend on namespace pollution. (But this discussion should probably be taking place on standards@ rather than arch@.) -GAWollman -- Garrett A. Wollman | What intellectual phenomenon can be older, or more oft wollman@bimajority.org| repeated, than the story of a large research program Opinions not shared by| that impaled itself upon a false central assumption my employers. | accepted by all practitioners? - S.J. Gould, 1993 From owner-freebsd-arch@FreeBSD.ORG Tue Nov 1 00:32:48 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01BDF1065670; Tue, 1 Nov 2011 00:32:48 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id A25468FC13; Tue, 1 Nov 2011 00:32:47 +0000 (UTC) Received: by vws11 with SMTP id 11so126312vws.13 for ; Mon, 31 Oct 2011 17:32:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=H6IvrzQJJChKUA4Oj6D0c35Uzx/AN3p6g/zwVjx5zsI=; b=jkGEA9MXrwgGhkvEoyvMpPPs8kF4MYvys+Q2HFhc8q1AKs2MJLA1bFTKH9yKfXUXPc KeOyD9XEosw9cB+5ztEnMdPBRT2ff4AszBMoaLPv+jsF5dy6/QQcPsf0q0VfzCbu5GkR RujRtJ6KnfrbifOdNKrb7ehhJtP8bGO9aHWps= MIME-Version: 1.0 Received: by 10.52.36.237 with SMTP id t13mr6151153vdj.45.1320107567014; Mon, 31 Oct 2011 17:32:47 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.52.164.101 with HTTP; Mon, 31 Oct 2011 17:32:46 -0700 (PDT) In-Reply-To: <4EAF1F39.1090008@FreeBSD.org> References: <201110281426.00013.jhb@freebsd.org> <201110311024.07580.jhb@freebsd.org> <20111031190359.GP2258@hoeg.nl> <201110311717.53476.jhb@freebsd.org> <20111031221627.GR2258@hoeg.nl> <4EAF1F39.1090008@FreeBSD.org> Date: Mon, 31 Oct 2011 17:32:46 -0700 X-Google-Sender-Auth: zPif2lHdC5z8HEWK8gvrnye0Tso Message-ID: From: Adrian Chadd To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Cc: Ed Schouten , Jilles Tjoelker , arch@freebsd.org Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Nov 2011 00:32:48 -0000 On 31 October 2011 15:20, Doug Barton wrote: > On 10/31/2011 15:16, Ed Schouten wrote: >> What if we implement everything using the POSIX naming scheme, but put >> this in : > > My concern about that is that we're teaching people who start learning > programming with our sources to do non-standard stuff. .. if that keeps them on FreeBSD, what's wrong with that? :) It'd be fun to see the foot on the other shoe for a change. :) Adrian From owner-freebsd-arch@FreeBSD.ORG Tue Nov 1 09:31:23 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7ED09106566C for ; Tue, 1 Nov 2011 09:31:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id CDBB68FC17 for ; Tue, 1 Nov 2011 09:31:22 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id pA197Drf086477 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 1 Nov 2011 11:07:13 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id pA197DIG028011; Tue, 1 Nov 2011 11:07:13 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id pA197D8N028010; Tue, 1 Nov 2011 11:07:13 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 1 Nov 2011 11:07:13 +0200 From: Kostik Belousov To: John Baldwin Message-ID: <20111101090713.GQ50300@deviant.kiev.zoral.com.ua> References: <201110281426.00013.jhb@freebsd.org> <201110311024.07580.jhb@freebsd.org> <20111031190359.GP2258@hoeg.nl> <201110311717.53476.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="X/PGvStDRQdSxCB6" Content-Disposition: inline In-Reply-To: <201110311717.53476.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean Cc: Ed Schouten , Jilles Tjoelker , arch@freebsd.org Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Nov 2011 09:31:23 -0000 --X/PGvStDRQdSxCB6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 31, 2011 at 05:17:53PM -0400, John Baldwin wrote: > That said, I can update the patch to use the ugly name. Can someone else= =20 > volunteer to implement a VOP_ADVISE() for UFS that actually does the read- > ahead (for FADV_WILLNEED) (or for other filesystems for that matter). ZF= S=20 > might need to use a custom FADV_DONTNEED as well. I can look at this later, probably after you commit the existing stuff into svn. --X/PGvStDRQdSxCB6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk6vtsEACgkQC3+MBN1Mb4j6bACfZxczRgWtXzX1OeG4uJD/FzcI 9aUAoIsroxnDqDG5F2BtRcnAQ/7DW51b =obIP -----END PGP SIGNATURE----- --X/PGvStDRQdSxCB6-- From owner-freebsd-arch@FreeBSD.ORG Tue Nov 1 14:01:53 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1714D106566B for ; Tue, 1 Nov 2011 14:01:53 +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 E23238FC18 for ; Tue, 1 Nov 2011 14:01:52 +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 998BE46B45; Tue, 1 Nov 2011 10:01:52 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0059F8A037; Tue, 1 Nov 2011 10:01:52 -0400 (EDT) From: John Baldwin To: Ed Schouten Date: Tue, 1 Nov 2011 10:01:42 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: <201110281426.00013.jhb@freebsd.org> <201110311717.53476.jhb@freebsd.org> <20111031221627.GR2258@hoeg.nl> In-Reply-To: <20111031221627.GR2258@hoeg.nl> MIME-Version: 1.0 Message-Id: <201111011001.42775.jhb@freebsd.org> Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 01 Nov 2011 10:01:52 -0400 (EDT) Cc: arch@freebsd.org, Jilles Tjoelker Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Nov 2011 14:01:53 -0000 On Monday, October 31, 2011 6:16:27 pm Ed Schouten wrote: > Hi John, > > * John Baldwin , 20111031 22:17: > > I also really do think that posix_*() truly is far uglier to read. In the > > worst case, imagine something like this: > > > > char *cp; > > > > cp = posix_malloc(posix_strlen(some_string) + 1); > > posix_strcpy(cp, s); > > posix_printf("%s\n", cp); > > > > *blech* > > I do agree it's ugly, but at least it's standardized. The fact is that > it's easier to explain to someone "this code doesn't build on $NONBSD, > because $NONBSD lacks POSIX conformance" than saying "this code doesn't > build on $NONBSD because it uses BSD-specific crap". As I mentioned > previously, there is no fadvise() on Linux. There's no gain in > compatibility by implementing it -- it's just syntactic sugar. Hmmm, there is an fadvise(2) manpage. I had presumed from that it was a public interface. -- John Baldwin From owner-freebsd-arch@FreeBSD.ORG Tue Nov 1 14:23:39 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26725106564A for ; Tue, 1 Nov 2011 14:23:39 +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 E65358FC17 for ; Tue, 1 Nov 2011 14:23:38 +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 9AFCA46B0D; Tue, 1 Nov 2011 10:23:38 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 2B2BD8A02E; Tue, 1 Nov 2011 10:23:38 -0400 (EDT) From: John Baldwin To: freebsd-arch@freebsd.org, Jilles Tjoelker Date: Tue, 1 Nov 2011 10:23:37 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: <201110281426.00013.jhb@freebsd.org> <20111031221627.GR2258@hoeg.nl> <201111011001.42775.jhb@freebsd.org> In-Reply-To: <201111011001.42775.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201111011023.37688.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 01 Nov 2011 10:23:38 -0400 (EDT) Cc: Ed Schouten Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Nov 2011 14:23:39 -0000 On Tuesday, November 01, 2011 10:01:42 am John Baldwin wrote: > On Monday, October 31, 2011 6:16:27 pm Ed Schouten wrote: > > Hi John, > > > > * John Baldwin , 20111031 22:17: > > > I also really do think that posix_*() truly is far uglier to read. In the > > > worst case, imagine something like this: > > > > > > char *cp; > > > > > > cp = posix_malloc(posix_strlen(some_string) + 1); > > > posix_strcpy(cp, s); > > > posix_printf("%s\n", cp); > > > > > > *blech* > > > > I do agree it's ugly, but at least it's standardized. The fact is that > > it's easier to explain to someone "this code doesn't build on $NONBSD, > > because $NONBSD lacks POSIX conformance" than saying "this code doesn't > > build on $NONBSD because it uses BSD-specific crap". As I mentioned > > previously, there is no fadvise() on Linux. There's no gain in > > compatibility by implementing it -- it's just syntactic sugar. > > Hmmm, there is an fadvise(2) manpage. I had presumed from that it was > a public interface. A reworked patch is at www.freebsd.org/~jhb/patches/posix_fadvise.patch A universe build is going. I also noticed we currently use stubs for the linux fadvise() system call. Once this is in we should be able to replace the stubs with calls to the new system call instead. -- John Baldwin From owner-freebsd-arch@FreeBSD.ORG Tue Nov 1 14:36:55 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2232C1065670; Tue, 1 Nov 2011 14:36:55 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [178.63.0.170]) by mx1.freebsd.org (Postfix) with ESMTP id D78128FC24; Tue, 1 Nov 2011 14:36:54 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 8E5202A28CDB; Tue, 1 Nov 2011 15:19:37 +0100 (CET) Date: Tue, 1 Nov 2011 15:19:37 +0100 From: Ed Schouten To: John Baldwin Message-ID: <20111101141937.GV2258@hoeg.nl> References: <201110281426.00013.jhb@freebsd.org> <201110311717.53476.jhb@freebsd.org> <20111031221627.GR2258@hoeg.nl> <201111011001.42775.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aZ/0/p6gSDXwzas7" Content-Disposition: inline In-Reply-To: <201111011001.42775.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: arch@freebsd.org, Jilles Tjoelker Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Nov 2011 14:36:55 -0000 --aZ/0/p6gSDXwzas7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi John, * John Baldwin , 20111101 15:01: > Hmmm, there is an fadvise(2) manpage. I had presumed from that it was > a public interface. That's interesting. What kind of distro/version are you using? I'm using libc6-2.13-20ubuntu5 from Ubuntu 11.10 (amd64). --=20 Ed Schouten WWW: http://80386.nl/ --aZ/0/p6gSDXwzas7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJOr//5AAoJEG5e2P40kaK7cCsP/3FiB3PJsxjcqy/xbTAqggCm QjmZ7PEIKZ3KsMIW14NHy4dz3neFiYkCSB2beiB+p+jHc+PgEBQYiWTnnHzaznMg dzgXgXyC41ZZhDyG2w+8VnP42KFGErxdMlpeX8Rec+AzUcBQQJ4D68QyqB/StSsR Rq5chdpZUtezG7qX6D5ZkgLdUlxObsRpF+DFFLRqAg6UQvptw/BoPNLkHnr4fE+P cduy30pLAVHieDSHcl6HxBAdp6YrOPjFq0rC7vpg5n46PyWe2TDea+fyu3BVmD7p ICQ33FPUAntgoWk2V8XA+Fv9P9k9wLSSPdFwS/UdBUHIXxcclSlkDCPfPzXNGiaG zBlmUjONIH+xOgipu4rMvUbq8lRpMZ146e3DnGa0mCvAnkh9Dh99RZT/Kg9B+pgW 46w8zKEyApdlSACVc/2Kcs0aiCYtNocodrn4qXvoqpjaYbkBY31XL/x3kvSBtR/w YHn/TpqySVagSwkX/WyIdIssV3IbGOfhqL6qrN0/s/E0vkiDxRRyKNZO/KSyib4l qWRfnSqs9eAeW+5nWg9eRN8NZ38l6BcFsa4qJigEwbGHQ9PM+Z+W+cXTMNYwEC9V 6Q9NyeRuBSVeu+wZQp5ckaeYZb/sUrBj+wVv4qkWzjCsSBt7hd+Oo4olmcx1gCxh azN50ycDHWrH42X6YFMv =wx3t -----END PGP SIGNATURE----- --aZ/0/p6gSDXwzas7-- From owner-freebsd-arch@FreeBSD.ORG Tue Nov 1 18:19:12 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95E1D1065692 for ; Tue, 1 Nov 2011 18:19:12 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4F0308FC15 for ; Tue, 1 Nov 2011 18:19:12 +0000 (UTC) Received: by vcbfk26 with SMTP id fk26so3236707vcb.13 for ; Tue, 01 Nov 2011 11:19:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=j1GguU4cXwVbRUAhaVjetobPx/oDGg8wk0xSOIZJEa0=; b=CWO9aXOoDTElZziJNF0+GjZ7gmWd9apobsZx5WGTvlt9+OOwi3Lfh6R2ZD/hTIxeBu 6pvE3XkZga2t1EJKkiD9aCpp4nuU3UUs2/9NbpzKNuUNpn2siHxpmpnkbKoj7WNk5nZP BxxU0f3MXmLPkVG/4LwC8FBlVwTFF6RaP2wWA= MIME-Version: 1.0 Received: by 10.220.7.72 with SMTP id c8mr38290vcc.149.1320169652686; Tue, 01 Nov 2011 10:47:32 -0700 (PDT) Received: by 10.221.13.130 with HTTP; Tue, 1 Nov 2011 10:47:32 -0700 (PDT) In-Reply-To: <20111101141937.GV2258@hoeg.nl> References: <201110281426.00013.jhb@freebsd.org> <201110311717.53476.jhb@freebsd.org> <20111031221627.GR2258@hoeg.nl> <201111011001.42775.jhb@freebsd.org> <20111101141937.GV2258@hoeg.nl> Date: Tue, 1 Nov 2011 10:47:32 -0700 Message-ID: From: Peter Wemm To: Ed Schouten Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: arch@freebsd.org, Jilles Tjoelker Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Nov 2011 18:19:12 -0000 On Tue, Nov 1, 2011 at 7:19 AM, Ed Schouten wrote: > Hi John, > > * John Baldwin , 20111101 15:01: >> Hmmm, there is an fadvise(2) manpage. =A0I had presumed from that it was >> a public interface. > > That's interesting. What kind of distro/version are you using? I'm using > libc6-2.13-20ubuntu5 from Ubuntu 11.10 (amd64). Don't forget that the Linux kernel syscalls are not automatically published to userland like ours are. glibc is (usually) very deliberate about what symbols it publishes, what macros it defines in its #include mess, and so on. Just because a syscall is called "fadvise" in the kernel doesn't mean the userland part is fadvise as well, if it even exists. Heck, even glibc might not assume the syscall exists in the kernel. eg: mrename() and so on. eg: lseek vs llseek and all the syscall64 variants. Bottom line(s): 1) Is this a standardized symbol? 2) Is it used in other OS's? 3) Do the implementations vary? If it exists in a widely used linux, it counts a lot as a "defacto" standardized defintion. Also, does autoconf/automake have stubs to check for it? and so on. --=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell From owner-freebsd-arch@FreeBSD.ORG Tue Nov 1 18:33:29 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 757B7106564A for ; Tue, 1 Nov 2011 18:33:29 +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 4D6398FC0C for ; Tue, 1 Nov 2011 18:33:29 +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 DCFF046B45; Tue, 1 Nov 2011 14:33:28 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 7CE8B8A02E; Tue, 1 Nov 2011 14:33:28 -0400 (EDT) From: John Baldwin To: Ed Schouten Date: Tue, 1 Nov 2011 13:08:04 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: <201110281426.00013.jhb@freebsd.org> <201111011001.42775.jhb@freebsd.org> <20111101141937.GV2258@hoeg.nl> In-Reply-To: <20111101141937.GV2258@hoeg.nl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201111011308.05204.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 01 Nov 2011 14:33:28 -0400 (EDT) Cc: arch@freebsd.org, Jilles Tjoelker Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Nov 2011 18:33:29 -0000 On Tuesday, November 01, 2011 10:19:37 am Ed Schouten wrote: > Hi John, > > * John Baldwin , 20111101 15:01: > > Hmmm, there is an fadvise(2) manpage. I had presumed from that it was > > a public interface. > > That's interesting. What kind of distro/version are you using? I'm using > libc6-2.13-20ubuntu5 from Ubuntu 11.10 (amd64). I had found it via the web: http://linux.die.net/man/2/fadvise However, after further searching it appears to be stale (if you follow it's cross-reference to madvise(2), that page only has links to posix_fadvise() and not fadvise()). -- John Baldwin From owner-freebsd-arch@FreeBSD.ORG Tue Nov 1 23:56:54 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5200F106564A; Tue, 1 Nov 2011 23:56:54 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id D9ED08FC14; Tue, 1 Nov 2011 23:56:53 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id C1B54E653C; Tue, 1 Nov 2011 23:56:52 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cran.org.uk; h=message-id :date:from:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; s=mail; bh=oxnvR0BZH5aG 7dle0tMqTxG2VW8=; b=XDr/d0mEsUPA6IRpIBNGM7i8Rw8ntzrmbqGv3iaoo0kg j20UI23+FtJ2hrjguZ6hRFPkxCh5RmE6FeowVTHqBO36cg8WDx+89UiqgdtzA9Ie EbSb4RhJXudHT8Y96OVIb66C6t5Wc4jiiFRdkIRxvO8Yilae1OVNgWI99smuafY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=cran.org.uk; h=message-id :date:from:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; q=dns; s=mail; b=cz+vg4 rnE0WWWvj05XaaMK8ncq2b1DIJQ8ROeImoPBBkv0UjDDB+5gpBm+S0nYP8l46sgD 3Y7eNuGzZhZhKXAmPymTkuSAwxPQyqVKU2aIHc9KNEiFTtnliDYKP+qggQQtG6N+ YXpoIhX9ujWaFQw69QLVxHXfVTN8ZlUBs4N/Y= Received: from [192.168.1.68] (188-220-36-32.zone11.bethere.co.uk [188.220.36.32]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id 957A7E653B; Tue, 1 Nov 2011 23:56:52 +0000 (GMT) Message-ID: <4EB08740.8010601@cran.org.uk> Date: Tue, 01 Nov 2011 23:56:48 +0000 From: Bruce Cran User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: John Baldwin References: <201110281426.00013.jhb@freebsd.org> <201111011001.42775.jhb@freebsd.org> <20111101141937.GV2258@hoeg.nl> <201111011308.05204.jhb@freebsd.org> In-Reply-To: <201111011308.05204.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: Ed Schouten , Jilles Tjoelker , arch@freebsd.org Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Nov 2011 23:56:54 -0000 On 01/11/2011 17:08, John Baldwin wrote: > I had found it via the web: http://linux.die.net/man/2/fadvise > However, after further searching it appears to be stale (if you follow > it's cross-reference to madvise(2), that page only has links to > posix_fadvise() and not fadvise()). There's http://www.speedware.com/HPe3000_resources/MPE_to_HP-UX_cross-reference/system_administration_cross-reference/cmd.html?cmdid=MS_1800 for HP-UX ("*fadvise()* was derived by HP from the IEEE POSIX 1003.1-2001 Standard"), though it also has posix_fadvise. -- Bruce Cran From owner-freebsd-arch@FreeBSD.ORG Wed Nov 2 18:05:01 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B512A106564A for ; Wed, 2 Nov 2011 18:05:01 +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 869518FC41 for ; Wed, 2 Nov 2011 18:05:01 +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 19A1146B46; Wed, 2 Nov 2011 14:05:01 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 8E1768A02E; Wed, 2 Nov 2011 14:05:00 -0400 (EDT) From: John Baldwin To: Bruce Cran Date: Wed, 2 Nov 2011 11:36:12 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: <201110281426.00013.jhb@freebsd.org> <201111011308.05204.jhb@freebsd.org> <4EB08740.8010601@cran.org.uk> In-Reply-To: <4EB08740.8010601@cran.org.uk> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201111021136.12629.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 02 Nov 2011 14:05:00 -0400 (EDT) Cc: Ed Schouten , Jilles Tjoelker , arch@freebsd.org Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Nov 2011 18:05:01 -0000 On Tuesday, November 01, 2011 7:56:48 pm Bruce Cran wrote: > On 01/11/2011 17:08, John Baldwin wrote: > > I had found it via the web: http://linux.die.net/man/2/fadvise > > However, after further searching it appears to be stale (if you follow > > it's cross-reference to madvise(2), that page only has links to > > posix_fadvise() and not fadvise()). > > There's > http://www.speedware.com/HPe3000_resources/MPE_to_HP-UX_cross- reference/system_administration_cross-reference/cmd.html?cmdid=MS_1800 > for HP-UX ("*fadvise()* was derived by HP from the IEEE POSIX > 1003.1-2001 Standard"), though it also has posix_fadvise. Hmm, that one actually has an extra argument. I'll just go with posix_fadvise() for now. Interesting that HP lets you OR together two policies (so you can say both "I will access this file sequentially and with noreuse"). -- John Baldwin From owner-freebsd-arch@FreeBSD.ORG Wed Nov 2 18:11:42 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D42BE1065673; Wed, 2 Nov 2011 18:11:42 +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 6F4B48FC15; Wed, 2 Nov 2011 18:11:42 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 5F1491DD743; Wed, 2 Nov 2011 19:11:41 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 473D728468; Wed, 2 Nov 2011 19:11:41 +0100 (CET) Date: Wed, 2 Nov 2011 19:11:41 +0100 From: Jilles Tjoelker To: John Baldwin Message-ID: <20111102181140.GA21621@stack.nl> References: <201110281426.00013.jhb@freebsd.org> <20111029214057.GB90408@stack.nl> <201110311024.07580.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201110311024.07580.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: arch@freebsd.org Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Nov 2011 18:11:42 -0000 On Mon, Oct 31, 2011 at 10:24:07AM -0400, John Baldwin wrote: > > The comparisons > > + (fa->fa_start != 0 && fa->fa_start == end + 1) || > > + (uap->offset != 0 && fa->fa_end + 1 == uap->offset))) { > > should instead be something like > > + (end != OFF_MAX && fa->fa_start == end + 1) || > > + (fa->fa_end != OFF_MAX && fa->fa_end + 1 == uap->offset))) { > > to avoid integer overflow. > Hmm, but the expressions will still work in that case, yes? I already > check for uap->offset and uap->len being negative earlier (so fa_start > and fa_end are always positive), and off_t is signed, so if end is > OFF_MAX, then end + 1 will certainly not == fa_start? Signed integer overflow is undefined behaviour; therefore, if you write end + 1 without checking that end != OFF_MAX, the compiler may assume that end != OFF_MAX. Whether the compiler will take advantage of this in ways that cause breakage is another question. For example, if there were a subsequent check for end != OFF_MAX, the compiler would be allowed to remove that check. I think it is best not to risk it. -- Jilles Tjoelker From owner-freebsd-arch@FreeBSD.ORG Wed Nov 2 19:22:45 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48F761065677 for ; Wed, 2 Nov 2011 19:22:45 +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 211428FC15 for ; Wed, 2 Nov 2011 19:22:45 +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 AFFCF46B0A; Wed, 2 Nov 2011 15:22:44 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 4D9708A02E; Wed, 2 Nov 2011 15:22:44 -0400 (EDT) From: John Baldwin To: Jilles Tjoelker Date: Wed, 2 Nov 2011 14:21:59 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: <201110281426.00013.jhb@freebsd.org> <201110311024.07580.jhb@freebsd.org> <20111102181140.GA21621@stack.nl> In-Reply-To: <20111102181140.GA21621@stack.nl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201111021421.59542.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 02 Nov 2011 15:22:44 -0400 (EDT) Cc: arch@freebsd.org Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Nov 2011 19:22:45 -0000 On Wednesday, November 02, 2011 2:11:41 pm Jilles Tjoelker wrote: > On Mon, Oct 31, 2011 at 10:24:07AM -0400, John Baldwin wrote: > > > The comparisons > > > > + (fa->fa_start != 0 && fa->fa_start == end + 1) || > > > + (uap->offset != 0 && fa->fa_end + 1 == uap->offset))) { > > > > should instead be something like > > > > + (end != OFF_MAX && fa->fa_start == end + 1) || > > > + (fa->fa_end != OFF_MAX && fa->fa_end + 1 == uap->offset))) { > > > > to avoid integer overflow. > > > Hmm, but the expressions will still work in that case, yes? I already > > check for uap->offset and uap->len being negative earlier (so fa_start > > and fa_end are always positive), and off_t is signed, so if end is > > OFF_MAX, then end + 1 will certainly not == fa_start? > > Signed integer overflow is undefined behaviour; therefore, if you write > end + 1 without checking that end != OFF_MAX, the compiler may assume > that end != OFF_MAX. Whether the compiler will take advantage of this in > ways that cause breakage is another question. For example, if there were > a subsequent check for end != OFF_MAX, the compiler would be allowed to > remove that check. I think it is best not to risk it. Ok. -- John Baldwin From owner-freebsd-arch@FreeBSD.ORG Wed Nov 2 20:36:55 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABAD2106567D; Wed, 2 Nov 2011 20:36:55 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 9A2DA8FC12; Wed, 2 Nov 2011 20:36:55 +0000 (UTC) Received: by elvis.mu.org (Postfix, from userid 1192) id 237DF1A3C40; Wed, 2 Nov 2011 13:20:16 -0700 (PDT) Date: Wed, 2 Nov 2011 13:20:15 -0700 From: Alfred Perlstein To: John Baldwin Message-ID: <20111102202015.GQ6110@elvis.mu.org> References: <201110281426.00013.jhb@freebsd.org> <201111011308.05204.jhb@freebsd.org> <4EB08740.8010601@cran.org.uk> <201111021136.12629.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201111021136.12629.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: Bruce Cran , Ed Schouten , Jilles Tjoelker , arch@freebsd.org Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Nov 2011 20:36:55 -0000 * John Baldwin [111102 11:05] wrote: > On Tuesday, November 01, 2011 7:56:48 pm Bruce Cran wrote: > > On 01/11/2011 17:08, John Baldwin wrote: > > > I had found it via the web: http://linux.die.net/man/2/fadvise > > > However, after further searching it appears to be stale (if you follow > > > it's cross-reference to madvise(2), that page only has links to > > > posix_fadvise() and not fadvise()). > > > > There's > > http://www.speedware.com/HPe3000_resources/MPE_to_HP-UX_cross- > reference/system_administration_cross-reference/cmd.html?cmdid=MS_1800 > > for HP-UX ("*fadvise()* was derived by HP from the IEEE POSIX > > 1003.1-2001 Standard"), though it also has posix_fadvise. > > Hmm, that one actually has an extra argument. I'll just go with > posix_fadvise() for now. Interesting that HP lets you OR together > two policies (so you can say both "I will access this file sequentially > and with noreuse"). Makes sense for gzip/tar. -- - Alfred Perlstein .- VMOA #5191, 03 vmax, 92 gs500, 85 ch250, 07 zx10 .- FreeBSD committer From owner-freebsd-arch@FreeBSD.ORG Fri Nov 4 02:38:35 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 064B01065672; Fri, 4 Nov 2011 02:38:35 +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 CD6E98FC13; Fri, 4 Nov 2011 02:38:34 +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 6143546B2A; Thu, 3 Nov 2011 22:38:34 -0400 (EDT) Received: from John-Baldwins-MacBook-Air.local (64-71-23-226.static.wiline.com [64.71.23.226]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 224858A02E; Thu, 3 Nov 2011 22:38:32 -0400 (EDT) Message-ID: <4EB2C9DD.9090606@FreeBSD.org> Date: Thu, 03 Nov 2011 10:05:33 -0700 From: John Baldwin User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Alfred Perlstein References: <201110281426.00013.jhb@freebsd.org> <201111011308.05204.jhb@freebsd.org> <4EB08740.8010601@cran.org.uk> <201111021136.12629.jhb@freebsd.org> <20111102202015.GQ6110@elvis.mu.org> In-Reply-To: <20111102202015.GQ6110@elvis.mu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Thu, 03 Nov 2011 22:38:33 -0400 (EDT) Cc: Bruce Cran , Ed Schouten , Jilles Tjoelker , arch@freebsd.org Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Nov 2011 02:38:35 -0000 On 11/2/11 1:20 PM, Alfred Perlstein wrote: > * John Baldwin [111102 11:05] wrote: >> On Tuesday, November 01, 2011 7:56:48 pm Bruce Cran wrote: >>> On 01/11/2011 17:08, John Baldwin wrote: >>>> I had found it via the web: http://linux.die.net/man/2/fadvise >>>> However, after further searching it appears to be stale (if you follow >>>> it's cross-reference to madvise(2), that page only has links to >>>> posix_fadvise() and not fadvise()). >>> >>> There's >>> http://www.speedware.com/HPe3000_resources/MPE_to_HP-UX_cross- >> reference/system_administration_cross-reference/cmd.html?cmdid=MS_1800 >>> for HP-UX ("*fadvise()* was derived by HP from the IEEE POSIX >>> 1003.1-2001 Standard"), though it also has posix_fadvise. >> >> Hmm, that one actually has an extra argument. I'll just go with >> posix_fadvise() for now. Interesting that HP lets you OR together >> two policies (so you can say both "I will access this file sequentially >> and with noreuse"). > > Makes sense for gzip/tar. Ehh, quite possibly not for something that generic. I think you only want to do this if you have very specific knowledge about your access pattern, and I do not think they are generically applicable. -- John Baldwin From owner-freebsd-arch@FreeBSD.ORG Fri Nov 4 16:03:20 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE9571065781; Fri, 4 Nov 2011 16:03:20 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 9CABB8FC1E; Fri, 4 Nov 2011 16:03:20 +0000 (UTC) Received: by elvis.mu.org (Postfix, from userid 1192) id 54CC21A3D28; Fri, 4 Nov 2011 09:03:20 -0700 (PDT) Date: Fri, 4 Nov 2011 09:03:20 -0700 From: Alfred Perlstein To: John Baldwin Message-ID: <20111104160319.GD6110@elvis.mu.org> References: <201110281426.00013.jhb@freebsd.org> <201111011308.05204.jhb@freebsd.org> <4EB08740.8010601@cran.org.uk> <201111021136.12629.jhb@freebsd.org> <20111102202015.GQ6110@elvis.mu.org> <4EB2C9DD.9090606@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4EB2C9DD.9090606@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: Bruce Cran , Ed Schouten , Jilles Tjoelker , arch@freebsd.org Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Nov 2011 16:03:20 -0000 * John Baldwin [111103 19:38] wrote: > On 11/2/11 1:20 PM, Alfred Perlstein wrote: > >* John Baldwin [111102 11:05] wrote: > >>On Tuesday, November 01, 2011 7:56:48 pm Bruce Cran wrote: > >>>On 01/11/2011 17:08, John Baldwin wrote: > >>>>I had found it via the web: http://linux.die.net/man/2/fadvise > >>>>However, after further searching it appears to be stale (if you follow > >>>>it's cross-reference to madvise(2), that page only has links to > >>>>posix_fadvise() and not fadvise()). > >>> > >>>There's > >>>http://www.speedware.com/HPe3000_resources/MPE_to_HP-UX_cross- > >>reference/system_administration_cross-reference/cmd.html?cmdid=MS_1800 > >>>for HP-UX ("*fadvise()* was derived by HP from the IEEE POSIX > >>>1003.1-2001 Standard"), though it also has posix_fadvise. > >> > >>Hmm, that one actually has an extra argument. I'll just go with > >>posix_fadvise() for now. Interesting that HP lets you OR together > >>two policies (so you can say both "I will access this file sequentially > >>and with noreuse"). > > > >Makes sense for gzip/tar. > > Ehh, quite possibly not for something that generic. I think you only > want to do this if you have very specific knowledge about your access > pattern, and I do not think they are generically applicable. You often spend time untarring the same tarball over and over in your workflow John? -- - Alfred Perlstein .- VMOA #5191, 03 vmax, 92 gs500, 85 ch250, 07 zx10 .- FreeBSD committer From owner-freebsd-arch@FreeBSD.ORG Fri Nov 4 17:19:58 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECEB3106566C; Fri, 4 Nov 2011 17:19:58 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9A01F8FC0C; Fri, 4 Nov 2011 17:19:58 +0000 (UTC) Received: by iabz21 with SMTP id z21so4427576iab.13 for ; Fri, 04 Nov 2011 10:19:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=l2OrSROLsIbeAZ105iOQX9ENmNbAgAey/+IpxKp4mYM=; b=O2DjuUpuirD1kpN1rOH86M0yUlrJR3ul1swlaPjtbUP4BIV2sxTR70BkgK4aAGyn1G unmSqRz650oWyxlhwBdShXpYr+mBZSpsbeGhhIh6mmmZJ5BOSRTzYWVzk21VySDR5Rld Pk7YGpg8K68c0vQN3BauHLxHdeMMA+DMEqBEA= Received: by 10.231.82.11 with SMTP id z11mr3847926ibk.77.1320427197227; Fri, 04 Nov 2011 10:19:57 -0700 (PDT) Received: from [10.55.5.15] (pos-ext.netapp.com. [198.95.226.40]) by mx.google.com with ESMTPS id jm11sm22926986ibb.1.2011.11.04.10.19.55 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Nov 2011 10:19:56 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Garrett Cooper In-Reply-To: <20111104160319.GD6110@elvis.mu.org> Date: Fri, 4 Nov 2011 10:19:52 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201110281426.00013.jhb@freebsd.org> <201111011308.05204.jhb@freebsd.org> <4EB08740.8010601@cran.org.uk> <201111021136.12629.jhb@freebsd.org> <20111102202015.GQ6110@elvis.mu.org> <4EB2C9DD.9090606@FreeBSD.org> <20111104160319.GD6110@elvis.mu.org> To: Alfred Perlstein X-Mailer: Apple Mail (2.1084) Cc: Bruce Cran , Ed Schouten , Jilles Tjoelker , John Baldwin , arch@freebsd.org Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Nov 2011 17:19:59 -0000 On Nov 4, 2011, at 9:03 AM, Alfred Perlstein wrote: > * John Baldwin [111103 19:38] wrote: >> On 11/2/11 1:20 PM, Alfred Perlstein wrote: >>> * John Baldwin [111102 11:05] wrote: >>>> On Tuesday, November 01, 2011 7:56:48 pm Bruce Cran wrote: >>>>> On 01/11/2011 17:08, John Baldwin wrote: >>>>>> I had found it via the web: http://linux.die.net/man/2/fadvise >>>>>> However, after further searching it appears to be stale (if you = follow >>>>>> it's cross-reference to madvise(2), that page only has links to >>>>>> posix_fadvise() and not fadvise()). >>>>>=20 >>>>> There's >>>>> http://www.speedware.com/HPe3000_resources/MPE_to_HP-UX_cross- >>>> = reference/system_administration_cross-reference/cmd.html?cmdid=3DMS_1800 >>>>> for HP-UX ("*fadvise()* was derived by HP from the IEEE POSIX >>>>> 1003.1-2001 Standard"), though it also has posix_fadvise. >>>>=20 >>>> Hmm, that one actually has an extra argument. I'll just go with >>>> posix_fadvise() for now. Interesting that HP lets you OR together >>>> two policies (so you can say both "I will access this file = sequentially >>>> and with noreuse"). >>>=20 >>> Makes sense for gzip/tar. >>=20 >> Ehh, quite possibly not for something that generic. I think you only >> want to do this if you have very specific knowledge about your access >> pattern, and I do not think they are generically applicable. >=20 > You often spend time untarring the same tarball over and over=20 > in your workflow John? This is starting to sound like something that libarchive / pkg_install = would benefit from (jkh pkg_install or pkgng). -Garrett= From owner-freebsd-arch@FreeBSD.ORG Fri Nov 4 17:47:52 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 291B41065673; Fri, 4 Nov 2011 17:47:52 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 147FD8FC13; Fri, 4 Nov 2011 17:47:51 +0000 (UTC) Received: by elvis.mu.org (Postfix, from userid 1192) id 8BEE71A3D29; Fri, 4 Nov 2011 10:47:51 -0700 (PDT) Date: Fri, 4 Nov 2011 10:47:51 -0700 From: Alfred Perlstein To: Garrett Cooper Message-ID: <20111104174751.GH6110@elvis.mu.org> References: <201110281426.00013.jhb@freebsd.org> <201111011308.05204.jhb@freebsd.org> <4EB08740.8010601@cran.org.uk> <201111021136.12629.jhb@freebsd.org> <20111102202015.GQ6110@elvis.mu.org> <4EB2C9DD.9090606@FreeBSD.org> <20111104160319.GD6110@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: Bruce Cran , Ed Schouten , Jilles Tjoelker , John Baldwin , arch@freebsd.org Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Nov 2011 17:47:52 -0000 * Garrett Cooper [111104 10:19] wrote: > On Nov 4, 2011, at 9:03 AM, Alfred Perlstein wrote: > > > * John Baldwin [111103 19:38] wrote: > >> On 11/2/11 1:20 PM, Alfred Perlstein wrote: > >>> * John Baldwin [111102 11:05] wrote: > >>>> On Tuesday, November 01, 2011 7:56:48 pm Bruce Cran wrote: > >>>>> On 01/11/2011 17:08, John Baldwin wrote: > >>>>>> I had found it via the web: http://linux.die.net/man/2/fadvise > >>>>>> However, after further searching it appears to be stale (if you follow > >>>>>> it's cross-reference to madvise(2), that page only has links to > >>>>>> posix_fadvise() and not fadvise()). > >>>>> > >>>>> There's > >>>>> http://www.speedware.com/HPe3000_resources/MPE_to_HP-UX_cross- > >>>> reference/system_administration_cross-reference/cmd.html?cmdid=MS_1800 > >>>>> for HP-UX ("*fadvise()* was derived by HP from the IEEE POSIX > >>>>> 1003.1-2001 Standard"), though it also has posix_fadvise. > >>>> > >>>> Hmm, that one actually has an extra argument. I'll just go with > >>>> posix_fadvise() for now. Interesting that HP lets you OR together > >>>> two policies (so you can say both "I will access this file sequentially > >>>> and with noreuse"). > >>> > >>> Makes sense for gzip/tar. > >> > >> Ehh, quite possibly not for something that generic. I think you only > >> want to do this if you have very specific knowledge about your access > >> pattern, and I do not think they are generically applicable. > > > > You often spend time untarring the same tarball over and over > > in your workflow John? > > This is starting to sound like something that libarchive / pkg_install would benefit from (jkh pkg_install or pkgng). > -Garrett It seems a no brainer to flip the bit on when reading an archive that's as large as main memory. It's annoying to untar something, then have my box have to page back in all programs. -- - Alfred Perlstein .- VMOA #5191, 03 vmax, 92 gs500, 85 ch250, 07 zx10 .- FreeBSD committer