From owner-freebsd-stable@FreeBSD.ORG Thu Jan 26 14:30:53 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 084C5106566C for ; Thu, 26 Jan 2012 14:30:53 +0000 (UTC) (envelope-from ml@os2.kiev.ua) Received: from s1.sdv.com.ua (s1.sdv.com.ua [77.120.97.61]) by mx1.freebsd.org (Postfix) with ESMTP id 462438FC08 for ; Thu, 26 Jan 2012 14:30:52 +0000 (UTC) Received: from 94-105-243-80.cust.centrio.cz ([80.243.105.94] helo=[192.168.101.203]) by s1.sdv.com.ua with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1RqPkY-000NXt-KS for freebsd-stable@freebsd.org; Thu, 26 Jan 2012 15:52:31 +0200 Message-ID: <4F215A99.8020003@os2.kiev.ua> Date: Thu, 26 Jan 2012 14:52:25 +0100 From: Alex Samorukov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111229 Thunderbird/9.0 MIME-Version: 1.0 To: freebsd-stable@freebsd.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SA-Score: -1.0 Subject: disk devices speed is ugly X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 14:30:53 -0000 Hi, I ported exfat fuse module to FreeBSD (PR 164473) and found that it works much slower then on Linux. I found 2 reasons for this: 1) FreeBSD kernel do not allow to have nonalignment access to device with standard read/write commands. mmap to the entire disk (/dev/da0s1) doesn`t work also (EINVAL). When its not a big deal for read requests, for write it becomes a real issue - to write non-aligned data i need to read beginning and end of the block. So in fact for one write request i can get 2 reads. 2) It seems that there is a very simple read caching on such devices without write caching at all. It makes write performance enormously slow. I found geom_cache module, but it provides only read optimization. I decided to compare speed on Linux and FreeBSD and below are my results. I used old USB flash drive to do the tests. Read Speed of 100Mb: Linux 3.0.0: 22.7 Mb/sec FreeBSD: 10.22 Mb/sec FreeBSD + gcache: 18.75 Mb/sec (!) Write speed of 100Mb file: Linux: 90Mb/sec (cache, much higher then device speed) FreeBSD: 0.52 Mb/sec (!) FreeBSD + gcache: 0.52 Mb/sec As you could see write performance is enormously slow. May be we need to create some geom provider for such caching or i am missing something? I think, that other fuse modules like ntfs-3g and fuse-ext4 having same issue. Also i found that fuse4bsd itself is non stable and may crash the system without any visible reasons.