Skip to contentSkip to conversation

New RAID library supporting up to six parities

RFC Superseded Andrea Mazzoleni 8 participants 18 messages Jan 6, 2014 – Jan 14, 2014

Subsystems (3)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v2 cover New RAID library supporting up to six parities

Hi,

This is a port to the Linux kernel of a RAID engine that I'm currently using in a hobby project called SnapRAID. This engine supports up to six parities levels and at the same time maintains compatibility with the existing Linux RAID6 one.

The mathematical method used was already discussed in the linux-raid/linux-btrfs mailing list in November in the thread "Triple parity and beyond":

http://thread.gmane.org/gmane.comp.file-systems.btrfs/30159

The first patch of the serie is the implementation of such discussion, done porting my existing code to the kernel environment.

The code compiles without warnings with gcc -Wall -Wextra, with the clang analyzer, and test programs run cleany with valgrind.
I verified that the module builds, loads and passes the self test in the x86, and x64 architectures. I expect no problems in other platforms, but they are not really tested.

The second patch is a preliminary change in btrfs to use the new interface and to extend its internal support to up to six parities.
This patch is mainly provided to show how to use the new interface, and not meant for inclusion at this stage.

A good entry point to understand the code is to start from the include/linux/raid/raid.h file. It contains the functions that external modules should call with a complete description of them.

Please let me know what do you think. Any kind of feedback is welcome.

Thanks,
Andrea

Changes from v1 to v2:
- Adds a patch to btrfs to extend its support to more than double parity.
- Changes the main raid_rec() interface to merge the failed data and parity index vectors. This matches better the kernel usage.
- Uses alloc_pages_exact() instead of __get_free_pages().
- Removes unnecessary register loads from par1_sse().
- Converts the asm_begin/end() macros to inlined functions.
- Fixes some more checkpatch.pl warnings.
- Other minor style/comment changes.

Andrea Mazzoleni (2):
lib: raid: New RAID library supporting up to six parities
fs: btrfs: Extends btrfs/raid56 to support up to six parities

 fs/btrfs/Kconfig          |    1 +
 fs/btrfs/raid56.c         |  278 +++-----
 fs/btrfs/raid56.h         |   12 +-
 fs/btrfs/volumes.c        |    4 +-
 include/linux/raid/raid.h |   81 +++
 lib/Kconfig               |   12 +
 lib/Makefile              |    1 +
 lib/raid/Makefile         |   14 +
 lib/raid/cpu.h            |   44 ++
 lib/raid/gf.h             |  109 ++++
 lib/raid/int.c            |  567 ++++++++++++++++
 lib/raid/internal.h       |  147 +++++
 lib/raid/mktables.c       |  338 ++++++++++
 lib/raid/module.c         |  460 +++++++++++++
 lib/raid/raid.c           |  435 +++++++++++++
 lib/raid/sort.c           |   72 +++
 lib/raid/test/Makefile    |   33 +
 lib/raid/test/combo.h     |  155 +++++
 lib/raid/test/fulltest.c  |   74 +++
 lib/raid/test/memory.c    |   79 +++
 lib/raid/test/memory.h    |   78 +++
 lib/raid/test/selftest.c  |   39 ++
 lib/raid/test/speedtest.c |  565 ++++++++++++++++
 lib/raid/test/test.c      |  316 +++++++++
 lib/raid/test/test.h      |   59 ++
 lib/raid/test/usermode.h  |   91 +++
 lib/raid/test/xor.c       |   41 ++
 lib/raid/x86.c            | 1565 +++++++++++++++++++++++++++++++++++++++++++++
 28 files changed, 5477 insertions(+), 193 deletions(-)
 create mode 100644 include/linux/raid/raid.h
 create mode 100644 lib/raid/Makefile
 create mode 100644 lib/raid/cpu.h
 create mode 100644 lib/raid/gf.h
 create mode 100644 lib/raid/int.c
 create mode 100644 lib/raid/internal.h
 create mode 100644 lib/raid/mktables.c
 create mode 100644 lib/raid/module.c
 create mode 100644 lib/raid/raid.c
 create mode 100644 lib/raid/sort.c
 create mode 100644 lib/raid/test/Makefile
 create mode 100644 lib/raid/test/combo.h
 create mode 100644 lib/raid/test/fulltest.c
 create mode 100644 lib/raid/test/memory.c
 create mode 100644 lib/raid/test/memory.h
 create mode 100644 lib/raid/test/selftest.c
 create mode 100644 lib/raid/test/speedtest.c
 create mode 100644 lib/raid/test/test.c
 create mode 100644 lib/raid/test/test.h
 create mode 100644 lib/raid/test/usermode.h
 create mode 100644 lib/raid/test/xor.c
 create mode 100644 lib/raid/x86.c
Signature · 1 line
1.7.12.1
#1 lore raw

RFC v2 1/2 lib: raid: New RAID library supporting up to six parities

This patch adds a new lib/raid directory, containing a new RAID support based on a Cauchy matrix working for up to six parities, and backward compatible with the existing RAID6 support.

It was developed for kernel 3.13-rc4, but it should work with any other version because it's mostly formed of new files. The only modification is about adding a new CONFIG_RAID_CAUCHY option in the "lib" configuration section.

The main interface is defined in include/linux/raid/raid.h and provides easy to use functions able to generate parities and to recover data. This interface is different than the one provided by the RAID6 library, because with more parities the number of recovering cases grows exponentially and it's not feasible to have a different function for each one.

The library provides fast implementations using SSE2 and SSSE3 for x86/x64 and a portable C implementation working everythere.
If the RAID6 library is enabled in the kernel, its functionality is also used to maintain the existing level of performance for the first two parities in all the supported architectures.

At startup the module runs a very fast self test (about 1ms) to ensure that the used functions are correct.
You can also enable a speed test similar at the one used by raid6, using the "speedtest=1" argument when loading the module.

In the lib/raid/test directory are present also some user mode test programs:
selftest - Runs the same selftest and speedtest executed at the module startup. fulltest - Runs a more extensive test that checks all the built-in functions. speetest - Runs a more complete speed test.

As a reference, in my icore7 2.7GHz the speedtest program reports:

...
Speed test using 16 data buffers of 4096 bytes, for a total of 64 KiB. Memory blocks have a displacement of 64 bytes to improve cache performance. The reported value is the aggregate bandwidth of all data blocks in MiB/s, not counting parity blocks.

Memory write speed using the C memset() function:
memset 33518

RAID functions used for computing the parity:

            int8   int32   int64    sse2   sse2e   ssse3  ssse3e
    par1           11762   21450   44621

par2 3520 6176 18100 20338
par3 848 8009 9210
par4 659 6518 7303
par5 531 4931 5363
par6 430 4069 4471

RAID functions used for recovering:

            int8   ssse3
    rec1     591    1126
    rec2     272     456
    rec3      80     305
    rec4      49     216
    rec5      34     151

...

Legend:
parX functions to generate X parities
recX functions to recover X data blocks
int8 implemention based on 8 bits arithmetics int32 implemention based on 32 bits arithmetics int64 implemention based on 64 bits arithmetics sse2 implemention based on SSE2
sse2e implemention based on SSE2 with 16 registers (x64) ssse3 implemention based on SSSE3
ssse3e implemention based on SSSE3 with 16 registers (x64)

---
 include/linux/raid/raid.h |   81 +++
 lib/Kconfig               |   12 +
 lib/Makefile              |    1 +
 lib/raid/Makefile         |   14 +
 lib/raid/cpu.h            |   44 ++
 lib/raid/gf.h             |  109 ++++
 lib/raid/int.c            |  567 ++++++++++++++++
 lib/raid/internal.h       |  147 +++++
 lib/raid/mktables.c       |  338 ++++++++++
 lib/raid/module.c         |  460 +++++++++++++
 lib/raid/raid.c           |  435 +++++++++++++
 lib/raid/sort.c           |   72 +++
 lib/raid/test/Makefile    |   33 +
 lib/raid/test/combo.h     |  155 +++++
 lib/raid/test/fulltest.c  |   74 +++
 lib/raid/test/memory.c    |   79 +++
 lib/raid/test/memory.h    |   78 +++
 lib/raid/test/selftest.c  |   39 ++
 lib/raid/test/speedtest.c |  565 ++++++++++++++++
 lib/raid/test/test.c      |  316 +++++++++
 lib/raid/test/test.h      |   59 ++
 lib/raid/test/usermode.h  |   91 +++
 lib/raid/test/xor.c       |   41 ++
 lib/raid/x86.c            | 1565 +++++++++++++++++++++++++++++++++++++++++++++
 24 files changed, 5375 insertions(+)
 create mode 100644 include/linux/raid/raid.h
 create mode 100644 lib/raid/Makefile
 create mode 100644 lib/raid/cpu.h
 create mode 100644 lib/raid/gf.h
 create mode 100644 lib/raid/int.c
 create mode 100644 lib/raid/internal.h
 create mode 100644 lib/raid/mktables.c
 create mode 100644 lib/raid/module.c
 create mode 100644 lib/raid/raid.c
 create mode 100644 lib/raid/sort.c
 create mode 100644 lib/raid/test/Makefile
 create mode 100644 lib/raid/test/combo.h
 create mode 100644 lib/raid/test/fulltest.c
 create mode 100644 lib/raid/test/memory.c
 create mode 100644 lib/raid/test/memory.h
 create mode 100644 lib/raid/test/selftest.c
 create mode 100644 lib/raid/test/speedtest.c
 create mode 100644 lib/raid/test/test.c
 create mode 100644 lib/raid/test/test.h
 create mode 100644 lib/raid/test/usermode.h
 create mode 100644 lib/raid/test/xor.c
 create mode 100644 lib/raid/x86.c
include/linux/raid/raid.h new file +81 -0
new file mode 100644
index 0000000..2b83279
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2013 Andrea Mazzoleni
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __RAID_H
+#define __RAID_H
+
+#ifdef __KERNEL__ /* to build the user mode test */
+#include <linux/types.h>
+#endif
+
+/**
+ * Max number of parity disks supported.
+ */
+#define RAID_PARITY_MAX 6
+
+/**
+ * Maximum number of data disks supported.
+ */
+#define RAID_DATA_MAX 251
+
+/**
+ * Computes the parity.
+ *
+ * @nd Number of data blocks.
+ * @np Number of parities blocks to compute.
+ * @size Size of the blocks pointed by @v. It must be a multipler of 64.
+ * @v Vector of pointers to the blocks of data and parity.
+ *   It has (@nd + @np) elements. The starting elements are the blocks for
+ *   data, following with the parity blocks.
+ *   Each blocks has @size bytes.
+ */
+void raid_par(int nd, int np, size_t size, void **v);
+
+/**
+ * Recovers failures in data and parity blocks.
+ *
+ * All the data and parity blocks marked as bad in the @ir vector are
+ * recovered and recomputed.
+ *
+ * The parities blocks to use for recovering are automatically selected from
+ * the ones NOT present in the @ir vector.
+ *
+ * Ensure to have @nr <= @np, otherwise recovering is not possible.
+ *
+ * @nr Number of failed data and parity blocks to recover.
+ * @ir[] Vector of @nr indexes of the data and parity blocks to recover.
+ *   The indexes start from 0. They must be in order.
+ * @nd Number of data blocks.
+ * @np Number of parity blocks.
+ * @size Size of the blocks pointed by @v. It must be a multipler of 64.
+ * @v Vector of pointers to the blocks of data and parity.
+ *   It has (@nd + @np) elements. The starting elements are the blocks
+ *   for data, following with the parity blocks.
+ *   Each blocks has @size bytes.
+ */
+void raid_rec(int nr, int *ir, int nd, int np, size_t size, void **v);
+
+/**
+ * Sorts a small vector of integers.
+ *
+ * If you have block indexes not in order, you can use this function to sort
+ * them before callign raid_rec().
+ *
+ * @n Number of integers. No more than RAID_PARITY_MAX.
+ * @v Vector of integers.
+ */
+void raid_sort(int n, int *v);
+
+#endif
+
lib/Kconfig +12 -0
index 991c98b..a77ffbe 100644
@@ -10,6 +10,18 @@ menu "Library routines"
 config RAID6_PQ
 	tristate
 
+config RAID_CAUCHY
+	tristate "RAID Cauchy functions"
+	help
+	  This option enables the RAID parity library based on a Cauchy matrix
+	  that supports up to six parities, and it's compatible with the
+	  existing RAID6 support.
+	  This library provides optimized functions for architectures with
+	  SSSE3 support.
+	  If the RAID6 module is enabled, it's automatically used to
+	  maintain the same performance level in all the architectures.
+	  Module will be called raid_cauchy.
+
 config BITREVERSE
 	tristate
 
lib/Makefile +1 -0
index a459c31..8b76716 100644
@@ -79,6 +79,7 @@ obj-$(CONFIG_LZ4HC_COMPRESS) += lz4/
 obj-$(CONFIG_LZ4_DECOMPRESS) += lz4/
 obj-$(CONFIG_XZ_DEC) += xz/
 obj-$(CONFIG_RAID6_PQ) += raid6/
+obj-$(CONFIG_RAID_CAUCHY) += raid/
 
 lib-$(CONFIG_DECOMPRESS_GZIP) += decompress_inflate.o
 lib-$(CONFIG_DECOMPRESS_BZIP2) += decompress_bunzip2.o
lib/raid/Makefile new file +14 -0
new file mode 100644
index 0000000..eb4ccb5
@@ -0,0 +1,14 @@
+obj-$(CONFIG_RAID_CAUCHY) += raid_cauchy.o
+
+raid_cauchy-y	+= module.o raid.o tables.o int.o sort.o
+
+raid_cauchy-$(CONFIG_X86) += x86.o
+
+hostprogs-y	+= mktables
+
+quiet_cmd_mktable = TABLE   $@
+      cmd_mktable = $(obj)/mktables > $@ || ( rm -f $@ && exit 1 )
+
+targets += tables.c
+$(obj)/tables.c: $(obj)/mktables FORCE
+	$(call if_changed,mktable)
lib/raid/cpu.h new file +44 -0

44 lines not on this page · raw message

lib/raid/gf.h new file +109 -0

109 lines not on this page · raw message

lib/raid/int.c new file +567 -0

567 lines not on this page · raw message

lib/raid/internal.h new file +147 -0

147 lines not on this page · raw message

lib/raid/mktables.c new file +338 -0

338 lines not on this page · raw message

lib/raid/module.c new file +460 -0

460 lines not on this page · raw message

lib/raid/raid.c new file +435 -0

435 lines not on this page · raw message

lib/raid/sort.c new file +72 -0

72 lines not on this page · raw message

lib/raid/test/Makefile new file +33 -0
new file mode 100644
index 0000000..04e8e1e
@@ -0,0 +1,33 @@
+#
+# This is a simple Makefile to test some of the RAID code
+# from userspace.
+#
+
+CC  = gcc
+CFLAGS = -I.. -I../../../include -Wall -Wextra -g -O2
+LD = ld
+OBJS = raid.o int.o x86.o tables.o memory.o test.o sort.o module.o xor.o
+
+.c.o:
+	$(CC) $(CFLAGS) -c -o $@ $<
+
+%.c: ../%.c
+	cp -f $< $@
+
+all: fulltest speedtest selftest
+
+fulltest: $(OBJS) fulltest.o
+	$(CC) $(CFLAGS) -o fulltest $^
+
+speedtest: $(OBJS) speedtest.o
+	$(CC) $(CFLAGS) -o speedtest $^
+
+selftest: $(OBJS) selftest.o
+	$(CC) $(CFLAGS) -o selftest $^
+
+tables.c: mktables
+	./mktables > tables.c
+
+clean:
+	rm -f *.o mktables.c mktables tables.c fulltest speedtest selftest
+
lib/raid/test/combo.h new file +155 -0

155 lines not on this page · raw message

lib/raid/test/fulltest.c new file +74 -0

74 lines not on this page · raw message

lib/raid/test/memory.c new file +79 -0

79 lines not on this page · raw message

lib/raid/test/memory.h new file +78 -0

78 lines not on this page · raw message

lib/raid/test/selftest.c new file +39 -0
new file mode 100644
index 0000000..374f8fe
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2013 Andrea Mazzoleni
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include "internal.h"
+#include "cpu.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(void)
+{
+	raid_init();
+
+	printf("RAID Cauchy selftest\n\n");
+
+	printf("Self test...\n");
+	if (raid_selftest() != 0) {
+		printf("FAILED!\n");
+		exit(EXIT_FAILURE);
+	}
+	printf("OK\n\n");
+
+	printf("Speed test...\n");
+	raid_speedtest();
+
+	return 0;
+}
+
lib/raid/test/speedtest.c new file +565 -0

250 lines not on this page · raw message

lib/raid/test/test.c new file +316 -0

316 lines not on this page · raw message

lib/raid/test/test.h new file +59 -0

59 lines not on this page · raw message

lib/raid/test/usermode.h new file +91 -0

91 lines not on this page · raw message

lib/raid/test/xor.c new file +41 -0

41 lines not on this page · raw message

lib/raid/x86.c new file +1565 -0

1,565 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.7.12.1

Part of the diff is not shown here. View the raw message.

#2 lore raw

RFC v2 2/2 fs: btrfs: Extends btrfs/raid56 to support up to six parities

In reply to Andrea Mazzoleni

This patch changes btrfs/raid56.c to use the new raid interface and extends its support to an arbitrary number of parities.

More in details, the two faila/failb failure indexes are now replaced with a fail[] vector that keeps track of up to six failures, and now the new raid_par() and raid_rec() functions are used to handle with parity instead of the old xor/raid6 ones.

---
 fs/btrfs/Kconfig   |   1 +
 fs/btrfs/raid56.c  | 278 ++++++++++++++++++-----------------------------------
 fs/btrfs/raid56.h  |  12 ++-
 fs/btrfs/volumes.c |   4 +-
 4 files changed, 102 insertions(+), 193 deletions(-)
fs/btrfs/Kconfig +1 -0
index aa976ec..173fabe 100644
@@ -5,6 +5,7 @@ config BTRFS_FS
 	select ZLIB_DEFLATE
 	select LZO_COMPRESS
 	select LZO_DECOMPRESS
+	select RAID_CAUCHY
 	select RAID6_PQ
 	select XOR_BLOCKS
 
fs/btrfs/raid56.c +91 -187

460 lines not on this page · raw message

fs/btrfs/raid56.h +8 -4
index ea5d73b..8adc48d 100644
@@ -33,11 +33,15 @@ static inline int nr_data_stripes(struct map_lookup *map)
 {
 	return map->num_stripes - nr_parity_stripes(map);
 }
-#define RAID5_P_STRIPE ((u64)-2)
-#define RAID6_Q_STRIPE ((u64)-1)
 
-#define is_parity_stripe(x) (((x) == RAID5_P_STRIPE) ||		\
-			     ((x) == RAID6_Q_STRIPE))
+#define RAID_PAR1_STRIPE ((u64)-6)
+#define RAID_PAR2_STRIPE ((u64)-5)
+#define RAID_PAR3_STRIPE ((u64)-4)
+#define RAID_PAR4_STRIPE ((u64)-3)
+#define RAID_PAR5_STRIPE ((u64)-2)
+#define RAID_PAR6_STRIPE ((u64)-1)
+
+#define is_parity_stripe(x) (((u64)(x) >= RAID_PAR1_STRIPE))
 
 int raid56_parity_recover(struct btrfs_root *root, struct bio *bio,
 				 struct btrfs_bio *bbio, u64 *raid_map,
fs/btrfs/volumes.c +2 -2
index 92303f4..bf593f7 100644
@@ -4918,10 +4918,10 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw,
 				raid_map[(i+rot) % num_stripes] =
 					em->start + (tmp + i) * map->stripe_len;
 
-			raid_map[(i+rot) % map->num_stripes] = RAID5_P_STRIPE;
+			raid_map[(i+rot) % map->num_stripes] = RAID_PAR1_STRIPE;
 			if (map->type & BTRFS_BLOCK_GROUP_RAID6)
 				raid_map[(i+rot+1) % num_stripes] =
-					RAID6_Q_STRIPE;
+					RAID_PAR2_STRIPE;
 
 			*length = map->stripe_len;
 			stripe_index = 0;
Signature · 1 line
1.7.12.1
#3 lore raw

Re: [RFC v2 2/2] fs: btrfs: Extends btrfs/raid56 to support up to six parities

Quoted 8 lines · Andrea Mazzoleni

This patch changes btrfs/raid56.c to use the new raid interface and extends its support to an arbitrary number of parities.

More in details, the two faila/failb failure indexes are now replaced with a fail[] vector that keeps track of up to six failures, and now the new raid_par() and raid_rec() functions are used to handle with parity instead of the old xor/raid6 ones.

Neat. The faila/failb were always my least favorite part of the btrfs code ;) Did you test just raid5/6 or also the higher parity counts?

-chris

#4 lore raw

Re: [RFC v2 2/2] fs: btrfs: Extends btrfs/raid56 to support up to six parities

Hi Chris,

Quoted 2 lines · Chris Mason

Neat. The faila/failb were always my least favorite part of the btrfs code ;) Did you test just raid5/6 or also the higher parity counts?

At this stage no real testing was made with btrfs.

The intention of this btrfs patch is mainly to get feedback on the new raid inteface, and see if it matches the needs of btrfs, and if it results in cleaner code than before.

And besides the removal of the faila/failb variables, something other that likely you can appreciate is the removal of all the P/Q logic from btrfs, that it's now replaced with a single raid_rec() call.

After the raid interface stabilizes, this patch can be used as starting point for a real btrfs patch. But at now it's just to show some example code of what kind of modification btrfs will need.

Ciao,
Andrea

#5 lore raw
In reply to Andrea Mazzoleni
Quoted 7 lines · Andrea Mazzoleni

Hi,

This is a port to the Linux kernel of a RAID engine that I'm currently using in a hobby project called SnapRAID. This engine supports up to six parities levels and at the same time maintains compatibility with the existing Linux RAID6 one.

This is just great Andrea,
thank you for such Epiphany present.

Just by looking at the Subjects, it seems patch number 0/1 is missing. It might have not gotten through to the lists, or be a numbering mistake.

Does your code also support (shortcut) RMW as opposed to RCW, for all parities?
RMW is: for a 4k write: read just nparities+1data disks, recompute parities, write nparities+1data disks, RCW is: "read all disks" prior to recompute parities...

Part of such RMW code should be in handle_stripe_dirtying which is not in your patch 0/2 but that might have been in patch 0/1 which apparently didn't get through.

See this patch by Kumar for support of RMW in raid6 (raid5 has it) which unfortunately apparently wasn't merged up to now:
http://marc.info/?l=linux-raid&m=136624783417452&w=2

Thank you
J.

#6 lore raw
Quoted 9 lines · joystick
Quoted 7 lines · Andrea Mazzoleni

Hi,

This is a port to the Linux kernel of a RAID engine that I'm currently using in a hobby project called SnapRAID. This engine supports up to six parities levels and at the same time maintains compatibility with the existing Linux RAID6 one.

Quoted 5 lines

This is just great Andrea,
thank you for such Epiphany present.

Just by looking at the Subjects, it seems patch number 0/1 is missing. It might have not gotten through to the lists, or be a numbering mistake.

No, the numbering style is ${index}/${total}, where index = 0 is a cover letter. So there are two patches total, 1/2 and 2/2, with the cover letter 0/2.

<snip>

#7 lore raw
Quoted 7 lines · Alex Elsayed
Quoted 2 lines · joystick

Just by looking at the Subjects, it seems patch number 0/1 is missing. It might have not gotten through to the lists, or be a numbering mistake.

No, the numbering style is ${index}/${total}, where index = 0 is a cover letter. So there are two patches total, 1/2 and 2/2, with the cover letter 0/2.

Ok sorry, I meant

"Just by looking at the Subjects, it seems patch number 1/2 is missing."

and not 0/1

Can you see the 1/2 on the lists? I can't.

J.

#8 lore raw
Quoted 10 lines · joystick
Quoted 8 lines · Alex Elsayed
Quoted 3 lines · joystick

Just by looking at the Subjects, it seems patch number 0/1 is missing. It might have not gotten through to the lists, or be a numbering mistake.

No, the numbering style is ${index}/${total}, where index = 0 is a cover letter. So there are two patches total, 1/2 and 2/2, with the cover letter 0/2.

Quoted 7 lines

Ok sorry, I meant

"Just by looking at the Subjects, it seems patch number 1/2 is missing."

and not 0/1

Can you see the 1/2 on the lists? I can't.

Oh, I see. No, it looks fine from here - I'm reading via Gmane's NNTP gateway, and 1/2 has

Message-ID: <[email protected]>

#9 lore raw
In reply to joystick
Quoted 10 lines · joystick
Quoted 8 lines · Alex Elsayed
Quoted 3 lines · joystick

Just by looking at the Subjects, it seems patch number 0/1 is missing. It might have not gotten through to the lists, or be a numbering mistake.

No, the numbering style is ${index}/${total}, where index = 0 is a cover letter. So there are two patches total, 1/2 and 2/2, with the cover letter 0/2.

Quoted 7 lines

Ok sorry, I meant

"Just by looking at the Subjects, it seems patch number 1/2 is missing."

and not 0/1

Can you see the 1/2 on the lists? I can't.

Oh, I see. No, it looks fine from here - I'm reading via Gmane's NNTP gateway, and 1/2 has

Message-ID: <[email protected]>

#10 lore raw
In reply to joystick
Quoted 3 lines · joystick

Just by looking at the Subjects, it seems patch number 0/1 is missing. It might have not gotten through to the lists, or be a numbering mistake.

The patch files can be also downloaded from: http://snapraid.sourceforge.net/linux/v2/

Sorry about that,

Quoted 2 lines

Does your code also support (shortcut) RMW as opposed to RCW, for all parities?

At now no. But it can be easily extended to add the parity computation of a single disk in a set of already computed parities and then provide the required support for RMW.

With SSSE3 this can be implemented in a very efficient way.

Ciao,
Andrea

#11 lore raw
In reply to Andrea Mazzoleni
Quoted 6 lines · Andrea Mazzoleni

Hi,

This is a port to the Linux kernel of a RAID engine that I'm currently using in a hobby project called SnapRAID. This engine supports up to six parities levels and at the same time maintains compatibility with the existing Linux RAID6 one.

FWIW, your patch 1/2 doesn't seem to have gone through on linux-raid, although I saw it on lkml. Probably a different file size limit, as that's a very large patch.

You might want to break the next submission into smaller parts. That might help people review it, too.

Thanks for doing this work!

Phil

#13 lore raw
In reply to Andrea Mazzoleni

Andrea,
As others have said it looks interesting. Thanks for the efforts.

Question: As an end-user type who currently uses mdadm RAID6, if I
wanted to set up a dedicated machine to do some SnapRAID testing then what's the minimum disk hardware I'd need assuming Linux is just on it's own disk?

1) 1 drive for Linux
2) 4 (or possibly 3) drives for a SnapRAID RAID6 device?
3) 3 drives for a SnapRAID RAID5 device? (If RAID5 can even use SnapRAID. Not sure it can)

Are there any known issues using both mdadm and SnapRAID devices in
the same system? Again, I don't care if there are and the machine dies a brutal death (which I doubt from your announcement) but just asking.

Cheers,
Mark

Quoted 6 lines · Andrea Mazzoleni

Hi,

This is a port to the Linux kernel of a RAID engine that I'm currently using in a hobby project called SnapRAID. This engine supports up to six parities levels and at the same time maintains compatibility with the existing Linux RAID6 one.

#14 lore raw

Hi Mark,

Quoted 4 lines · Mark Knecht

Question: As an end-user type who currently uses mdadm RAID6, if I
wanted to set up a dedicated machine to do some SnapRAID testing then what's the minimum disk hardware I'd need assuming Linux is just on it's own disk?

The patch I sent is not related to SnapRAID. It's the same raid engine, but this is not going to change how mdadm RAID is working.

When and if this patch will be accepted in the Linux kernel, you can expect to have mdadm to support triple/quad/and more parity just like RAID5 and RAID6 are supported today.

But at now there is no new functionality to try. We still miss the required changes inside mdadm, that likely will happen in a second time.

Ciao,
Andrea

#15 lore raw
In reply to Mark Knecht
Quoted 13 lines · Mark Knecht

Andrea,
As others have said it looks interesting. Thanks for the efforts.

Question: As an end-user type who currently uses mdadm RAID6, if I
wanted to set up a dedicated machine to do some SnapRAID testing then what's the minimum disk hardware I'd need assuming Linux is just on it's own disk?

1) 1 drive for Linux
2) 4 (or possibly 3) drives for a SnapRAID RAID6 device?
3) 3 drives for a SnapRAID RAID5 device? (If RAID5 can even use SnapRAID. Not sure it can)

Quoted 7 lines

Are there any known issues using both mdadm and SnapRAID devices in
the same system? Again, I don't care if there are and the machine dies a brutal death (which I doubt from your announcement) but just asking.

Cheers,
Mark

If you want to do testing (once there is mdadm support for making the multi-raid devices), then an easy way is to make some big empty files on an existing disk and set them up as loopback devices. Then you can use these "fake" drives for the arrays. You can then test a 6+4 quad parity array using 10 1G files rather than needing 10 physical drives, and you can play with resyncing, fault testing (using the md "faulty" layout), reshaping, etc.

Of course, you can't test real-world speed this way. However, you /can/ test parity generation/recovery speeds nicely by putting the loopback files in a tmpfs system in memory - that eliminates the hard disk speeds and lets you do hard testing of the raid code.

#16 lore raw
Quoted 30 lines · David Brown
Quoted 13 lines · Mark Knecht

Andrea,
As others have said it looks interesting. Thanks for the efforts.

Question: As an end-user type who currently uses mdadm RAID6, if I
wanted to set up a dedicated machine to do some SnapRAID testing then what's the minimum disk hardware I'd need assuming Linux is just on it's own disk?

1) 1 drive for Linux
2) 4 (or possibly 3) drives for a SnapRAID RAID6 device?
3) 3 drives for a SnapRAID RAID5 device? (If RAID5 can even use SnapRAID. Not sure it can)

Quoted 7 lines

Are there any known issues using both mdadm and SnapRAID devices in
the same system? Again, I don't care if there are and the machine dies a brutal death (which I doubt from your announcement) but just asking.

Cheers,
Mark

If you want to do testing (once there is mdadm support for making the multi-raid devices), then an easy way is to make some big empty files on an existing disk and set them up as loopback devices. Then you can use these "fake" drives for the arrays. You can then test a 6+4 quad parity array using 10 1G files rather than needing 10 physical drives, and you can play with resyncing, fault testing (using the md "faulty" layout), reshaping, etc.

Quoted 6 lines

Of course, you can't test real-world speed this way. However, you /can/ test parity generation/recovery speeds nicely by putting the loopback files in a tmpfs system in memory - that eliminates the hard disk speeds and lets you do hard testing of the raid code.

Thanks David. I'll save this email and give it some thought. I've not used loopback devices before but some quick reading makes your suggestion seem quite interesting.

Cheers,
Mark