]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Aug 2023 07:15:17 +0000 (09:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Aug 2023 07:15:17 +0000 (09:15 +0200)
added patches:
libceph-fix-potential-hang-in-ceph_osdc_notify.patch
loop-select-i-o-scheduler-none-from-inside-add_disk.patch
usb-zaurus-add-id-for-a-300-b-500-c-700.patch

queue-4.14/libceph-fix-potential-hang-in-ceph_osdc_notify.patch [new file with mode: 0644]
queue-4.14/loop-select-i-o-scheduler-none-from-inside-add_disk.patch [new file with mode: 0644]
queue-4.14/series
queue-4.14/usb-zaurus-add-id-for-a-300-b-500-c-700.patch [new file with mode: 0644]

diff --git a/queue-4.14/libceph-fix-potential-hang-in-ceph_osdc_notify.patch b/queue-4.14/libceph-fix-potential-hang-in-ceph_osdc_notify.patch
new file mode 100644 (file)
index 0000000..fd2dd1c
--- /dev/null
@@ -0,0 +1,69 @@
+From e6e2843230799230fc5deb8279728a7218b0d63c Mon Sep 17 00:00:00 2001
+From: Ilya Dryomov <idryomov@gmail.com>
+Date: Tue, 1 Aug 2023 19:14:24 +0200
+Subject: libceph: fix potential hang in ceph_osdc_notify()
+
+From: Ilya Dryomov <idryomov@gmail.com>
+
+commit e6e2843230799230fc5deb8279728a7218b0d63c upstream.
+
+If the cluster becomes unavailable, ceph_osdc_notify() may hang even
+with osd_request_timeout option set because linger_notify_finish_wait()
+waits for MWatchNotify NOTIFY_COMPLETE message with no associated OSD
+request in flight -- it's completely asynchronous.
+
+Introduce an additional timeout, derived from the specified notify
+timeout.  While at it, switch both waits to killable which is more
+correct.
+
+Cc: stable@vger.kernel.org
+Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
+Reviewed-by: Dongsheng Yang <dongsheng.yang@easystack.cn>
+Reviewed-by: Xiubo Li <xiubli@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ceph/osd_client.c |   20 ++++++++++++++------
+ 1 file changed, 14 insertions(+), 6 deletions(-)
+
+--- a/net/ceph/osd_client.c
++++ b/net/ceph/osd_client.c
+@@ -3041,17 +3041,24 @@ static int linger_reg_commit_wait(struct
+       int ret;
+       dout("%s lreq %p linger_id %llu\n", __func__, lreq, lreq->linger_id);
+-      ret = wait_for_completion_interruptible(&lreq->reg_commit_wait);
++      ret = wait_for_completion_killable(&lreq->reg_commit_wait);
+       return ret ?: lreq->reg_commit_error;
+ }
+-static int linger_notify_finish_wait(struct ceph_osd_linger_request *lreq)
++static int linger_notify_finish_wait(struct ceph_osd_linger_request *lreq,
++                                   unsigned long timeout)
+ {
+-      int ret;
++      long left;
+       dout("%s lreq %p linger_id %llu\n", __func__, lreq, lreq->linger_id);
+-      ret = wait_for_completion_interruptible(&lreq->notify_finish_wait);
+-      return ret ?: lreq->notify_finish_error;
++      left = wait_for_completion_killable_timeout(&lreq->notify_finish_wait,
++                                              ceph_timeout_jiffies(timeout));
++      if (left <= 0)
++              left = left ?: -ETIMEDOUT;
++      else
++              left = lreq->notify_finish_error; /* completed */
++
++      return left;
+ }
+ /*
+@@ -4666,7 +4673,8 @@ int ceph_osdc_notify(struct ceph_osd_cli
+       ret = linger_reg_commit_wait(lreq);
+       if (!ret)
+-              ret = linger_notify_finish_wait(lreq);
++              ret = linger_notify_finish_wait(lreq,
++                               msecs_to_jiffies(2 * timeout * MSEC_PER_SEC));
+       else
+               dout("lreq %p failed to initiate notify %d\n", lreq, ret);
diff --git a/queue-4.14/loop-select-i-o-scheduler-none-from-inside-add_disk.patch b/queue-4.14/loop-select-i-o-scheduler-none-from-inside-add_disk.patch
new file mode 100644 (file)
index 0000000..22412a6
--- /dev/null
@@ -0,0 +1,53 @@
+From 2112f5c1330a671fa852051d85cb9eadc05d7eb7 Mon Sep 17 00:00:00 2001
+From: Bart Van Assche <bvanassche@acm.org>
+Date: Thu, 5 Aug 2021 10:42:00 -0700
+Subject: loop: Select I/O scheduler 'none' from inside add_disk()
+
+From: Bart Van Assche <bvanassche@acm.org>
+
+commit 2112f5c1330a671fa852051d85cb9eadc05d7eb7 upstream.
+
+We noticed that the user interface of Android devices becomes very slow
+under memory pressure. This is because Android uses the zram driver on top
+of the loop driver for swapping, because under memory pressure the swap
+code alternates reads and writes quickly, because mq-deadline is the
+default scheduler for loop devices and because mq-deadline delays writes by
+five seconds for such a workload with default settings. Fix this by making
+the kernel select I/O scheduler 'none' from inside add_disk() for loop
+devices. This default can be overridden at any time from user space,
+e.g. via a udev rule. This approach has an advantage compared to changing
+the I/O scheduler from userspace from 'mq-deadline' into 'none', namely
+that synchronize_rcu() does not get called.
+
+This patch changes the default I/O scheduler for loop devices from
+'mq-deadline' into 'none'.
+
+Additionally, this patch reduces the Android boot time on my test setup
+with 0.5 seconds compared to configuring the loop I/O scheduler from user
+space.
+
+Cc: Christoph Hellwig <hch@lst.de>
+Cc: Ming Lei <ming.lei@redhat.com>
+Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
+Cc: Martijn Coenen <maco@android.com>
+Cc: Jaegeuk Kim <jaegeuk@kernel.org>
+Signed-off-by: Bart Van Assche <bvanassche@acm.org>
+Link: https://lore.kernel.org/r/20210805174200.3250718-3-bvanassche@acm.org
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/block/loop.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/block/loop.c
++++ b/drivers/block/loop.c
+@@ -1846,7 +1846,8 @@ static int loop_add(struct loop_device *
+       lo->tag_set.queue_depth = 128;
+       lo->tag_set.numa_node = NUMA_NO_NODE;
+       lo->tag_set.cmd_size = sizeof(struct loop_cmd);
+-      lo->tag_set.flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_SG_MERGE;
++      lo->tag_set.flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_SG_MERGE |
++              BLK_MQ_F_NO_SCHED;
+       lo->tag_set.driver_data = lo;
+       err = blk_mq_alloc_tag_set(&lo->tag_set);
index 69fa70c3d0318f1cc573bc6335ba977c1ecb9354..7f108b99188d341580c058ce847ddaf02b39fb7a 100644 (file)
@@ -194,3 +194,5 @@ tcp_metrics-annotate-data-races-around-tm-tcpm_vals.patch
 tcp_metrics-annotate-data-races-around-tm-tcpm_net.patch
 tcp_metrics-fix-data-race-in-tcpm_suck_dst-vs-fastop.patch
 loop-select-i-o-scheduler-none-from-inside-add_disk.patch
+libceph-fix-potential-hang-in-ceph_osdc_notify.patch
+usb-zaurus-add-id-for-a-300-b-500-c-700.patch
diff --git a/queue-4.14/usb-zaurus-add-id-for-a-300-b-500-c-700.patch b/queue-4.14/usb-zaurus-add-id-for-a-300-b-500-c-700.patch
new file mode 100644 (file)
index 0000000..b779c70
--- /dev/null
@@ -0,0 +1,111 @@
+From b99225b4fe297d07400f9e2332ecd7347b224f8d Mon Sep 17 00:00:00 2001
+From: Ross Maynard <bids.7405@bigpond.com>
+Date: Mon, 31 Jul 2023 15:42:04 +1000
+Subject: USB: zaurus: Add ID for A-300/B-500/C-700
+
+From: Ross Maynard <bids.7405@bigpond.com>
+
+commit b99225b4fe297d07400f9e2332ecd7347b224f8d upstream.
+
+The SL-A300, B500/5600, and C700 devices no longer auto-load because of
+"usbnet: Remove over-broad module alias from zaurus."
+This patch adds IDs for those 3 devices.
+
+Link: https://bugzilla.kernel.org/show_bug.cgi?id=217632
+Fixes: 16adf5d07987 ("usbnet: Remove over-broad module alias from zaurus.")
+Signed-off-by: Ross Maynard <bids.7405@bigpond.com>
+Cc: stable@vger.kernel.org
+Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Reviewed-by: Andrew Lunn <andrew@lunn.ch>
+Link: https://lore.kernel.org/r/69b5423b-2013-9fc9-9569-58e707d9bafb@bigpond.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/usb/cdc_ether.c |   21 +++++++++++++++++++++
+ drivers/net/usb/zaurus.c    |   21 +++++++++++++++++++++
+ 2 files changed, 42 insertions(+)
+
+--- a/drivers/net/usb/cdc_ether.c
++++ b/drivers/net/usb/cdc_ether.c
+@@ -618,6 +618,13 @@ static const struct usb_device_id produc
+       .match_flags    =   USB_DEVICE_ID_MATCH_INT_INFO
+                         | USB_DEVICE_ID_MATCH_DEVICE,
+       .idVendor               = 0x04DD,
++      .idProduct              = 0x8005,   /* A-300 */
++      ZAURUS_FAKE_INTERFACE,
++      .driver_info        = 0,
++}, {
++      .match_flags    =   USB_DEVICE_ID_MATCH_INT_INFO
++                        | USB_DEVICE_ID_MATCH_DEVICE,
++      .idVendor               = 0x04DD,
+       .idProduct              = 0x8006,       /* B-500/SL-5600 */
+       ZAURUS_MASTER_INTERFACE,
+       .driver_info            = 0,
+@@ -625,11 +632,25 @@ static const struct usb_device_id        produc
+       .match_flags    =   USB_DEVICE_ID_MATCH_INT_INFO
+                         | USB_DEVICE_ID_MATCH_DEVICE,
+       .idVendor               = 0x04DD,
++      .idProduct              = 0x8006,   /* B-500/SL-5600 */
++      ZAURUS_FAKE_INTERFACE,
++      .driver_info        = 0,
++}, {
++      .match_flags    =   USB_DEVICE_ID_MATCH_INT_INFO
++                        | USB_DEVICE_ID_MATCH_DEVICE,
++      .idVendor               = 0x04DD,
+       .idProduct              = 0x8007,       /* C-700 */
+       ZAURUS_MASTER_INTERFACE,
+       .driver_info            = 0,
+ }, {
+       .match_flags    =   USB_DEVICE_ID_MATCH_INT_INFO
++                        | USB_DEVICE_ID_MATCH_DEVICE,
++      .idVendor               = 0x04DD,
++      .idProduct              = 0x8007,   /* C-700 */
++      ZAURUS_FAKE_INTERFACE,
++      .driver_info        = 0,
++}, {
++      .match_flags    =   USB_DEVICE_ID_MATCH_INT_INFO
+                | USB_DEVICE_ID_MATCH_DEVICE,
+       .idVendor               = 0x04DD,
+       .idProduct              = 0x9031,       /* C-750 C-760 */
+--- a/drivers/net/usb/zaurus.c
++++ b/drivers/net/usb/zaurus.c
+@@ -301,11 +301,25 @@ static const struct usb_device_id        produc
+       .match_flags    =   USB_DEVICE_ID_MATCH_INT_INFO
+                         | USB_DEVICE_ID_MATCH_DEVICE,
+       .idVendor               = 0x04DD,
++      .idProduct              = 0x8005,       /* A-300 */
++      ZAURUS_FAKE_INTERFACE,
++      .driver_info = (unsigned long)&bogus_mdlm_info,
++}, {
++      .match_flags    =   USB_DEVICE_ID_MATCH_INT_INFO
++                        | USB_DEVICE_ID_MATCH_DEVICE,
++      .idVendor               = 0x04DD,
+       .idProduct              = 0x8006,       /* B-500/SL-5600 */
+       ZAURUS_MASTER_INTERFACE,
+       .driver_info = ZAURUS_PXA_INFO,
+ }, {
+       .match_flags    =   USB_DEVICE_ID_MATCH_INT_INFO
++                        | USB_DEVICE_ID_MATCH_DEVICE,
++      .idVendor               = 0x04DD,
++      .idProduct              = 0x8006,       /* B-500/SL-5600 */
++      ZAURUS_FAKE_INTERFACE,
++      .driver_info = (unsigned long)&bogus_mdlm_info,
++}, {
++      .match_flags    =   USB_DEVICE_ID_MATCH_INT_INFO
+                 | USB_DEVICE_ID_MATCH_DEVICE,
+       .idVendor               = 0x04DD,
+       .idProduct              = 0x8007,       /* C-700 */
+@@ -313,6 +327,13 @@ static const struct usb_device_id produc
+       .driver_info = ZAURUS_PXA_INFO,
+ }, {
+       .match_flags    =   USB_DEVICE_ID_MATCH_INT_INFO
++                        | USB_DEVICE_ID_MATCH_DEVICE,
++      .idVendor               = 0x04DD,
++      .idProduct              = 0x8007,       /* C-700 */
++      ZAURUS_FAKE_INTERFACE,
++      .driver_info = (unsigned long)&bogus_mdlm_info,
++}, {
++      .match_flags    =   USB_DEVICE_ID_MATCH_INT_INFO
+                | USB_DEVICE_ID_MATCH_DEVICE,
+       .idVendor               = 0x04DD,
+       .idProduct              = 0x9031,       /* C-750 C-760 */