linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, John David Anglin <dave.anglin@bell.net>,
	Helge Deller <deller@gmx.de>
Subject: [PATCH 4.10 04/27] parisc: Optimize flush_kernel_vmap_range and invalidate_kernel_vmap_range
Date: Fri, 24 Mar 2017 18:58:22 +0100	[thread overview]
Message-ID: <20170324151226.291350699@linuxfoundation.org> (raw)
In-Reply-To: <20170324151225.973768798@linuxfoundation.org>

4.10-stable review patch.  If anyone has any objections, please let me know.

------------------

From: John David Anglin <dave.anglin@bell.net>

commit 316ec0624f951166daedbe446988ef92ae72b59f upstream.

The previously submitted patch did not resolve the random segmentation
faults observed on the phantom buildd system.  There are still
unresolved problems with the Debian 4.8 and 4.9 kernels on C8000.

The attached patch removes the flush of the offset map pages and does a
whole data cache flush for large ranges.  No other arch flushes the
offset map in these routines as far as I can tell.

I have not observed any random segmentation faults on rp3440 in two
weeks of testing with 4.10.0 and 4.10.1.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/parisc/include/asm/cacheflush.h |   23 ++---------------------
 arch/parisc/kernel/cache.c           |   22 ++++++++++++++++++++++
 2 files changed, 24 insertions(+), 21 deletions(-)

--- a/arch/parisc/include/asm/cacheflush.h
+++ b/arch/parisc/include/asm/cacheflush.h
@@ -45,28 +45,9 @@ static inline void flush_kernel_dcache_p
 
 #define flush_kernel_dcache_range(start,size) \
 	flush_kernel_dcache_range_asm((start), (start)+(size));
-/* vmap range flushes and invalidates.  Architecturally, we don't need
- * the invalidate, because the CPU should refuse to speculate once an
- * area has been flushed, so invalidate is left empty */
-static inline void flush_kernel_vmap_range(void *vaddr, int size)
-{
-	unsigned long start = (unsigned long)vaddr;
 
-	flush_kernel_dcache_range_asm(start, start + size);
-}
-static inline void invalidate_kernel_vmap_range(void *vaddr, int size)
-{
-	unsigned long start = (unsigned long)vaddr;
-	void *cursor = vaddr;
-
-	for ( ; cursor < vaddr + size; cursor += PAGE_SIZE) {
-		struct page *page = vmalloc_to_page(cursor);
-
-		if (test_and_clear_bit(PG_dcache_dirty, &page->flags))
-			flush_kernel_dcache_page(page);
-	}
-	flush_kernel_dcache_range_asm(start, start + size);
-}
+void flush_kernel_vmap_range(void *vaddr, int size);
+void invalidate_kernel_vmap_range(void *vaddr, int size);
 
 #define flush_cache_vmap(start, end)		flush_cache_all()
 #define flush_cache_vunmap(start, end)		flush_cache_all()
--- a/arch/parisc/kernel/cache.c
+++ b/arch/parisc/kernel/cache.c
@@ -633,3 +633,25 @@ flush_cache_page(struct vm_area_struct *
 		__flush_cache_page(vma, vmaddr, PFN_PHYS(pfn));
 	}
 }
+
+void flush_kernel_vmap_range(void *vaddr, int size)
+{
+	unsigned long start = (unsigned long)vaddr;
+
+	if ((unsigned long)size > parisc_cache_flush_threshold)
+		flush_data_cache();
+	else
+		flush_kernel_dcache_range_asm(start, start + size);
+}
+EXPORT_SYMBOL(flush_kernel_vmap_range);
+
+void invalidate_kernel_vmap_range(void *vaddr, int size)
+{
+	unsigned long start = (unsigned long)vaddr;
+
+	if ((unsigned long)size > parisc_cache_flush_threshold)
+		flush_data_cache();
+	else
+		flush_kernel_dcache_range_asm(start, start + size);
+}
+EXPORT_SYMBOL(invalidate_kernel_vmap_range);

  parent reply	other threads:[~2017-03-24 18:00 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-24 17:58 [PATCH 4.10 00/27] 4.10.6-stable review Greg Kroah-Hartman
2017-03-24 17:58 ` [PATCH 4.10 01/27] give up on gcc ilog2() constant optimizations Greg Kroah-Hartman
2017-03-24 17:58 ` [PATCH 4.10 02/27] qla2xxx: Fix memory leak for abts processing Greg Kroah-Hartman
2017-03-24 17:58 ` [PATCH 4.10 03/27] qla2xxx: Fix request queue corruption Greg Kroah-Hartman
2017-03-24 17:58 ` Greg Kroah-Hartman [this message]
2017-03-24 17:58 ` [PATCH 4.10 05/27] parisc: support R_PARISC_SECREL32 relocation in modules Greg Kroah-Hartman
2017-03-24 17:58 ` [PATCH 4.10 06/27] parisc: Fix system shutdown halt Greg Kroah-Hartman
2017-03-24 17:58 ` [PATCH 4.10 07/27] perf/core: Fix use-after-free in perf_release() Greg Kroah-Hartman
2017-03-24 17:58 ` [PATCH 4.10 08/27] perf/core: Fix event inheritance on fork() Greg Kroah-Hartman
2017-03-24 17:58 ` [PATCH 4.10 09/27] md/r5cache: fix set_syndrome_sources() for data in cache Greg Kroah-Hartman
2017-03-24 17:58 ` [PATCH 4.10 10/27] xprtrdma: Squelch kbuild sparse complaint Greg Kroah-Hartman
2017-03-24 17:58 ` [PATCH 4.10 11/27] NFS prevent double free in async nfs4_exchange_id Greg Kroah-Hartman
2017-03-24 17:58 ` [PATCH 4.10 12/27] cpufreq: Fix and clean up show_cpuinfo_cur_freq() Greg Kroah-Hartman
2017-03-24 17:58 ` [PATCH 4.10 13/27] powerpc/boot: Fix zImage TOC alignment Greg Kroah-Hartman
2017-03-24 17:58 ` [PATCH 4.10 14/27] hwrng: omap - write registers after enabling the clock Greg Kroah-Hartman
2017-03-24 17:58 ` [PATCH 4.10 15/27] hwrng: omap - use devm_clk_get() instead of of_clk_get() Greg Kroah-Hartman
2017-03-24 17:58 ` [PATCH 4.10 16/27] hwrng: omap - Do not access INTMASK_REG on EIP76 Greg Kroah-Hartman
2017-03-24 17:58 ` [PATCH 4.10 17/27] md/raid1/10: fix potential deadlock Greg Kroah-Hartman
2017-03-24 17:58 ` [PATCH 4.10 18/27] target/pscsi: Fix TYPE_TAPE + TYPE_MEDIMUM_CHANGER export Greg Kroah-Hartman
2017-03-24 17:58 ` [PATCH 4.10 19/27] scsi: lpfc: Add shutdown method for kexec Greg Kroah-Hartman
2017-03-24 17:58 ` [PATCH 4.10 20/27] scsi: libiscsi: add lock around task lists to fix list corruption regression Greg Kroah-Hartman
2017-03-24 17:58 ` [PATCH 4.10 21/27] scsi: mpt3sas: Avoid sleeping in interrupt context Greg Kroah-Hartman
2017-03-24 17:58 ` [PATCH 4.10 22/27] target: Fix VERIFY_16 handling in sbc_parse_cdb Greg Kroah-Hartman
2017-03-24 17:58 ` [PATCH 4.10 23/27] isdn/gigaset: fix NULL-deref at probe Greg Kroah-Hartman
2017-03-24 17:58 ` [PATCH 4.10 24/27] gfs2: Avoid alignment hole in struct lm_lockname Greg Kroah-Hartman
2017-03-24 17:58 ` [PATCH 4.10 25/27] percpu: acquire pcpu_lock when updating pcpu_nr_empty_pop_pages Greg Kroah-Hartman
2017-03-24 17:58 ` [PATCH 4.10 26/27] cgroup/pids: remove spurious suspicious RCU usage warning Greg Kroah-Hartman
2017-03-25  0:00 ` [PATCH 4.10 00/27] 4.10.6-stable review Shuah Khan
2017-03-26  8:19   ` Greg Kroah-Hartman
2017-03-25  4:18 ` Guenter Roeck
2017-03-26  8:51   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170324151226.291350699@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=dave.anglin@bell.net \
    --cc=deller@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).