From owner-freebsd-hackers@FreeBSD.ORG Thu Mar 18 12:01:11 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2474E1065672 for ; Thu, 18 Mar 2010 12:01:11 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id D7DD88FC2C for ; Thu, 18 Mar 2010 12:01:10 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id B0C1E1FFC51; Thu, 18 Mar 2010 12:01:09 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 912E584495; Thu, 18 Mar 2010 13:01:09 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Matthew Dillon References: <86tysf58a2.fsf@ds4.des.no> <367b2c981003171112n785ea9d4q21d00b533819ca67@mail.gmail.com> <201003172023.o2HKNNbj069321@apollo.backplane.com> Date: Thu, 18 Mar 2010 13:01:09 +0100 In-Reply-To: <201003172023.o2HKNNbj069321@apollo.backplane.com> (Matthew Dillon's message of "Wed, 17 Mar 2010 13:23:23 -0700 (PDT)") Message-ID: <86y6hpj0u2.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: ATA 4K sector issues X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Mar 2010 12:01:11 -0000 Matthew Dillon writes: > We experimented a bit with aligning fdisk (dos slices) by changing the > sector offset to 2 but I came to the conclusion that it was better to > do the alignment in disklabel / gpt / whatever higher-level > partitioner floats your boat and not mess with anything the BIOS uses > to boot the machine Not sure what you mean by "changing the sector offset to 2", but the BIOS doesn't care where partitions start or end. It just obeys the partition table. > My recommendation is to use a 1MB physical base alignment. That's > what I adjusted DragonFly's disklabel64 to do. It's definitely best > to have the partitioner deal with it instead of having to mess around > manually because the partitioner can calculate the actual physical > alignment by querying the kernel's disk subsystem regardless of the > topology. The disk system doesn't necessarily know. Disks have been known to lie about their physical sector size. The best strategy is to consistently use a large alignment "just in case". Using a 4k or 8k or even 1M alignment has no negative impact on 512b disks (other than that it wastes a very small amount of disk space), but for a 4k disk or an SSD, it can make the difference between "dog slow" and "lightning fast". > * A variety of media already uses much larger physical block sizes. > MLC flash uses 128K and SLC uses 64K blocks. See the note below > on why this matters even though SSDs do write combining. Some SSDs do RAID0 internally and therefore have larger block sizes. ISTR the OCZ Vertex is made up of four SATA SSDs with a microcontroller in front. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no