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 'block-5.14-2021-08-27' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:

- Revert the mq-deadline priority handling, it's causing serious
performance regressions. While experimental patches exists to fix
this up, it's too late to do so now. Revert it and re-do it properly
for 5.15 instead.

- Fix a NULL vs IS_ERR() regression in this release (Dan)

- Fix a mq-deadline accounting regression in this release (Bart)

- Mark cryptoloop as deprecated. It's broken and dm-crypt fully
supports it, and it's actively intefering with loop. Plan on removal
for 5.16 (Christoph)

* tag 'block-5.14-2021-08-27' of git://git.kernel.dk/linux-block:
cryptoloop: add a deprecation warning
pd: fix a NULL vs IS_ERR() check
Revert "block/mq-deadline: Prioritize high-priority requests"
mq-deadline: Fix request accounting

+21 -45
+16 -42
block/mq-deadline.c
··· 31 31 */ 32 32 static const int read_expire = HZ / 2; /* max time before a read is submitted. */ 33 33 static const int write_expire = 5 * HZ; /* ditto for writes, these limits are SOFT! */ 34 - /* 35 - * Time after which to dispatch lower priority requests even if higher 36 - * priority requests are pending. 37 - */ 38 - static const int aging_expire = 10 * HZ; 39 34 static const int writes_starved = 2; /* max times reads can starve a write */ 40 35 static const int fifo_batch = 16; /* # of sequential requests treated as one 41 36 by the above parameters. For throughput. */ ··· 98 103 int writes_starved; 99 104 int front_merges; 100 105 u32 async_depth; 101 - int aging_expire; 102 106 103 107 spinlock_t lock; 104 108 spinlock_t zone_lock; ··· 363 369 364 370 /* 365 371 * deadline_dispatch_requests selects the best request according to 366 - * read/write expire, fifo_batch, etc and with a start time <= @latest. 372 + * read/write expire, fifo_batch, etc 367 373 */ 368 374 static struct request *__dd_dispatch_request(struct deadline_data *dd, 369 - struct dd_per_prio *per_prio, 370 - u64 latest_start_ns) 375 + struct dd_per_prio *per_prio) 371 376 { 372 377 struct request *rq, *next_rq; 373 378 enum dd_data_dir data_dir; ··· 378 385 if (!list_empty(&per_prio->dispatch)) { 379 386 rq = list_first_entry(&per_prio->dispatch, struct request, 380 387 queuelist); 381 - if (rq->start_time_ns > latest_start_ns) 382 - return NULL; 383 388 list_del_init(&rq->queuelist); 384 389 goto done; 385 390 } ··· 455 464 dd->batching = 0; 456 465 457 466 dispatch_request: 458 - if (rq->start_time_ns > latest_start_ns) 459 - return NULL; 460 467 /* 461 468 * rq is the selected appropriate request. 462 469 */ ··· 483 494 static struct request *dd_dispatch_request(struct blk_mq_hw_ctx *hctx) 484 495 { 485 496 struct deadline_data *dd = hctx->queue->elevator->elevator_data; 486 - const u64 now_ns = ktime_get_ns(); 487 - struct request *rq = NULL; 497 + struct request *rq; 488 498 enum dd_prio prio; 489 499 490 500 spin_lock(&dd->lock); 491 - /* 492 - * Start with dispatching requests whose deadline expired more than 493 - * aging_expire jiffies ago. 494 - */ 495 - for (prio = DD_BE_PRIO; prio <= DD_PRIO_MAX; prio++) { 496 - rq = __dd_dispatch_request(dd, &dd->per_prio[prio], now_ns - 497 - jiffies_to_nsecs(dd->aging_expire)); 498 - if (rq) 499 - goto unlock; 500 - } 501 - /* 502 - * Next, dispatch requests in priority order. Ignore lower priority 503 - * requests if any higher priority requests are pending. 504 - */ 505 501 for (prio = 0; prio <= DD_PRIO_MAX; prio++) { 506 - rq = __dd_dispatch_request(dd, &dd->per_prio[prio], now_ns); 507 - if (rq || dd_queued(dd, prio)) 502 + rq = __dd_dispatch_request(dd, &dd->per_prio[prio]); 503 + if (rq) 508 504 break; 509 505 } 510 - 511 - unlock: 512 506 spin_unlock(&dd->lock); 513 507 514 508 return rq; ··· 592 620 dd->front_merges = 1; 593 621 dd->last_dir = DD_WRITE; 594 622 dd->fifo_batch = fifo_batch; 595 - dd->aging_expire = aging_expire; 596 623 spin_lock_init(&dd->lock); 597 624 spin_lock_init(&dd->zone_lock); 598 625 ··· 682 711 683 712 prio = ioprio_class_to_prio[ioprio_class]; 684 713 dd_count(dd, inserted, prio); 714 + rq->elv.priv[0] = (void *)(uintptr_t)1; 685 715 686 716 if (blk_mq_sched_try_insert_merge(q, rq, &free)) { 687 717 blk_mq_free_requests(&free); ··· 731 759 spin_unlock(&dd->lock); 732 760 } 733 761 734 - /* 735 - * Nothing to do here. This is defined only to ensure that .finish_request 736 - * method is called upon request completion. 737 - */ 762 + /* Callback from inside blk_mq_rq_ctx_init(). */ 738 763 static void dd_prepare_request(struct request *rq) 739 764 { 765 + rq->elv.priv[0] = NULL; 740 766 } 741 767 742 768 /* ··· 761 791 const enum dd_prio prio = ioprio_class_to_prio[ioprio_class]; 762 792 struct dd_per_prio *per_prio = &dd->per_prio[prio]; 763 793 764 - dd_count(dd, completed, prio); 794 + /* 795 + * The block layer core may call dd_finish_request() without having 796 + * called dd_insert_requests(). Hence only update statistics for 797 + * requests for which dd_insert_requests() has been called. See also 798 + * blk_mq_request_bypass_insert(). 799 + */ 800 + if (rq->elv.priv[0]) 801 + dd_count(dd, completed, prio); 765 802 766 803 if (blk_queue_is_zoned(q)) { 767 804 unsigned long flags; ··· 813 836 #define SHOW_JIFFIES(__FUNC, __VAR) SHOW_INT(__FUNC, jiffies_to_msecs(__VAR)) 814 837 SHOW_JIFFIES(deadline_read_expire_show, dd->fifo_expire[DD_READ]); 815 838 SHOW_JIFFIES(deadline_write_expire_show, dd->fifo_expire[DD_WRITE]); 816 - SHOW_JIFFIES(deadline_aging_expire_show, dd->aging_expire); 817 839 SHOW_INT(deadline_writes_starved_show, dd->writes_starved); 818 840 SHOW_INT(deadline_front_merges_show, dd->front_merges); 819 841 SHOW_INT(deadline_async_depth_show, dd->front_merges); ··· 842 866 STORE_FUNCTION(__FUNC, __PTR, MIN, MAX, msecs_to_jiffies) 843 867 STORE_JIFFIES(deadline_read_expire_store, &dd->fifo_expire[DD_READ], 0, INT_MAX); 844 868 STORE_JIFFIES(deadline_write_expire_store, &dd->fifo_expire[DD_WRITE], 0, INT_MAX); 845 - STORE_JIFFIES(deadline_aging_expire_store, &dd->aging_expire, 0, INT_MAX); 846 869 STORE_INT(deadline_writes_starved_store, &dd->writes_starved, INT_MIN, INT_MAX); 847 870 STORE_INT(deadline_front_merges_store, &dd->front_merges, 0, 1); 848 871 STORE_INT(deadline_async_depth_store, &dd->front_merges, 1, INT_MAX); ··· 860 885 DD_ATTR(front_merges), 861 886 DD_ATTR(async_depth), 862 887 DD_ATTR(fifo_batch), 863 - DD_ATTR(aging_expire), 864 888 __ATTR_NULL 865 889 }; 866 890
+2 -2
drivers/block/Kconfig
··· 213 213 dynamically allocated with the /dev/loop-control interface. 214 214 215 215 config BLK_DEV_CRYPTOLOOP 216 - tristate "Cryptoloop Support" 216 + tristate "Cryptoloop Support (DEPRECATED)" 217 217 select CRYPTO 218 218 select CRYPTO_CBC 219 219 depends on BLK_DEV_LOOP ··· 225 225 WARNING: This device is not safe for journaled file systems like 226 226 ext3 or Reiserfs. Please use the Device Mapper crypto module 227 227 instead, which can be configured to be on-disk compatible with the 228 - cryptoloop device. 228 + cryptoloop device. cryptoloop support will be removed in Linux 5.16. 229 229 230 230 source "drivers/block/drbd/Kconfig" 231 231
+2
drivers/block/cryptoloop.c
··· 189 189 190 190 if (rc) 191 191 printk(KERN_ERR "cryptoloop: loop_register_transfer failed\n"); 192 + else 193 + pr_warn("the cryptoloop driver has been deprecated and will be removed in in Linux 5.16\n"); 192 194 return rc; 193 195 } 194 196
+1 -1
drivers/block/paride/pd.c
··· 892 892 return; 893 893 894 894 p = blk_mq_alloc_disk(&disk->tag_set, disk); 895 - if (!p) { 895 + if (IS_ERR(p)) { 896 896 blk_mq_free_tag_set(&disk->tag_set); 897 897 return; 898 898 }