aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-18 12:32:44 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-18 12:32:44 -0500
commitea88eeac0cb8328014b53d80ca631e8dc0dc18dc (patch)
treede605c1d0e7ab1e342eedad47c56061b65a6b790
parent848b81415c42ff3dc9a4204749087b015c37ef66 (diff)
parenta9add5d92b64ea57fb4c3b557c3891cdeb15fa0c (diff)
Merge tag 'md-3.8' of git://neil.brown.name/md
Pull md update from Neil Brown: "Mostly just little fixes. Probably biggest part is AVX accelerated RAID6 calculations." * tag 'md-3.8' of git://neil.brown.name/md: md/raid5: add blktrace calls md/raid5: use async_tx_quiesce() instead of open-coding it. md: Use ->curr_resync as last completed request when cleanly aborting resync. lib/raid6: build proper files on corresponding arch lib/raid6: Add AVX2 optimized gen_syndrome functions lib/raid6: Add AVX2 optimized recovery functions md: Update checkpoint of resync/recovery based on time. md:Add place to update ->recovery_cp. md.c: re-indent various 'switch' statements. md: close race between removing and adding a device. md: removed unused variable in calc_sb_1_csm.
-rw-r--r--arch/x86/Makefile5
-rw-r--r--drivers/md/md.c256
-rw-r--r--drivers/md/md.h2
-rw-r--r--drivers/md/raid5.c43
-rw-r--r--include/linux/raid/pq.h4
-rw-r--r--lib/raid6/Makefile9
-rw-r--r--lib/raid6/algos.c12
-rw-r--r--lib/raid6/altivec.uc3
-rw-r--r--lib/raid6/avx2.c251
-rw-r--r--lib/raid6/mmx.c2
-rw-r--r--lib/raid6/recov_avx2.c323
-rw-r--r--lib/raid6/recov_ssse3.c4
-rw-r--r--lib/raid6/sse1.c2
-rw-r--r--lib/raid6/sse2.c8
-rw-r--r--lib/raid6/test/Makefile29
-rw-r--r--lib/raid6/x86.h14
16 files changed, 809 insertions, 158 deletions
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 05afcca66de6..e71fc4279aab 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -123,9 +123,10 @@ cfi-sections := $(call as-instr,.cfi_sections .debug_frame,-DCONFIG_AS_CFI_SECTI
123# does binutils support specific instructions? 123# does binutils support specific instructions?
124asinstr := $(call as-instr,fxsaveq (%rax),-DCONFIG_AS_FXSAVEQ=1) 124asinstr := $(call as-instr,fxsaveq (%rax),-DCONFIG_AS_FXSAVEQ=1)
125avx_instr := $(call as-instr,vxorps %ymm0$(comma)%ymm1$(comma)%ymm2,-DCONFIG_AS_AVX=1) 125avx_instr := $(call as-instr,vxorps %ymm0$(comma)%ymm1$(comma)%ymm2,-DCONFIG_AS_AVX=1)
126avx2_instr :=$(call as-instr,vpbroadcastb %xmm0$(comma)%ymm1,-DCONFIG_AS_AVX2=1)
126 127
127KBUILD_AFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) 128KBUILD_AFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr)
128KBUILD_CFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) 129KBUILD_CFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr)
129 130
130LDFLAGS := -m elf_$(UTS_MACHINE) 131LDFLAGS := -m elf_$(UTS_MACHINE)
131 132
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 4843b004c558..3db3d1b271f7 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1414,12 +1414,11 @@ static __le32 calc_sb_1_csum(struct mdp_superblock_1 * sb)
1414 unsigned long long newcsum; 1414 unsigned long long newcsum;
1415 int size = 256 + le32_to_cpu(sb->max_dev)*2; 1415 int size = 256 + le32_to_cpu(sb->max_dev)*2;
1416 __le32 *isuper = (__le32*)sb; 1416 __le32 *isuper = (__le32*)sb;
1417 int i;
1418 1417
1419 disk_csum = sb->sb_csum; 1418 disk_csum = sb->sb_csum;
1420 sb->sb_csum = 0; 1419 sb->sb_csum = 0;
1421 newcsum = 0; 1420 newcsum = 0;
1422 for (i=0; size>=4; size -= 4 ) 1421 for (; size >= 4; size -= 4)
1423 newcsum += le32_to_cpu(*isuper++); 1422 newcsum += le32_to_cpu(*isuper++);
1424 1423
1425 if (size == 2) 1424 if (size == 2)
@@ -4753,6 +4752,8 @@ md_attr_store(struct kobject *kobj, struct attribute *attr,
4753 } 4752 }
4754 mddev_get(mddev); 4753 mddev_get(mddev);
4755 spin_unlock(&all_mddevs_lock); 4754 spin_unlock(&all_mddevs_lock);
4755 if (entry->store == new_dev_store)
4756 flush_workqueue(md_misc_wq);
4756 rv = mddev_lock(mddev); 4757 rv = mddev_lock(mddev);
4757 if (!rv) { 4758 if (!rv) {
4758 rv = entry->store(mddev, page, length); 4759 rv = entry->store(mddev, page, length);
@@ -6346,24 +6347,23 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode,
6346 * Commands dealing with the RAID driver but not any 6347 * Commands dealing with the RAID driver but not any
6347 * particular array: 6348 * particular array:
6348 */ 6349 */
6349 switch (cmd) 6350 switch (cmd) {
6350 { 6351 case RAID_VERSION:
6351 case RAID_VERSION: 6352 err = get_version(argp);
6352 err = get_version(argp); 6353 goto done;
6353 goto done;
6354 6354
6355 case PRINT_RAID_DEBUG: 6355 case PRINT_RAID_DEBUG:
6356 err = 0; 6356 err = 0;
6357 md_print_devices(); 6357 md_print_devices();
6358 goto done; 6358 goto done;
6359 6359
6360#ifndef MODULE 6360#ifndef MODULE
6361 case RAID_AUTORUN: 6361 case RAID_AUTORUN:
6362 err = 0; 6362 err = 0;
6363 autostart_arrays(arg); 6363 autostart_arrays(arg);
6364 goto done; 6364 goto done;
6365#endif 6365#endif
6366 default:; 6366 default:;
6367 } 6367 }
6368 6368
6369 /* 6369 /*
@@ -6398,6 +6398,10 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode,
6398 goto abort; 6398 goto abort;
6399 } 6399 }
6400 6400
6401 if (cmd == ADD_NEW_DISK)
6402 /* need to ensure md_delayed_delete() has completed */
6403 flush_workqueue(md_misc_wq);
6404
6401 err = mddev_lock(mddev); 6405 err = mddev_lock(mddev);
6402 if (err) { 6406 if (err) {
6403 printk(KERN_INFO 6407 printk(KERN_INFO
@@ -6406,50 +6410,44 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode,
6406 goto abort; 6410 goto abort;
6407 } 6411 }
6408 6412
6409 switch (cmd) 6413 if (cmd == SET_ARRAY_INFO) {
6410 { 6414 mdu_array_info_t info;
6411 case SET_ARRAY_INFO: 6415 if (!arg)
6412 { 6416 memset(&info, 0, sizeof(info));
6413 mdu_array_info_t info; 6417 else if (copy_from_user(&info, argp, sizeof(info))) {
6414 if (!arg) 6418 err = -EFAULT;
6415 memset(&info, 0, sizeof(info)); 6419 goto abort_unlock;
6416 else if (copy_from_user(&info, argp, sizeof(info))) { 6420 }
6417 err = -EFAULT; 6421 if (mddev->pers) {
6418 goto abort_unlock; 6422 err = update_array_info(mddev, &info);
6419 } 6423 if (err) {
6420 if (mddev->pers) { 6424 printk(KERN_WARNING "md: couldn't update"
6421 err = update_array_info(mddev, &info); 6425 " array info. %d\n", err);
6422 if (err) { 6426 goto abort_unlock;
6423 printk(KERN_WARNING "md: couldn't update"
6424 " array info. %d\n", err);
6425 goto abort_unlock;
6426 }
6427 goto done_unlock;
6428 }
6429 if (!list_empty(&mddev->disks)) {
6430 printk(KERN_WARNING
6431 "md: array %s already has disks!\n",
6432 mdname(mddev));
6433 err = -EBUSY;
6434 goto abort_unlock;
6435 }
6436 if (mddev->raid_disks) {
6437 printk(KERN_WARNING
6438 "md: array %s already initialised!\n",
6439 mdname(mddev));
6440 err = -EBUSY;
6441 goto abort_unlock;
6442 }
6443 err = set_array_info(mddev, &info);
6444 if (err) {
6445 printk(KERN_WARNING "md: couldn't set"
6446 " array info. %d\n", err);
6447 goto abort_unlock;
6448 }
6449 } 6427 }
6450 goto done_unlock; 6428 goto done_unlock;
6451 6429 }
6452 default:; 6430 if (!list_empty(&mddev->disks)) {
6431 printk(KERN_WARNING
6432 "md: array %s already has disks!\n",
6433 mdname(mddev));
6434 err = -EBUSY;
6435 goto abort_unlock;
6436 }
6437 if (mddev->raid_disks) {
6438 printk(KERN_WARNING
6439 "md: array %s already initialised!\n",
6440 mdname(mddev));