Re: [PATCH] Add 4K QUIRK for Intel X25-M, MARVELL SD88SA02 and OCZ Agility 2

2013-08-14 Thread Steven Hartland
- Original Message - 
From: Xin Li delp...@delphij.net




-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 8/11/13 12:03 PM, Richard Yao wrote:
Is there any possibility that these quirks could be added to the 
upcoming 9.2 release?


I think so but we need to act fast.


Pools composed of affected disks will suffer from performance
issues until they are reformatted with the correct block size. In
addition, a certain benchmarking site, whose benchmarks are often
fodder for trolls, uses the Intel X25-M in its benchmarks. Adding
the quirk to 9.2 would eliminate an unfair handicap on FreeBSD from
their next set of benchmarks.


Actually I'm not 100% sure here: the current FreeBSD ZFS code does not
handle stripesize at all, and thus if you create a pool with the
patch, they will still be ashift=9.  Justin (gibbs@) have a patchset
to address this by the way, but since it's not yet in HEAD I wouldn't
expect it be incorporated in 9.2...


Indeed, there is nothing which really makes proper use of QUIRKS that
I'm aware of and ZFS definitely doesn't.

There's a number of patches around which correct that, I've one here
too, but none as yet are a total solution to the ashift issue.

   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 postmas...@multiplay.co.uk.

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: [PATCH] Add 4K QUIRK for Intel X25-M, MARVELL SD88SA02 and OCZ Agility 2

2013-08-14 Thread Richard Yao
I neglected to include the CC list on the previous email that I sent, so
here is a reproduction:

I am afraid that is not possible. I extracted the MARVELL SD88SA02
entry from Open Solaris. The OCZ Agility 2 entry was provided by another
Gentoo developer using a tool that performed an inquiry query and
extracted the exact 24 bytes in the combined vendor/product
identification fields. The same was done for the X25-M. I actually do
own one of those and could get FreeBSD running on that machine, but
Artem Belevich has already responded with that information.

On 08/13/2013 10:02 PM, Steven Hartland wrote:
 Could you provide the output from camcontrol identify for these
 disks I want to just double check the formatting before commiting as I
 don't have these disks here in labs.
 
Regards
Steve
 
 - Original Message - From: Richard Yao r...@gentoo.org
 To: hack...@freebsd.org
 Cc: Richard Yao r...@gentoo.org; Eitan Adler ead...@freebsd.org
 Sent: Sunday, August 11, 2013 1:12 PM
 Subject: [PATCH] Add 4K QUIRK for Intel X25-M, MARVELL SD88SA02 and OCZ
 Agility 2
 
 
 Signed-off-by: Richard Yao r...@gentoo.org
 ---
 sys/cam/ata/ata_da.c   | 24 
 sys/cam/scsi/scsi_da.c | 24 
 2 files changed, 48 insertions(+)

 diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c
 index f201231..b7f293d 100644
 --- a/sys/cam/ata/ata_da.c
 +++ b/sys/cam/ata/ata_da.c
 @@ -349,6 +349,14 @@ static struct ada_quirk_entry ada_quirk_table[] =
  },
  {
  /*
 + * Intel X25-M Series SSDs
 + * 4k optimised  trim only works in 4k requests + 4k aligned
 + */
 + { T_DIRECT, SIP_MEDIA_FIXED, *, INTEL SSDSA2M*, * },
 + /*quirks*/ADA_Q_4K
 + },
 + {
 + /*
  * Kingston E100 Series SSDs
  * 4k optimised  trim only works in 4k requests + 4k aligned
  */
 @@ -365,6 +373,22 @@ static struct ada_quirk_entry ada_quirk_table[] =
  },
  {
  /*
 + * Marvell SSD (entry taken from Open Solaris)
 + * 4k optimised  trim only works in 4k requests + 4k aligned
 + */
 + { T_DIRECT, SIP_MEDIA_FIXED, *, MARVELL SD88SA02*, * },
 + /*quirks*/ADA_Q_4K
 + },
 + {
 + /*
 + * OCZ Agility 2 SSDs
 + * 4k optimised  trim only works in 4k requests + 4k aligned
 + */
 + { T_DIRECT, SIP_MEDIA_FIXED, *, OCZ-AGILITY2*, * },
 + /*quirks*/ADA_Q_4K
 + },
 + {
 + /*
  * OCZ Agility 3 SSDs
  * 4k optimised  trim only works in 4k requests + 4k aligned
  */
 diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
 index 617afbd..df895be 100644
 --- a/sys/cam/scsi/scsi_da.c
 +++ b/sys/cam/scsi/scsi_da.c
 @@ -1008,6 +1008,14 @@ static struct da_quirk_entry da_quirk_table[] =
  },
  {
  /*
 + * Intel X25-M Series SSDs
 + * 4k optimised  trim only works in 4k requests + 4k aligned
 + */
 + { T_DIRECT, SIP_MEDIA_FIXED, *, INTEL SSDSA2M*, * },
 + /*quirks*/ADA_Q_4K
 + },
 + {
 + /*
  * Kingston E100 Series SSDs
  * 4k optimised  trim only works in 4k requests + 4k aligned
  */
 @@ -1024,6 +1032,22 @@ static struct da_quirk_entry da_quirk_table[] =
  },
  {
  /*
 + * Marvell SSD (entry taken from Open Solaris)
 + * 4k optimised  trim only works in 4k requests + 4k aligned
 + */
 + { T_DIRECT, SIP_MEDIA_FIXED, *, MARVELL SD88SA02*, * },
 + /*quirks*/ADA_Q_4K
 + },
 + {
 + /*
 + * OCZ Agility 2 SSDs
 + * 4k optimised  trim only works in 4k requests + 4k aligned
 + */
 + { T_DIRECT, SIP_MEDIA_FIXED, *, OCZ-AGILITY2*, * },
 + /*quirks*/ADA_Q_4K
 + },
 + {
 + /*
  * OCZ Agility 3 SSDs
  * 4k optimised  trim only works in 4k requests + 4k aligned
  */
 -- 
 1.8.1.5

 ___
 freebsd-hackers@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
 To unsubscribe, send any mail to
 freebsd-hackers-unsubscr...@freebsd.org

 
 
 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 postmas...@multiplay.co.uk.
 




signature.asc
Description: OpenPGP digital signature


[PATCH] Add flag to makefs to require specfile entries to exist

2013-08-14 Thread Eric van Gyzen
The attached patch adds a -X flag to makefs:

If a regular file listed in the specfile does not exist in the file
system, and the entry is not marked optional, abort creation of the
image.  Without this flag, the image would contain a zero-length
file in this case.

This is very handy when the specfile is the absolute authority for the
contents of the image.  It fails early and loudly, instead of causing
late and sometimes obscure run-time errors.

I checked NetBSD-current; the -X flag is available there.

Would someone like to commit it for me?

Eric
commit 4f90b5ed516eab57c951162cfdc29d0da0ae7495
Author: Eric van Gyzen e...@vangyzen.net
Date:   Wed Aug 14 13:25:55 2013 -0500

Add a -X flag to makefs

If a regular file listed in the specfile does not exist in the file
system, and the entry is not marked optional, abort creation of the
image.  Without this flag, the image would contain a zero-length
file in this case.

Obtained from:  Dell, Inc.

diff --git a/usr.sbin/makefs/makefs.8 b/usr.sbin/makefs/makefs.8
index 4d81e45..776933d 100644
--- a/usr.sbin/makefs/makefs.8
+++ b/usr.sbin/makefs/makefs.8
@@ -43,7 +43,7 @@
 .Nd create a file system image from a directory tree or a mtree manifest
 .Sh SYNOPSIS
 .Nm
-.Op Fl Dpx
+.Op Fl DpXx
 .Op Fl B Ar byte-order
 .Op Fl b Ar free-blocks
 .Op Fl d Ar debug-mask
@@ -155,7 +155,10 @@ isn't provided, the current time will be used.
 If
 .Sy flags
 isn't provided, the current file flags will be used.
-Missing regular file entries will be created as zero-length files.
+Missing regular file entries will be created as zero-length files
+unless
+.Fl X
+is specified.
 .It Fl f Ar free-files
 Ensure that a minimum of
 .Ar free-files
@@ -211,6 +214,12 @@ BSD fast file system (default).
 .It Sy cd9660
 ISO 9660 file system.
 .El
+.It Fl X
+If a regular file listed in the specfile does not exist in the file system,
+and the entry is not marked
+.Sy optional ,
+abort creation of the image.  Without this flag, the image would contain
+a zero-length file in this case.
 .It Fl x
 Exclude file system nodes not explicitly listed in the specfile.
 .El
diff --git a/usr.sbin/makefs/makefs.c b/usr.sbin/makefs/makefs.c
index 03ff1ac..32f3469 100644
--- a/usr.sbin/makefs/makefs.c
+++ b/usr.sbin/makefs/makefs.c
@@ -113,7 +113,7 @@ main(int argc, char *argv[])
start_time.tv_sec = start.tv_sec;
start_time.tv_nsec = start.tv_usec * 1000;
 
-   while ((ch = getopt(argc, argv, B:b:Dd:f:F:M:m:N:o:ps:S:t:x)) != -1) {
+   while ((ch = getopt(argc, argv, B:b:Dd:f:F:M:m:N:o:ps:S:t:Xx)) != -1) 
{
switch (ch) {
 
case 'B':
@@ -229,6 +229,10 @@ main(int argc, char *argv[])
fstype-prepare_options(fsoptions);
break;
 
+   case 'X':
+   fsoptions.specrequired = 1;
+   break;
+
case 'x':
fsoptions.onlyspec = 1;
break;
@@ -252,6 +256,10 @@ main(int argc, char *argv[])
if (argc  2)
usage();
 
+   /* -X must be accompanied by -F */
+   if (fsoptions.specrequired != 0  specfile == NULL)
+   errx(1, -X requires -F mtree-specfile.);
+
/* -x must be accompanied by -F */
if (fsoptions.onlyspec != 0  specfile == NULL)
errx(1, -x requires -F mtree-specfile.);
@@ -295,7 +303,8 @@ main(int argc, char *argv[])
 
if (specfile) { /* apply a specfile */
TIMER_START(start);
-   apply_specfile(specfile, subtree, root, fsoptions.onlyspec);
+   apply_specfile(specfile, subtree, root, fsoptions.onlyspec,
+   fsoptions.specrequired);
TIMER_RESULTS(start, apply_specfile);
}
 
@@ -354,7 +363,7 @@ usage(void)
fprintf(stderr,
 usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n
 \t[-S sector-size] [-M minimum-size] [-m maximum-size] [-s image-size]\n
-\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-px]\n
+\t[-b free-blocks] [-f free-files] [-F mtree-specfile [-X] [-x]] [-p]\n
 \t[-N userdb-dir] image-file directory | manifest [extra-directory ...]\n,
prog);
exit(1);
diff --git a/usr.sbin/makefs/makefs.h b/usr.sbin/makefs/makefs.h
index 5ab0444..ebb5e8c 100644
--- a/usr.sbin/makefs/makefs.h
+++ b/usr.sbin/makefs/makefs.h
@@ -118,6 +118,7 @@ typedef struct {
int fd; /* file descriptor of image */
void*superblock;/* superblock */
int onlyspec;   /* only add entries in specfile */
+   int specrequired;   /* entries in specfile are required to exist */
 
 
/* global options */
@@ -149,7 +150,7 @@ typedef struct {
 } option_t;
 
 
-void   apply_specfile(const char *, const char *, fsnode *, int);
+void   apply_specfile(const char *, const char *, fsnode *,