From da10fda60c4ab8c96a7c3f5d24fb16bf903317ae Mon Sep 17 00:00:00 2001 From: Frederic Weisbecker Date: May 02 2023 08:55:00 +0000 Subject: Merge 'SLE15-SP5-GA' (44b79bed4d7) into 'SLE15-SP5-RT' - No -rt specific changes this merge. --- diff --git a/patches.suse/block-do-not-reverse-request-order-when-flushing-plu.patch b/patches.suse/block-do-not-reverse-request-order-when-flushing-plu.patch new file mode 100644 index 0000000..db2d150 --- /dev/null +++ b/patches.suse/block-do-not-reverse-request-order-when-flushing-plu.patch @@ -0,0 +1,78 @@ +From: Jan Kara +Date: Tue, 7 Mar 2023 13:42:09 +0100 +Subject: [PATCH] block: do not reverse request order when flushing plug list +References: bsc#1208081 bsc#1208588 bsc#1208076 +Patch-mainline: v6.3-rc3 +Git-commit: 34e0a279a993debaff03158fc2fbf6a00c093643 + +Commit 26fed4ac4eab ("block: flush plug based on hardware and software +queue order") changed flushing of plug list to submit requests one +device at a time. However while doing that it also started using +list_add_tail() instead of list_add() used previously thus effectively +submitting requests in reverse order. Also when forming a rq_list with +remaining requests (in case two or more devices are used), we +effectively reverse the ordering of the plug list for each device we +process. Submitting requests in reverse order has negative impact on +performance for rotational disks (when BFQ is not in use). We observe +10-25% regression in random 4k write throughput on rotational storage on +btrfs filesystem. + +Fix the problem by preserving ordering of the plug list when inserting +requests into the queuelist as well as by appending to requeue_list +instead of prepending to it. + +Fixes: 26fed4ac4eab ("block: flush plug based on hardware and software queue order") +Signed-off-by: Jan Kara +Reviewed-by: Christoph Hellwig +Link: https://lore.kernel.org/r/20230313093002.11756-1-jack@suse.cz +Signed-off-by: Jens Axboe +--- + block/blk-mq.c | 5 +++-- + include/linux/blk-mq.h | 6 ++++++ + 2 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/block/blk-mq.c b/block/blk-mq.c +index d0cb2ef18fe2..cf1a39adf9a5 100644 +--- a/block/blk-mq.c ++++ b/block/blk-mq.c +@@ -2725,6 +2725,7 @@ static void blk_mq_dispatch_plug_list(struct blk_plug *plug, bool from_sched) + struct blk_mq_hw_ctx *this_hctx = NULL; + struct blk_mq_ctx *this_ctx = NULL; + struct request *requeue_list = NULL; ++ struct request **requeue_lastp = &requeue_list; + unsigned int depth = 0; + LIST_HEAD(list); + +@@ -2735,10 +2736,10 @@ static void blk_mq_dispatch_plug_list(struct blk_plug *plug, bool from_sched) + this_hctx = rq->mq_hctx; + this_ctx = rq->mq_ctx; + } else if (this_hctx != rq->mq_hctx || this_ctx != rq->mq_ctx) { +- rq_list_add(&requeue_list, rq); ++ rq_list_add_tail(&requeue_lastp, rq); + continue; + } +- list_add_tail(&rq->queuelist, &list); ++ list_add(&rq->queuelist, &list); + depth++; + } while (!rq_list_empty(plug->mq_list)); + +diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h +index dd5ce1137f04..de0b0c3e7395 100644 +--- a/include/linux/blk-mq.h ++++ b/include/linux/blk-mq.h +@@ -228,6 +228,12 @@ static inline unsigned short req_get_ioprio(struct request *req) + *(listptr) = rq; \ + } while (0) + ++#define rq_list_add_tail(lastpptr, rq) do { \ ++ (rq)->rq_next = NULL; \ ++ **(lastpptr) = rq; \ ++ *(lastpptr) = &rq->rq_next; \ ++} while (0) ++ + #define rq_list_pop(listptr) \ + ({ \ + struct request *__req = NULL; \ +-- +2.35.3 + diff --git a/patches.suse/s390-ap-fix-crash-on-older-machines-based-on-QCI-info-missing.patch b/patches.suse/s390-ap-fix-crash-on-older-machines-based-on-QCI-info-missing.patch new file mode 100644 index 0000000..a32ab43 --- /dev/null +++ b/patches.suse/s390-ap-fix-crash-on-older-machines-based-on-QCI-info-missing.patch @@ -0,0 +1,80 @@ +From: Harald Freudenberger +Date: Fri, 15 Jul 2022 12:23:48 +0200 +Subject: s390/ap: fix crash on older machines based on QCI info missing +Git-commit: 0fef40be5d1f8e7af3d61e8827a63c5862cd99f7 +Patch-mainline: v6.0-rc2 +References: git-fixes bsc#1210947 + +On older z series machines (z12 and older) there is no QCI info +available. The AP code took care of this and the AP bus scan then +switched to simple probing via TAPQ. + +With commit +283915850a44 ("s390/ap: notify drivers on config changed and scan complete callbacks") +some code was introduced which silently assumed that the QCI info is +always available. However, with KVM simulating an older machine (z12) +the result was a kernel crash. Funnily the same crash does not happen +on LPAR - maybe because NULL is a valid pointer and reading some data +from address 0 also works fine. + +This fix now improves the code to be aware that the QCI instruction +may not be available on older machines and thus the two pointers to +QCI info structs may simple be NULL. + +However, on a machine not providing the QCI info the two callbacks to +the zcrypt device drivers on_config_changed() and on_scan_complete() +provide parameters which are pointers to a QCI info struct. +These both callbacks are NOT served if there is no QCI info available. +The only consumer of these callbacks is the vfio device driver. This +driver only supports CEX4 and higher. All physical machines which are +able to provide CEX4 cards have QCI support available. So there is +no sense in for example fill the QCI info struct by hand with looping +over cards and queues and TAPQ each APQN. + +Signed-off-by: Harald Freudenberger +Signed-off-by: Tony Krowiak +Cc: stable@vger.kernel.org +Fixes: 283915850a44 ("s390/ap: notify drivers on config changed and scan complete callbacks") +Signed-off-by: Alexander Gordeev +Acked-by: Miroslav Franc +--- + drivers/s390/crypto/ap_bus.c | 3 +++ + drivers/s390/crypto/ap_bus.h | 4 ++++ + 2 files changed, 7 insertions(+) + +diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c +index 8f1d1cf23d44..59ac98f2bd27 100644 +--- a/drivers/s390/crypto/ap_bus.c ++++ b/drivers/s390/crypto/ap_bus.c +@@ -2086,6 +2086,9 @@ static inline void ap_scan_adapter(int ap) + */ + static bool ap_get_configuration(void) + { ++ if (!ap_qci_info) /* QCI not supported */ ++ return false; ++ + memcpy(ap_qci_info_old, ap_qci_info, sizeof(*ap_qci_info)); + ap_fetch_qci_info(ap_qci_info); + +diff --git a/drivers/s390/crypto/ap_bus.h b/drivers/s390/crypto/ap_bus.h +index 0c40af157df2..0f17933954fb 100644 +--- a/drivers/s390/crypto/ap_bus.h ++++ b/drivers/s390/crypto/ap_bus.h +@@ -148,12 +148,16 @@ struct ap_driver { + /* + * Called at the start of the ap bus scan function when + * the crypto config information (qci) has changed. ++ * This callback is not invoked if there is no AP ++ * QCI support available. + */ + void (*on_config_changed)(struct ap_config_info *new_config_info, + struct ap_config_info *old_config_info); + /* + * Called at the end of the ap bus scan function when + * the crypto config information (qci) has changed. ++ * This callback is not invoked if there is no AP ++ * QCI support available. + */ + void (*on_scan_complete)(struct ap_config_info *new_config_info, + struct ap_config_info *old_config_info); + diff --git a/series.conf b/series.conf index d925516..d977df4 100644 --- a/series.conf +++ b/series.conf @@ -32959,6 +32959,7 @@ patches.suse/RDMA-cxgb4-fix-accept-failure-due-to-increased-cpl_t.patch patches.suse/powerpc-pci-Fix-get_phb_number-locking.patch patches.suse/s390-hypfs-avoid-error-message-under-KVM.patch + patches.suse/s390-ap-fix-crash-on-older-machines-based-on-QCI-info-missing.patch patches.suse/kbuild-fix-the-modules-order-between-drivers-and-lib.patch patches.suse/cifs-remove-unused-server-parameter-from-calc_smb_size-.patch patches.suse/cifs-remove-useless-parameter-is_fsctl-from-SMB2_ioctl-.patch @@ -36920,6 +36921,7 @@ patches.suse/ibmvnic-Assign-XPS-map-to-correct-queue-index.patch patches.suse/0001-net-tls-fix-possible-race-condition-between-do_tls_g.patch patches.suse/bnxt_en-Avoid-order-5-memory-allocation-for-TPA-data.patch + patches.suse/block-do-not-reverse-request-order-when-flushing-plu.patch patches.suse/ice-avoid-bonding-causing-auxiliary-plug-unplug-unde.patch patches.suse/nfc-st-nci-Fix-use-after-free-bug-in-ndlc_remove-due.patch patches.suse/s390-uaccess-add-missing-earlyclobber-annotations-to-__clear_user.patch