]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 May 2019 11:29:20 +0000 (13:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 May 2019 11:29:20 +0000 (13:29 +0200)
added patches:
ext4-fix-compile-error-when-using-buffer_trace.patch
iov_iter-optimize-page_copy_sane.patch

queue-4.14/ext4-fix-compile-error-when-using-buffer_trace.patch [new file with mode: 0644]
queue-4.14/iov_iter-optimize-page_copy_sane.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/ext4-fix-compile-error-when-using-buffer_trace.patch b/queue-4.14/ext4-fix-compile-error-when-using-buffer_trace.patch
new file mode 100644 (file)
index 0000000..f9953c8
--- /dev/null
@@ -0,0 +1,39 @@
+From ddccb6dbe780d68133191477571cb7c69e17bb8c Mon Sep 17 00:00:00 2001
+From: "zhangyi (F)" <yi.zhang@huawei.com>
+Date: Thu, 21 Feb 2019 11:29:10 -0500
+Subject: ext4: fix compile error when using BUFFER_TRACE
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: zhangyi (F) <yi.zhang@huawei.com>
+
+commit ddccb6dbe780d68133191477571cb7c69e17bb8c upstream.
+
+Fix compile error below when using BUFFER_TRACE.
+
+fs/ext4/inode.c: In function ‘ext4_expand_extra_isize’:
+fs/ext4/inode.c:5979:19: error: request for member ‘bh’ in something not a structure or union
+  BUFFER_TRACE(iloc.bh, "get_write_access");
+
+Fixes: c03b45b853f58 ("ext4, project: expand inode extra size if possible")
+Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Reviewed-by: Jan Kara <jack@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/ext4/inode.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/ext4/inode.c
++++ b/fs/ext4/inode.c
+@@ -5818,7 +5818,7 @@ int ext4_expand_extra_isize(struct inode
+       ext4_write_lock_xattr(inode, &no_expand);
+-      BUFFER_TRACE(iloc.bh, "get_write_access");
++      BUFFER_TRACE(iloc->bh, "get_write_access");
+       error = ext4_journal_get_write_access(handle, iloc->bh);
+       if (error) {
+               brelse(iloc->bh);
diff --git a/queue-4.14/iov_iter-optimize-page_copy_sane.patch b/queue-4.14/iov_iter-optimize-page_copy_sane.patch
new file mode 100644 (file)
index 0000000..6551ff5
--- /dev/null
@@ -0,0 +1,56 @@
+From 6daef95b8c914866a46247232a048447fff97279 Mon Sep 17 00:00:00 2001
+From: Eric Dumazet <edumazet@google.com>
+Date: Tue, 26 Feb 2019 10:42:39 -0800
+Subject: iov_iter: optimize page_copy_sane()
+
+From: Eric Dumazet <edumazet@google.com>
+
+commit 6daef95b8c914866a46247232a048447fff97279 upstream.
+
+Avoid cache line miss dereferencing struct page if we can.
+
+page_copy_sane() mostly deals with order-0 pages.
+
+Extra cache line miss is visible on TCP recvmsg() calls dealing
+with GRO packets (typically 45 page frags are attached to one skb).
+
+Bringing the 45 struct pages into cpu cache while copying the data
+is not free, since the freeing of the skb (and associated
+page frags put_page()) can happen after cache lines have been evicted.
+
+Signed-off-by: Eric Dumazet <edumazet@google.com>
+Cc: Al Viro <viro@zeniv.linux.org.uk>
+Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
+Cc: Matthew Wilcox <willy@infradead.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ lib/iov_iter.c |   17 +++++++++++++++--
+ 1 file changed, 15 insertions(+), 2 deletions(-)
+
+--- a/lib/iov_iter.c
++++ b/lib/iov_iter.c
+@@ -687,8 +687,21 @@ EXPORT_SYMBOL(_copy_from_iter_full_nocac
+ static inline bool page_copy_sane(struct page *page, size_t offset, size_t n)
+ {
+-      struct page *head = compound_head(page);
+-      size_t v = n + offset + page_address(page) - page_address(head);
++      struct page *head;
++      size_t v = n + offset;
++
++      /*
++       * The general case needs to access the page order in order
++       * to compute the page size.
++       * However, we mostly deal with order-0 pages and thus can
++       * avoid a possible cache line miss for requests that fit all
++       * page orders.
++       */
++      if (n <= v && v <= PAGE_SIZE)
++              return true;
++
++      head = compound_head(page);
++      v += (page - head) << PAGE_SHIFT;
+       if (likely(n <= v && v <= (PAGE_SIZE << compound_order(head))))
+               return true;
index 3bf25ffea48bca4427ca6ec911cb05880bf814f7..49a34c33f87f20c46e21f46b96faccc8c2008beb 100644 (file)
@@ -59,3 +59,5 @@ ext4-fix-data-corruption-caused-by-overlapping-unaligned-and-aligned-io.patch
 ext4-fix-use-after-free-in-dx_release.patch
 alsa-hda-realtek-fix-for-lenovo-b50-70-inverted-internal-microphone-bug.patch
 kvm-x86-skip-efer-vs.-guest-cpuid-checks-for-host-initiated-writes.patch
+iov_iter-optimize-page_copy_sane.patch
+ext4-fix-compile-error-when-using-buffer_trace.patch