From owner-freebsd-fs@FreeBSD.ORG Fri Mar 26 18:45:59 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAB161065673; Fri, 26 Mar 2010 18:45:59 +0000 (UTC) (envelope-from swhetzel@gmail.com) Received: from mail-iw0-f183.google.com (mail-iw0-f183.google.com [209.85.223.183]) by mx1.freebsd.org (Postfix) with ESMTP id 618408FC14; Fri, 26 Mar 2010 18:45:59 +0000 (UTC) Received: by iwn13 with SMTP id 13so6917015iwn.14 for ; Fri, 26 Mar 2010 11:45:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=npSCHa0URS1HJZGkQAB3UtgbNSH5NfpEWdqor/Mw9V0=; b=lJHJVw0G94g8VS4szM8XttDGm/C7ErEV54JfYEtmBbOjCRjcooRpiVEHO1IScjb4EM 2jTU9K7ttEStTprPs99ce1dQ9V9lrDd3sZH7ABT++B7x2o8mdUBx0WKdoTLquJ0NiVT8 GS+CVy5mL8QuchIEC5YJ8/0EcueTG0oCGGXqw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=o1oWkEfLBQILx6PIOK+JQoCRzJcR2izxE4PWC+VavlS0j4SHjM1z34vJAzSTnn2Djz kL4AzU3yDkZnVrapOHGceeKoYaXsQsHN+fBBuoUGqQGiRrghmoGZElH7RLW+c/2aVD2t y7whKDn71eGWy32PuLy68MudOMWJhUU5fnXu8= MIME-Version: 1.0 Received: by 10.231.17.199 with HTTP; Fri, 26 Mar 2010 11:21:41 -0700 (PDT) In-Reply-To: <20100326161539.GA10618@icarus.home.lan> References: <4BACB3F5.7010905@freebsd.org> <201003261528.o2QFSAuI037251@chez.mckusick.com> <20100326161539.GA10618@icarus.home.lan> Date: Fri, 26 Mar 2010 13:21:41 -0500 Received: by 10.231.153.205 with SMTP id l13mr576702ibw.64.1269627701340; Fri, 26 Mar 2010 11:21:41 -0700 (PDT) Message-ID: <790a9fff1003261121p5d72e74bw61d0a66a7d418aae@mail.gmail.com> From: Scot Hetzel To: Jeremy Chadwick Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Kirk McKusick , freebsd-fs@freebsd.org, Andriy Gapon , freebsd-geom@freebsd.org Subject: Re: g_vfs_open and bread(devvp, ...) X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2010 18:45:59 -0000 On Fri, Mar 26, 2010 at 11:15 AM, Jeremy Chadwick wrote: > On Fri, Mar 26, 2010 at 08:28:10AM -0700, Kirk McKusick wrote: >> I have reviewed your change and I believe that your analysis is >> correct. I am in agreement with your making the change. >> >> As disk sector sizes will be growing in the near future, it would >> be desirable to get away from having DEV_BSIZE hard-coded. But as >> you note, that is a far bigger change than this one. > > I should note that they already have grown: Western Digital, as of a few > months ago, began shipping drives that use 4KByte sectors. =A0They're > known as the "EARS" drives, due to their model string ending with > "EARS": > > WD20EARS: http://www.wdc.com/en/products/Products.asp?DriveID=3D773 > WD15EARS: http://www.wdc.com/en/products/products.asp?driveid=3D772 > WD10EARS: http://www.wdc.com/en/products/products.asp?driveid=3D763 > > (I should warn folks these are Caviar Green drives, which may suffer > from excessive Load Cycles (parking/unparking actuator arm). =A0I don't > have one of these drives so I can't validate if the issue happens on > this model or not) > > A discussion and an including an incredibly cheesy video review are > below. =A0The video review does discuss the 4KB sector size, in addition > to jumpers that revert the drive to using 512-byte sectors for older > OSes such as Windows XP -- and presumably FreeBSD. > > http://www.tomshardware.com/reviews/wd-4k-sector,2554.html > http://www.youtube.com/watch?v=3DQeFj2QTaA3Y > After reviewing these links, my understanding of these drives that they still provide 512 Byte sectors to the O/S, but when they write to the drive, it will pack eight 512 Byte sectors into a 4K sector on the drive. When the drive needs to modify a sector it has to read the entire 4K sector before writing the change to the drive. This could lead to excessive Read-Modify-Writes if the partition is not aligned on a 4K sector as it will will reduce the performance of these drives. Each partition must be aligned to start and end on a 4K sector. The problem with Windows XP, is that it always creates the first partition starting at sector 63, which is not on a 4k boundary. When the jumpers are set, the drive adds 1 to all 512 byte sector request. For example, the OS asks for sector 63, the drive returns the contents of sector 64, thus forcing the alignment of the partitions to start at a 4K sector. The other option is to use the WD align program on Windows XP. This software re-aligns the partions and data so that they are aligned to the 4k sector. In order for FreeBSD to use these drives, you just need to ensure that all slices/partitions start at a 4k boundary. Scot