Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-linus-20190104' of git://git.kernel.dk/linux-block

Pull block updates and fixes from Jens Axboe:

- Pulled in MD changes that Shaohua had queued up for 4.21.

Unfortunately we lost Shaohua late 2018, I'm sending these in on his
behalf.

- In conjunction with the above, I added a CREDITS entry for Shaoua.

- sunvdc queue restart fix (Ming)

* tag 'for-linus-20190104' of git://git.kernel.dk/linux-block:
Add CREDITS entry for Shaohua Li
block: sunvdc: don't run hw queue synchronously from irq context
md: fix raid10 hang issue caused by barrier
raid10: refactor common wait code from regular read/write request
md: remvoe redundant condition check
lib/raid6: add option to skip algo benchmarking
lib/raid6: sort algos in rough performance order
lib/raid6: check for assembler SSSE3 support
lib/raid6: avoid __attribute_const__ redefinition
lib/raid6: add missing include for raid6test
md: remove set but not used variable 'bi_rdev'

+102 -98
+6
CREDITS
··· 2208 2208 E: sparse@chrisli.org 2209 2209 D: Sparse maintainer 2009 - 2018 2210 2210 2211 + N: Shaohua Li 2212 + D: Worked on many parts of the kernel, from core x86, ACPI, PCI, KVM, MM, 2213 + D: and much more. He was the maintainer of MD from 2016 to 2018. Shaohua 2214 + D: passed away late 2018, he will be greatly missed. 2215 + W: https://www.spinics.net/lists/raid/msg61993.html 2216 + 2211 2217 N: Stephan Linz 2212 2218 E: linz@mazet.de 2213 2219 E: Stephan.Linz@gmx.de
+1 -1
drivers/block/sunvdc.c
··· 181 181 * allocated a disk. 182 182 */ 183 183 if (port->disk && vdc_tx_dring_avail(dr) * 100 / VDC_TX_RING_SIZE >= 50) 184 - blk_mq_start_hw_queues(port->disk->queue); 184 + blk_mq_start_stopped_hw_queues(port->disk->queue, true); 185 185 } 186 186 187 187 static void vdc_finish(struct vio_driver_state *vio, int err, int waiting_for)
+4 -10
drivers/md/md.c
··· 2147 2147 */ 2148 2148 int md_integrity_add_rdev(struct md_rdev *rdev, struct mddev *mddev) 2149 2149 { 2150 - struct blk_integrity *bi_rdev; 2151 2150 struct blk_integrity *bi_mddev; 2152 2151 char name[BDEVNAME_SIZE]; 2153 2152 2154 2153 if (!mddev->gendisk) 2155 2154 return 0; 2156 2155 2157 - bi_rdev = bdev_get_integrity(rdev->bdev); 2158 2156 bi_mddev = blk_get_integrity(mddev->gendisk); 2159 2157 2160 2158 if (!bi_mddev) /* nothing to do */ ··· 5691 5693 return 0; 5692 5694 5693 5695 abort: 5694 - if (mddev->flush_bio_pool) { 5695 - mempool_destroy(mddev->flush_bio_pool); 5696 - mddev->flush_bio_pool = NULL; 5697 - } 5698 - if (mddev->flush_pool){ 5699 - mempool_destroy(mddev->flush_pool); 5700 - mddev->flush_pool = NULL; 5701 - } 5696 + mempool_destroy(mddev->flush_bio_pool); 5697 + mddev->flush_bio_pool = NULL; 5698 + mempool_destroy(mddev->flush_pool); 5699 + mddev->flush_pool = NULL; 5702 5700 5703 5701 return err; 5704 5702 }
+29 -47
drivers/md/raid10.c
··· 1124 1124 kfree(plug); 1125 1125 } 1126 1126 1127 + /* 1128 + * 1. Register the new request and wait if the reconstruction thread has put 1129 + * up a bar for new requests. Continue immediately if no resync is active 1130 + * currently. 1131 + * 2. If IO spans the reshape position. Need to wait for reshape to pass. 1132 + */ 1133 + static void regular_request_wait(struct mddev *mddev, struct r10conf *conf, 1134 + struct bio *bio, sector_t sectors) 1135 + { 1136 + wait_barrier(conf); 1137 + while (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) && 1138 + bio->bi_iter.bi_sector < conf->reshape_progress && 1139 + bio->bi_iter.bi_sector + sectors > conf->reshape_progress) { 1140 + raid10_log(conf->mddev, "wait reshape"); 1141 + allow_barrier(conf); 1142 + wait_event(conf->wait_barrier, 1143 + conf->reshape_progress <= bio->bi_iter.bi_sector || 1144 + conf->reshape_progress >= bio->bi_iter.bi_sector + 1145 + sectors); 1146 + wait_barrier(conf); 1147 + } 1148 + } 1149 + 1127 1150 static void raid10_read_request(struct mddev *mddev, struct bio *bio, 1128 1151 struct r10bio *r10_bio) 1129 1152 { ··· 1155 1132 const int op = bio_op(bio); 1156 1133 const unsigned long do_sync = (bio->bi_opf & REQ_SYNC); 1157 1134 int max_sectors; 1158 - sector_t sectors; 1159 1135 struct md_rdev *rdev; 1160 1136 char b[BDEVNAME_SIZE]; 1161 1137 int slot = r10_bio->read_slot; ··· 1188 1166 } 1189 1167 rcu_read_unlock(); 1190 1168 } 1191 - /* 1192 - * Register the new request and wait if the reconstruction 1193 - * thread has put up a bar for new requests. 1194 - * Continue immediately if no resync is active currently. 1195 - */ 1196 - wait_barrier(conf); 1197 1169 1198 - sectors = r10_bio->sectors; 1199 - while (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) && 1200 - bio->bi_iter.bi_sector < conf->reshape_progress && 1201 - bio->bi_iter.bi_sector + sectors > conf->reshape_progress) { 1202 - /* 1203 - * IO spans the reshape position. Need to wait for reshape to 1204 - * pass 1205 - */ 1206 - raid10_log(conf->mddev, "wait reshape"); 1207 - allow_barrier(conf); 1208 - wait_event(conf->wait_barrier, 1209 - conf->reshape_progress <= bio->bi_iter.bi_sector || 1210 - conf->reshape_progress >= bio->bi_iter.bi_sector + 1211 - sectors); 1212 - wait_barrier(conf); 1213 - } 1214 - 1170 + regular_request_wait(mddev, conf, bio, r10_bio->sectors); 1215 1171 rdev = read_balance(conf, r10_bio, &max_sectors); 1216 1172 if (!rdev) { 1217 1173 if (err_rdev) { ··· 1209 1209 struct bio *split = bio_split(bio, max_sectors, 1210 1210 gfp, &conf->bio_split); 1211 1211 bio_chain(split, bio); 1212 + allow_barrier(conf); 1212 1213 generic_make_request(bio); 1214 + wait_barrier(conf); 1213 1215 bio = split; 1214 1216 r10_bio->master_bio = bio; 1215 1217 r10_bio->sectors = max_sectors; ··· 1334 1332 finish_wait(&conf->wait_barrier, &w); 1335 1333 } 1336 1334 1337 - /* 1338 - * Register the new request and wait if the reconstruction 1339 - * thread has put up a bar for new requests. 1340 - * Continue immediately if no resync is active currently. 1341 - */ 1342 - wait_barrier(conf); 1343 - 1344 1335 sectors = r10_bio->sectors; 1345 - while (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) && 1346 - bio->bi_iter.bi_sector < conf->reshape_progress && 1347 - bio->bi_iter.bi_sector + sectors > conf->reshape_progress) { 1348 - /* 1349 - * IO spans the reshape position. Need to wait for reshape to 1350 - * pass 1351 - */ 1352 - raid10_log(conf->mddev, "wait reshape"); 1353 - allow_barrier(conf); 1354 - wait_event(conf->wait_barrier, 1355 - conf->reshape_progress <= bio->bi_iter.bi_sector || 1356 - conf->reshape_progress >= bio->bi_iter.bi_sector + 1357 - sectors); 1358 - wait_barrier(conf); 1359 - } 1360 - 1336 + regular_request_wait(mddev, conf, bio, sectors); 1361 1337 if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) && 1362 1338 (mddev->reshape_backwards 1363 1339 ? (bio->bi_iter.bi_sector < conf->reshape_safe && ··· 1494 1514 struct bio *split = bio_split(bio, r10_bio->sectors, 1495 1515 GFP_NOIO, &conf->bio_split); 1496 1516 bio_chain(split, bio); 1517 + allow_barrier(conf); 1497 1518 generic_make_request(bio); 1519 + wait_barrier(conf); 1498 1520 bio = split; 1499 1521 r10_bio->master_bio = bio; 1500 1522 }
+7 -1
include/linux/raid/pq.h
··· 35 35 #include <limits.h> 36 36 #include <stddef.h> 37 37 #include <sys/mman.h> 38 + #include <sys/time.h> 38 39 #include <sys/types.h> 39 40 40 41 /* Not standard, but glibc defines it */ ··· 53 52 54 53 #define __init 55 54 #define __exit 56 - #define __attribute_const__ __attribute__((const)) 55 + #ifndef __attribute_const__ 56 + # define __attribute_const__ __attribute__((const)) 57 + #endif 57 58 #define noinline __attribute__((noinline)) 58 59 59 60 #define preempt_enable() ··· 70 67 #define MODULE_DESCRIPTION(desc) 71 68 #define subsys_initcall(x) 72 69 #define module_exit(x) 70 + 71 + #define IS_ENABLED(x) (x) 72 + #define CONFIG_RAID6_PQ_BENCHMARK 1 73 73 #endif /* __KERNEL__ */ 74 74 75 75 /* Routine choices */
+8
lib/Kconfig
··· 10 10 config RAID6_PQ 11 11 tristate 12 12 13 + config RAID6_PQ_BENCHMARK 14 + bool "Automatically choose fastest RAID6 PQ functions" 15 + depends on RAID6_PQ 16 + default y 17 + help 18 + Benchmark all available RAID6 PQ functions on init and choose the 19 + fastest one. 20 + 13 21 config BITREVERSE 14 22 tristate 15 23
+44 -39
lib/raid6/algos.c
··· 34 34 EXPORT_SYMBOL_GPL(raid6_call); 35 35 36 36 const struct raid6_calls * const raid6_algos[] = { 37 - #if defined(__ia64__) 38 - &raid6_intx16, 39 - &raid6_intx32, 40 - #endif 41 37 #if defined(__i386__) && !defined(__arch_um__) 42 - &raid6_mmxx1, 43 - &raid6_mmxx2, 44 - &raid6_sse1x1, 45 - &raid6_sse1x2, 46 - &raid6_sse2x1, 47 - &raid6_sse2x2, 48 - #ifdef CONFIG_AS_AVX2 49 - &raid6_avx2x1, 50 - &raid6_avx2x2, 51 - #endif 52 38 #ifdef CONFIG_AS_AVX512 53 - &raid6_avx512x1, 54 39 &raid6_avx512x2, 40 + &raid6_avx512x1, 55 41 #endif 42 + #ifdef CONFIG_AS_AVX2 43 + &raid6_avx2x2, 44 + &raid6_avx2x1, 45 + #endif 46 + &raid6_sse2x2, 47 + &raid6_sse2x1, 48 + &raid6_sse1x2, 49 + &raid6_sse1x1, 50 + &raid6_mmxx2, 51 + &raid6_mmxx1, 56 52 #endif 57 53 #if defined(__x86_64__) && !defined(__arch_um__) 58 - &raid6_sse2x1, 59 - &raid6_sse2x2, 60 - &raid6_sse2x4, 61 - #ifdef CONFIG_AS_AVX2 62 - &raid6_avx2x1, 63 - &raid6_avx2x2, 64 - &raid6_avx2x4, 65 - #endif 66 54 #ifdef CONFIG_AS_AVX512 67 - &raid6_avx512x1, 68 - &raid6_avx512x2, 69 55 &raid6_avx512x4, 56 + &raid6_avx512x2, 57 + &raid6_avx512x1, 70 58 #endif 59 + #ifdef CONFIG_AS_AVX2 60 + &raid6_avx2x4, 61 + &raid6_avx2x2, 62 + &raid6_avx2x1, 63 + #endif 64 + &raid6_sse2x4, 65 + &raid6_sse2x2, 66 + &raid6_sse2x1, 71 67 #endif 72 68 #ifdef CONFIG_ALTIVEC 73 - &raid6_altivec1, 74 - &raid6_altivec2, 75 - &raid6_altivec4, 76 - &raid6_altivec8, 77 - &raid6_vpermxor1, 78 - &raid6_vpermxor2, 79 - &raid6_vpermxor4, 80 69 &raid6_vpermxor8, 70 + &raid6_vpermxor4, 71 + &raid6_vpermxor2, 72 + &raid6_vpermxor1, 73 + &raid6_altivec8, 74 + &raid6_altivec4, 75 + &raid6_altivec2, 76 + &raid6_altivec1, 81 77 #endif 82 78 #if defined(CONFIG_S390) 83 79 &raid6_s390vx8, 84 80 #endif 85 - &raid6_intx1, 86 - &raid6_intx2, 87 - &raid6_intx4, 88 - &raid6_intx8, 89 81 #ifdef CONFIG_KERNEL_MODE_NEON 90 - &raid6_neonx1, 91 - &raid6_neonx2, 92 - &raid6_neonx4, 93 82 &raid6_neonx8, 83 + &raid6_neonx4, 84 + &raid6_neonx2, 85 + &raid6_neonx1, 94 86 #endif 87 + #if defined(__ia64__) 88 + &raid6_intx32, 89 + &raid6_intx16, 90 + #endif 91 + &raid6_intx8, 92 + &raid6_intx4, 93 + &raid6_intx2, 94 + &raid6_intx1, 95 95 NULL 96 96 }; 97 97 ··· 162 162 if (!best || (*algo)->prefer >= best->prefer) { 163 163 if ((*algo)->valid && !(*algo)->valid()) 164 164 continue; 165 + 166 + if (!IS_ENABLED(CONFIG_RAID6_PQ_BENCHMARK)) { 167 + best = *algo; 168 + break; 169 + } 165 170 166 171 perf = 0; 167 172
+3
lib/raid6/test/Makefile
··· 34 34 35 35 ifeq ($(IS_X86),yes) 36 36 OBJS += mmx.o sse1.o sse2.o avx2.o recov_ssse3.o recov_avx2.o avx512.o recov_avx512.o 37 + CFLAGS += $(shell echo "pshufb %xmm0, %xmm0" | \ 38 + gcc -c -x assembler - >&/dev/null && \ 39 + rm ./-.o && echo -DCONFIG_AS_SSSE3=1) 37 40 CFLAGS += $(shell echo "vpbroadcastb %xmm0, %ymm1" | \ 38 41 gcc -c -x assembler - >&/dev/null && \ 39 42 rm ./-.o && echo -DCONFIG_AS_AVX2=1)