]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 31 May 2021 06:56:05 +0000 (08:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 31 May 2021 06:56:05 +0000 (08:56 +0200)
added patches:
hugetlbfs-hugetlb_fault_mutex_hash-cleanup.patch

queue-4.4/hugetlbfs-hugetlb_fault_mutex_hash-cleanup.patch [new file with mode: 0644]
queue-4.4/mips-ralink-export-rt_sysc_membase-for-rt2880_wdt.c.patch
queue-4.4/series

diff --git a/queue-4.4/hugetlbfs-hugetlb_fault_mutex_hash-cleanup.patch b/queue-4.4/hugetlbfs-hugetlb_fault_mutex_hash-cleanup.patch
new file mode 100644 (file)
index 0000000..11cd855
--- /dev/null
@@ -0,0 +1,106 @@
+From 552546366a30d88bd1d6f5efe848b2ab50fd57e5 Mon Sep 17 00:00:00 2001
+From: Mike Kravetz <mike.kravetz@oracle.com>
+Date: Sat, 30 Nov 2019 17:56:30 -0800
+Subject: hugetlbfs: hugetlb_fault_mutex_hash() cleanup
+
+From: Mike Kravetz <mike.kravetz@oracle.com>
+
+commit 552546366a30d88bd1d6f5efe848b2ab50fd57e5 upstream.
+
+A new clang diagnostic (-Wsizeof-array-div) warns about the calculation
+to determine the number of u32's in an array of unsigned longs.
+Suppress warning by adding parentheses.
+
+While looking at the above issue, noticed that the 'address' parameter
+to hugetlb_fault_mutex_hash is no longer used.  So, remove it from the
+definition and all callers.
+
+No functional change.
+
+Link: http://lkml.kernel.org/r/20190919011847.18400-1-mike.kravetz@oracle.com
+Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
+Reported-by: Nathan Chancellor <natechancellor@gmail.com>
+Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
+Reviewed-by: Davidlohr Bueso <dbueso@suse.de>
+Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
+Cc: Nick Desaulniers <ndesaulniers@google.com>
+Cc: Ilie Halip <ilie.halip@gmail.com>
+Cc: David Bolvansky <david.bolvansky@gmail.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/hugetlbfs/inode.c    |    4 ++--
+ include/linux/hugetlb.h |    2 +-
+ mm/hugetlb.c            |    8 ++++----
+ 3 files changed, 7 insertions(+), 7 deletions(-)
+
+--- a/fs/hugetlbfs/inode.c
++++ b/fs/hugetlbfs/inode.c
+@@ -414,7 +414,7 @@ static void remove_inode_hugepages(struc
+                       if (next >= end)
+                               break;
+-                      hash = hugetlb_fault_mutex_hash(h, mapping, next, 0);
++                      hash = hugetlb_fault_mutex_hash(h, mapping, next);
+                       mutex_lock(&hugetlb_fault_mutex_table[hash]);
+                       lock_page(page);
+@@ -630,7 +630,7 @@ static long hugetlbfs_fallocate(struct f
+               addr = index * hpage_size;
+               /* mutex taken here, fault path and hole punch */
+-              hash = hugetlb_fault_mutex_hash(h, mapping, index, addr);
++              hash = hugetlb_fault_mutex_hash(h, mapping, index);
+               mutex_lock(&hugetlb_fault_mutex_table[hash]);
+               /* See if already present in mapping to avoid alloc/free */
+--- a/include/linux/hugetlb.h
++++ b/include/linux/hugetlb.h
+@@ -92,7 +92,7 @@ void free_huge_page(struct page *page);
+ void hugetlb_fix_reserve_counts(struct inode *inode, bool restore_reserve);
+ extern struct mutex *hugetlb_fault_mutex_table;
+ u32 hugetlb_fault_mutex_hash(struct hstate *h, struct address_space *mapping,
+-                              pgoff_t idx, unsigned long address);
++                              pgoff_t idx);
+ #ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE
+ pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud);
+--- a/mm/hugetlb.c
++++ b/mm/hugetlb.c
+@@ -3771,7 +3771,7 @@ backout_unlocked:
+ #ifdef CONFIG_SMP
+ u32 hugetlb_fault_mutex_hash(struct hstate *h, struct address_space *mapping,
+-                          pgoff_t idx, unsigned long address)
++                          pgoff_t idx)
+ {
+       unsigned long key[2];
+       u32 hash;
+@@ -3779,7 +3779,7 @@ u32 hugetlb_fault_mutex_hash(struct hsta
+       key[0] = (unsigned long) mapping;
+       key[1] = idx;
+-      hash = jhash2((u32 *)&key, sizeof(key)/sizeof(u32), 0);
++      hash = jhash2((u32 *)&key, sizeof(key)/(sizeof(u32)), 0);
+       return hash & (num_fault_mutexes - 1);
+ }
+@@ -3789,7 +3789,7 @@ u32 hugetlb_fault_mutex_hash(struct hsta
+  * return 0 and avoid the hashing overhead.
+  */
+ u32 hugetlb_fault_mutex_hash(struct hstate *h, struct address_space *mapping,
+-                          pgoff_t idx, unsigned long address)
++                          pgoff_t idx)
+ {
+       return 0;
+ }
+@@ -3834,7 +3834,7 @@ int hugetlb_fault(struct mm_struct *mm,
+        * get spurious allocation failures if two CPUs race to instantiate
+        * the same page in the page cache.
+        */
+-      hash = hugetlb_fault_mutex_hash(h, mapping, idx, address);
++      hash = hugetlb_fault_mutex_hash(h, mapping, idx);
+       mutex_lock(&hugetlb_fault_mutex_table[hash]);
+       entry = huge_ptep_get(ptep);
index 9f5be5aa17422160c7d56e8b86ebf4ecc3de2ba8..5539e3a9a351238af7b918926132f3e1838407a2 100644 (file)
@@ -25,11 +25,9 @@ Acked-by: Guenter Roeck <linux@roeck-us.net>
 Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
 ---
- arch/mips/ralink/of.c | 2 ++
+ arch/mips/ralink/of.c |    2 ++
  1 file changed, 2 insertions(+)
 
-diff --git a/arch/mips/ralink/of.c b/arch/mips/ralink/of.c
-index f9eda5d8f82c..df2e7e3b2a5a 100644
 --- a/arch/mips/ralink/of.c
 +++ b/arch/mips/ralink/of.c
 @@ -10,6 +10,7 @@
@@ -48,6 +46,3 @@ index f9eda5d8f82c..df2e7e3b2a5a 100644
  
  __iomem void *plat_of_remap_node(const char *node)
  {
--- 
-2.30.2
-
index 96360900e4c8dbf1ca8fe685f2101ba6751cd569..1cfd7f5792f3cf2d7d0c444ef2dbf2e09bcbd6a8 100644 (file)
@@ -51,3 +51,4 @@ scsi-libsas-use-_safe-loop-in-sas_resume_port.patch
 sch_dsmark-fix-a-null-deref-in-qdisc_reset.patch
 mips-alchemy-xxs1500-add-gpio-au1000.h-header-file.patch
 mips-ralink-export-rt_sysc_membase-for-rt2880_wdt.c.patch
+hugetlbfs-hugetlb_fault_mutex_hash-cleanup.patch