]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 Mar 2019 11:06:17 +0000 (12:06 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 Mar 2019 11:06:17 +0000 (12:06 +0100)
added patches:
bcache-use-req_meta-req_prio-to-indicate-bio-for-metadata.patch

queue-4.19/bcache-use-req_meta-req_prio-to-indicate-bio-for-metadata.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/bcache-use-req_meta-req_prio-to-indicate-bio-for-metadata.patch b/queue-4.19/bcache-use-req_meta-req_prio-to-indicate-bio-for-metadata.patch
new file mode 100644 (file)
index 0000000..340e090
--- /dev/null
@@ -0,0 +1,73 @@
+From dc7292a5bcb4c878b076fca2ac3fc22f81b8f8df Mon Sep 17 00:00:00 2001
+From: Coly Li <colyli@suse.de>
+Date: Sat, 9 Feb 2019 12:53:11 +0800
+Subject: bcache: use (REQ_META|REQ_PRIO) to indicate bio for metadata
+
+From: Coly Li <colyli@suse.de>
+
+commit dc7292a5bcb4c878b076fca2ac3fc22f81b8f8df upstream.
+
+In 'commit 752f66a75aba ("bcache: use REQ_PRIO to indicate bio for
+metadata")' REQ_META is replaced by REQ_PRIO to indicate metadata bio.
+This assumption is not always correct, e.g. XFS uses REQ_META to mark
+metadata bio other than REQ_PRIO. This is why Nix noticed that bcache
+does not cache metadata for XFS after the above commit.
+
+Thanks to Dave Chinner, he explains the difference between REQ_META and
+REQ_PRIO from view of file system developer. Here I quote part of his
+explanation from mailing list,
+   REQ_META is used for metadata. REQ_PRIO is used to communicate to
+   the lower layers that the submitter considers this IO to be more
+   important that non REQ_PRIO IO and so dispatch should be expedited.
+
+   IOWs, if the filesystem considers metadata IO to be more important
+   that user data IO, then it will use REQ_PRIO | REQ_META rather than
+   just REQ_META.
+
+Then it seems bios with REQ_META or REQ_PRIO should both be cached for
+performance optimation, because they are all probably low I/O latency
+demand by upper layer (e.g. file system).
+
+So in this patch, when we want to decide whether to bypass the cache,
+REQ_META and REQ_PRIO are both checked. Then both metadata and
+high priority I/O requests will be handled properly.
+
+Reported-by: Nix <nix@esperi.org.uk>
+Signed-off-by: Coly Li <colyli@suse.de>
+Reviewed-by: Andre Noll <maan@tuebingen.mpg.de>
+Tested-by: Nix <nix@esperi.org.uk>
+Cc: stable@vger.kernel.org
+Cc: Dave Chinner <david@fromorbit.com>
+Cc: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/md/bcache/request.c |    7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/drivers/md/bcache/request.c
++++ b/drivers/md/bcache/request.c
+@@ -392,10 +392,11 @@ static bool check_should_bypass(struct c
+       /*
+        * Flag for bypass if the IO is for read-ahead or background,
+-       * unless the read-ahead request is for metadata (eg, for gfs2).
++       * unless the read-ahead request is for metadata
++       * (eg, for gfs2 or xfs).
+        */
+       if (bio->bi_opf & (REQ_RAHEAD|REQ_BACKGROUND) &&
+-          !(bio->bi_opf & REQ_META))
++          !(bio->bi_opf & (REQ_META|REQ_PRIO)))
+               goto skip;
+       if (bio->bi_iter.bi_sector & (c->sb.block_size - 1) ||
+@@ -877,7 +878,7 @@ static int cached_dev_cache_miss(struct
+       }
+       if (!(bio->bi_opf & REQ_RAHEAD) &&
+-          !(bio->bi_opf & REQ_META) &&
++          !(bio->bi_opf & (REQ_META|REQ_PRIO)) &&
+           s->iop.c->gc_stats.in_use < CUTOFF_CACHE_READA)
+               reada = min_t(sector_t, dc->readahead >> 9,
+                             get_capacity(bio->bi_disk) - bio_end_sector(bio));
index 28bf26f39b434ca868c2870a755edcac7c4e5514..356811a3ad741dfd8f4f146c1a75920ebcb8dfb9 100644 (file)
@@ -269,7 +269,6 @@ media-imx-csi-stop-upstream-before-disabling-idma-channel.patch
 drm-fb-helper-generic-fix-drm_fbdev_client_restore.patch
 drm-radeon-evergreen_cs-fix-missing-break-in-switch-statement.patch
 drm-amd-powerplay-correct-power-reading-on-fiji.patch
-drm-amd-display-add-msse2-to-prevent-clang-from-emitting-libcalls-to-undefined-sw-fp-routines.patch
 drm-amd-display-don-t-call-dm_pp_-function-from-an-fpu-block.patch
 kvm-call-kvm_arch_memslots_updated-before-updating-memslots.patch
 kvm-x86-mmu-detect-mmio-generation-wrap-in-any-address-space.patch
@@ -277,3 +276,4 @@ kvm-x86-mmu-do-not-cache-mmio-accesses-while-memslots-are-in-flux.patch
 kvm-nvmx-sign-extend-displacements-of-vmx-instr-s-mem-operands.patch
 kvm-nvmx-apply-addr-size-mask-to-effective-address-for-vmx-instructions.patch
 kvm-nvmx-ignore-limit-checks-on-vmx-instructions-using-flat-segments.patch
+bcache-use-req_meta-req_prio-to-indicate-bio-for-metadata.patch