From owner-freebsd-fs@FreeBSD.ORG Tue Jun 26 14:03:43 2012 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 5AC321065670 for ; Tue, 26 Jun 2012 14:03:43 +0000 (UTC) (envelope-from prvs=1524ba8fc3=killing@multiplay.co.uk) Received: from mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) by mx1.freebsd.org (Postfix) with ESMTP id DE95C8FC1B for ; Tue, 26 Jun 2012 14:03:42 +0000 (UTC) X-Spam-Processed: mail1.multiplay.co.uk, Tue, 26 Jun 2012 15:03:33 +0100 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail1.multiplay.co.uk X-Spam-Level: X-Spam-Status: No, score=-5.0 required=6.0 tests=USER_IN_WHITELIST shortcircuit=ham autolearn=disabled version=3.2.5 Received: from r2d2 ([188.220.16.49]) by mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (MDaemon PRO v10.0.4) with ESMTP id md50020476468.msg for ; Tue, 26 Jun 2012 15:03:32 +0100 X-MDRemoteIP: 188.220.16.49 X-Return-Path: prvs=1524ba8fc3=killing@multiplay.co.uk X-Envelope-From: killing@multiplay.co.uk X-MDaemon-Deliver-To: freebsd-fs@FreeBSD.ORG Message-ID: <2194101A4F9946B496D921940B806486@multiplay.co.uk> From: "Steven Hartland" To: Date: Tue, 26 Jun 2012 15:04:20 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: Subject: ZFS using sectorsize instead of stripesize for ashift 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: Tue, 26 Jun 2012 14:03:43 -0000 We've been doing a lot test on ZFS with SSD's in particular around trim. During this we've added quirks for our SSD's to cam/scsi_da and was expecting this to ensure ZFS's ashift is set correctly for newly create pools, instead of having to use the gnop workaround. Unfortunately this doesn't seem to be the case as ZFS is using the geom providers sectorsize instead of stripesize as its minimum transfer size (ashift). The following patch corrects this behaviour so ZFS uses stripsize for ashift definition. So the question is this the correct thing to do? If so should any of the other usages of sectorsize be changes to stripesize as well? --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c.ashift 2012-06-26 13:38:55.193306961 +0000 +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c 2012-06-26 13:39:22.323019022 +0000 @@ -504,7 +504,7 @@ /* * Determine the device's minimum transfer size. */ - *ashift = highbit(MAX(pp->sectorsize, SPA_MINBLOCKSIZE)) - 1; + *ashift = highbit(MAX(pp->stripesize, SPA_MINBLOCKSIZE)) - 1; /* * Clear the nowritecache settings, so that on a vdev_reopen() Regards Steve ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 or return the E.mail to postmaster@multiplay.co.uk.