History

Merge tag 'for-5.17/drivers-2022-01-11' of git://git.kernel.dk/linux-block

Pull block driver updates from Jens Axboe: - mtip32xx pci cleanups (Bjorn) - mtip32xx conversion to generic power management (Vaibhav) - rsxx pci powermanagement cleanups (Bjorn) - Remove the rsxx driver. This hardware never saw much adoption, and it's been end of lifed for a while. (Christoph) - MD pull request from Song: - REQ_NOWAIT support (Vishal Verma) - raid6 benchmark optimization (Dirk Müller) - Fix for acct bioset (Xiao Ni) - Clean up max_queued_requests (Mariusz Tkaczyk) - PREEMPT_RT optimization (Davidlohr Bueso) - Use default_groups in kobj_type (Greg Kroah-Hartman) - Use attribute groups in pktcdvd and rnbd (Greg) - NVMe pull request from Christoph: - increment request genctr on completion (Keith Busch, Geliang Tang) - add a 'iopolicy' module parameter (Hannes Reinecke) - print out valid arguments when reading from /dev/nvme-fabrics (Hannes Reinecke) - Use struct_group() in drbd (Kees) - null_blk fixes (Ming) - Get rid of congestion logic in pktcdvd (Neil) - Floppy ejection hang fix (Tasos) - Floppy max user request size fix (Xiongwei) - Loop locking fix (Tetsuo) * tag 'for-5.17/drivers-2022-01-11' of git://git.kernel.dk/linux-block: (32 commits) md: use default_groups in kobj_type md: Move alloc/free acct bioset in to personality lib/raid6: Use strict priority ranking for pq gen() benchmarking lib/raid6: skip benchmark of non-chosen xor_syndrome functions md: fix spelling of "its" md: raid456 add nowait support md: raid10 add nowait support md: raid1 add nowait support md: add support for REQ_NOWAIT md: drop queue limitation for RAID1 and RAID10 md/raid5: play nice with PREEMPT_RT block/rnbd-clt-sysfs: use default_groups in kobj_type pktcdvd: convert to use attribute groups block: null_blk: only set set->nr_maps as 3 if active poll_queues is > 0 nvme: add 'iopolicy' module parameter nvme: drop unused variable ctrl in nvme_setup_cmd nvme: increment request genctr on completion nvme-fabrics: print out valid arguments when reading from /dev/nvme-fabrics block: remove the rsxx driver rsxx: Drop PCI legacy power management ...

Linus Torvalds committed 4 years ago

Commit c9193f42 parents d3c8108 d85bd8240 files · +612 −4501Browse files

Showing the changes to lib (3 of 40 files). Show all

Unified · Split

3 files
  1. lib/raid6/algos.c +38 −40
  2. lib/raid6/avx2.c +4 −4
  3. lib/raid6/avx512.c +3 −3
lib/raid6/algos.c+38−40
@@ -145,13 +145,13 @@ static inline const struct raid6_recov_calls *raid6_choose_recov(void) · 144 unmodified lines
145145 static inline const struct raid6_calls *raid6_choose_gen(
146146 void *(*const dptrs)[RAID6_TEST_DISKS], const int disks)
147147 {
148− unsigned long perf, bestgenperf, bestxorperf, j0, j1;
148+ unsigned long perf, bestgenperf, j0, j1;
149149 int start = (disks>>1)-1, stop = disks-3; /* work on the second half of the disks */
150150 const struct raid6_calls *const *algo;
151151 const struct raid6_calls *best;
152152
153− for (bestgenperf = 0, bestxorperf = 0, best = NULL, algo = raid6_algos; *algo; algo++) {
154− if (!best || (*algo)->prefer >= best->prefer) {
153+ for (bestgenperf = 0, best = NULL, algo = raid6_algos; *algo; algo++) {
154+ if (!best || (*algo)->priority >= best->priority) {
155155 if ((*algo)->valid && !(*algo)->valid())
156156 continue;
157157
@@ -180,50 +180,48 @@ static inline const struct raid6_calls *raid6_choose_gen( · 22 unmodified lines
180180 pr_info("raid6: %-8s gen() %5ld MB/s\n", (*algo)->name,
181181 (perf * HZ * (disks-2)) >>
182182 (20 - PAGE_SHIFT + RAID6_TIME_JIFFIES_LG2));
183+ }
184+ }
183185
184− if (!(*algo)->xor_syndrome)
185− continue;
186+ if (!best) {
187+ pr_err("raid6: Yikes! No algorithm found!\n");
188+ goto out;
189+ }
186190
187− perf = 0;
191+ raid6_call = *best;
188192
189− preempt_disable();
190− j0 = jiffies;
191− while ((j1 = jiffies) == j0)
192− cpu_relax();
193− while (time_before(jiffies,
194− j1 + (1<<RAID6_TIME_JIFFIES_LG2))) {
195− (*algo)->xor_syndrome(disks, start, stop,
196− PAGE_SIZE, *dptrs);
197− perf++;
198− }
199− preempt_enable();
200−
201− if (best == *algo)
202− bestxorperf = perf;
193+ if (!IS_ENABLED(CONFIG_RAID6_PQ_BENCHMARK)) {
194+ pr_info("raid6: skipped pq benchmark and selected %s\n",
195+ best->name);
196+ goto out;
197+ }
203198
204− pr_info("raid6: %-8s xor() %5ld MB/s\n", (*algo)->name,
205− (perf * HZ * (disks-2)) >>
206− (20 - PAGE_SHIFT + RAID6_TIME_JIFFIES_LG2 + 1));
199+ pr_info("raid6: using algorithm %s gen() %ld MB/s\n",
200+ best->name,
201+ (bestgenperf * HZ * (disks - 2)) >>
202+ (20 - PAGE_SHIFT + RAID6_TIME_JIFFIES_LG2));
203+
204+ if (best->xor_syndrome) {
205+ perf = 0;
206+
207+ preempt_disable();
208+ j0 = jiffies;
209+ while ((j1 = jiffies) == j0)
210+ cpu_relax();
211+ while (time_before(jiffies,
212+ j1 + (1 << RAID6_TIME_JIFFIES_LG2))) {
213+ best->xor_syndrome(disks, start, stop,
214+ PAGE_SIZE, *dptrs);
215+ perf++;
207216 }
208− }
217+ preempt_enable();
209218
210− if (best) {
211− if (IS_ENABLED(CONFIG_RAID6_PQ_BENCHMARK)) {
212− pr_info("raid6: using algorithm %s gen() %ld MB/s\n",
213− best->name,
214− (bestgenperf * HZ * (disks-2)) >>
215− (20 - PAGE_SHIFT+RAID6_TIME_JIFFIES_LG2));
216− if (best->xor_syndrome)
217− pr_info("raid6: .... xor() %ld MB/s, rmw enabled\n",
218− (bestxorperf * HZ * (disks-2)) >>
219− (20 - PAGE_SHIFT + RAID6_TIME_JIFFIES_LG2 + 1));
220− } else
221− pr_info("raid6: skip pq benchmark and using algorithm %s\n",
222− best->name);
223− raid6_call = *best;
224− } else
225− pr_err("raid6: Yikes! No algorithm found!\n");
219+ pr_info("raid6: .... xor() %ld MB/s, rmw enabled\n",
220+ (perf * HZ * (disks - 2)) >>
221+ (20 - PAGE_SHIFT + RAID6_TIME_JIFFIES_LG2 + 1));
222+ }
226223
224+out:
227225 return best;
228226 }
229227
lib/raid6/avx2.c+4−4
@@ -132,7 +132,7 @@ const struct raid6_calls raid6_avx2x1 = { · 131 unmodified lines
132132 raid6_avx21_xor_syndrome,
133133 raid6_have_avx2,
134134 "avx2x1",
135− 1 /* Has cache hints */
135+ .priority = 2 /* Prefer AVX2 over priority 1 (SSE2 and others) */
136136 };
137137
138138 /*
@@ -262,7 +262,7 @@ const struct raid6_calls raid6_avx2x2 = { · 123 unmodified lines
262262 raid6_avx22_xor_syndrome,
263263 raid6_have_avx2,
264264 "avx2x2",
265− 1 /* Has cache hints */
265+ .priority = 2 /* Prefer AVX2 over priority 1 (SSE2 and others) */
266266 };
267267
268268 #ifdef CONFIG_X86_64
@@ -465,6 +465,6 @@ const struct raid6_calls raid6_avx2x4 = { · 196 unmodified lines
465465 raid6_avx24_xor_syndrome,
466466 raid6_have_avx2,
467467 "avx2x4",
468− 1 /* Has cache hints */
468+ .priority = 2 /* Prefer AVX2 over priority 1 (SSE2 and others) */
469469 };
470−#endif
470+#endif /* CONFIG_X86_64 */
lib/raid6/avx512.c+3−3
@@ -162,7 +162,7 @@ const struct raid6_calls raid6_avx512x1 = { · 161 unmodified lines
162162 raid6_avx5121_xor_syndrome,
163163 raid6_have_avx512,
164164 "avx512x1",
165− 1 /* Has cache hints */
165+ .priority = 2 /* Prefer AVX512 over priority 1 (SSE2 and others) */
166166 };
167167
168168 /*
@@ -319,7 +319,7 @@ const struct raid6_calls raid6_avx512x2 = { · 150 unmodified lines
319319 raid6_avx5122_xor_syndrome,
320320 raid6_have_avx512,
321321 "avx512x2",
322− 1 /* Has cache hints */
322+ .priority = 2 /* Prefer AVX512 over priority 1 (SSE2 and others) */
323323 };
324324
325325 #ifdef CONFIG_X86_64
@@ -557,7 +557,7 @@ const struct raid6_calls raid6_avx512x4 = { · 231 unmodified lines
557557 raid6_avx5124_xor_syndrome,
558558 raid6_have_avx512,
559559 "avx512x4",
560− 1 /* Has cache hints */
560+ .priority = 2 /* Prefer AVX512 over priority 1 (SSE2 and others) */
561561 };
562562 #endif
563563

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t