From owner-freebsd-geom@FreeBSD.ORG Thu Aug 11 09:52:38 2011 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 390AA1065700 for ; Thu, 11 Aug 2011 09:52:38 +0000 (UTC) (envelope-from dmitry.zamaruyev@zoral.com.ua) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id AC1878FC13 for ; Thu, 11 Aug 2011 09:52:37 +0000 (UTC) Received: from ghost.kharkov.zoral.com.ua ([10.3.1.250]) (authenticated bits=0) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p7B9qVLQ009848; Thu, 11 Aug 2011 12:52:32 +0300 (EEST) (envelope-from dmitry.zamaruyev@zoral.com.ua) Date: Thu, 11 Aug 2011 12:51:43 +0300 From: Dmitry Zamaruyev To: Dmitry Zamaruyev Message-ID: <20110811125143.6a70fb4a@ghost.kharkov.zoral.com.ua> In-Reply-To: <20110804130014.0df63364@ghost.kharkov.zoral.com.ua> References: <20110804130014.0df63364@ghost.kharkov.zoral.com.ua> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.22.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-102.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS,USER_IN_WHITELIST autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-geom@freebsd.org Subject: Re: SSD and gmirror X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2011 09:52:38 -0000 Having troubles using gmirror device with TRIM. Two SSDs on 8.2-STABLE, supports TRIM on device: # camcontrol identify ada1 pass1: ATA-8 SATA 2.x device pass1: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes) protocol ATA/ATAPI-8 SATA 2.x device model OCZ-VERTEX2 ... data set management (TRIM) yes And if I create UFS directly on SSD with TRIM enabled all goes OK (-E uses trim to erase SSD): # newfs -U -E -t /dev/ada1 /dev/ada1: 57241.9MB (117231408 sectors) block size 16384, fragment size 2048 using 312 cylinder groups of 183.72MB, 11758 blks, 23552 inodes. with soft updates Erasing sectors [128...117231407] super-block backups (for fsck -b #) at: 160, 376416, ..... # mount -t ufs /dev/ada1 /mnt But if I add device to gmirror, situation is different. Newfs passed ok (so TRIM call propagated to devices?), but mount complaints: # newfs -U -E -t /dev/mirror/gm0s1a=20 /dev/mirror/gm0s1a: 57239.9MB (117227312 sectors) block size 16384, fragment size 2048 using 312 cylinder groups of 183.72MB, 11758 blks, 23552 inodes. with soft updates Erasing sectors [128...117227311] super-block backups (for fsck -b #) at: 160, 376416, ........ # mount -t ufs /dev/mirror/gm0s1a /mnt WARNING: /mnt: TRIM flag on fs but cannot get whether disk supports TRIM If we look at UFS source, after such warning received - TRIM got disabled at FS level: ufs/ffs/ffs_vfsops.c: 996 if ((fs->fs_flags & FS_TRIM) !=3D 0) { 997 size =3D sizeof(int); 998 if (g_io_getattr("GEOM::candelete", cp, &size, 999 &ump->um_candelete) =3D=3D 0) { 1000 if (!ump->um_candelete) 1001 printf( 1002 "WARNING: %s: TRIM flag on fs but disk does not support TRIM\n", 1003 mp->mnt_stat.f_mntonname); 1004 } else { 1005 printf( 1006 "WARNING: %s: TRIM flag on fs but cannot get whether disk supports TR= IM\n", 1007 mp->mnt_stat.f_mntonname); 1008 ump->um_candelete =3D 0;=20 1009 } 1010 } How I could achieve that call g_io_getattr("GEOM::candelete"...) will retur= n without errors and stating that underlying disks support TRIM ? =D0=92 Thu, 4 Aug 2011 13:00:14 +0300 Dmitry Zamaruyev =D0=BF=D0=B8=D1=88=D0=B5= =D1=82: > Hello list, >=20 > I'm looking for clarification regarding gmirror/geom behavior in > current 8-STABLE. > I want to use couple of SSD drives in mirror RAID configuration with > UFS on top. I know that UFS now supports TRIM (BIO_DELETE) on plain > disks. > But will gmirror propagate BIO_DELETE event to lower driver, so both > SSDs will get trimmed when UFS issue this command? >=20 --=20 Best regards, Dmitry Zamaruyev, System administrator.