From owner-freebsd-scsi@FreeBSD.ORG Sun Dec 1 19:45:44 2013 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E2FC6D6 for ; Sun, 1 Dec 2013 19:45:44 +0000 (UTC) Received: from pi.nmdps.net (pi.nmdps.net [109.61.102.5]) by mx1.freebsd.org (Postfix) with ESMTP id 08F73176D for ; Sun, 1 Dec 2013 19:45:43 +0000 (UTC) Received: from pi.nmdps.net (localhost [127.0.0.1]) (Authenticated sender: krichy@cflinux.hu) by pi.nmdps.net (Postfix) with ESMTPSA id 947D81E22; Sun, 1 Dec 2013 20:45:35 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Sun, 01 Dec 2013 20:45:33 +0100 From: krichy@cflinux.hu To: Steven Hartland Subject: Re: Fwd: Re: ssd for zfs In-Reply-To: References: <0b12c19b8832c72369ff7244d7231846@cflinux.hu> <81b87ca49aef7d88db1b4dbd5f7eb201@cflinux.hu> <923bc6b4aa9141e5e9a49ab76b3a18b5@cflinux.hu> Message-ID: <1de2afcd6b5c67053095ead706eff80d@cflinux.hu> X-Sender: krichy@cflinux.hu User-Agent: Roundcube Webmail/0.9.5 Cc: freebsd-scsi@freebsd.org X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Dec 2013 19:45:44 -0000 Dear scsi devs, This short diff may add such support for ata devices: diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c index cc28311..75486d1 100644 --- a/sys/cam/ata/ata_da.c +++ b/sys/cam/ata/ata_da.c @@ -94,6 +94,7 @@ typedef enum { typedef enum { ADA_Q_NONE = 0x00, ADA_Q_4K = 0x01, + ADA_Q_NO_SYNC_CACHE = 0x02, } ada_quirks; #define ADA_Q_BIT_STRING \ @@ -1243,7 +1244,7 @@ adaregister(struct cam_periph *periph, void *arg) softc->disk->d_maxsize = maxio; softc->disk->d_unit = periph->unit_number; softc->disk->d_flags = 0; - if (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) + if ((softc->flags & ADA_FLAG_CAN_FLUSHCACHE) && (softc->quirks & ADA_Q_NO_SYNC_CACHE) == 0) softc->disk->d_flags |= DISKFLAG_CANFLUSHCACHE; if (softc->flags & ADA_FLAG_CAN_TRIM) { softc->disk->d_flags |= DISKFLAG_CANDELETE; And with that I can add the SSD into both ata and scsi quirk list. Am I right? Regards, 2013-11-29 21:35 időpontban Steven Hartland ezt írta: > You could add a DA_Q_NO_SYNC_CACHE quirk for you device > which will prevent the cam layer attempting to call sync but this > will only work if its attached to a SCSI controller like an LSI there's > no such quirk currently implemented in ATA cam layer. > > Regards > Steve > ----- Original Message ----- From: > To: > Sent: Friday, November 29, 2013 8:17 PM > Subject: Re: Fwd: Re: ssd for zfs > > >> Dear scsi-devs, >> >> It seems that my device handles the flush commands slowly. The linux >> code avoids issuing this if the device reports its write cache is >> turned off. That way my SSD works fast under linux, but infortunately >> slow under FreeBSD. Actually I dont understand why is it slow for the >> flush command, as it has power-loss-protection, maybe for such a >> command it really flushes everything out, dont know. But when I enable >> the write cache in linux also, the block layer gets knowledge of the >> write cache, it issues the flush commands, and it gets same slow. >> >> How could this be solved? > > > ================================================ > 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.