linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 1/3] ARM: Use lazy cache flushing on ARMv7 SMP systems
Date: Thu, 13 May 2010 12:32:15 +0100	[thread overview]
Message-ID: <20100513113215.GA13001@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20100513111555.21178.63776.stgit@e102109-lin.cambridge.arm.com>

On Thu, May 13, 2010 at 12:15:55PM +0100, Catalin Marinas wrote:
> diff --git a/arch/arm/mm/fault-armv.c b/arch/arm/mm/fault-armv.c
> index 0d414c2..a415dc0 100644
> --- a/arch/arm/mm/fault-armv.c
> +++ b/arch/arm/mm/fault-armv.c
> @@ -170,10 +170,8 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr,
>  		return;
>  
>  	mapping = page_mapping(page);
> -#ifndef CONFIG_SMP
>  	if (test_and_clear_bit(PG_dcache_dirty, &page->flags))
>  		__flush_dcache_page(mapping, page);
> -#endif
>  	if (mapping) {
>  		if (cache_is_vivt())
>  			make_coherent(mapping, vma, addr, ptep, pfn);
> diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c
> index c6844cb..5ad8711 100644
> --- a/arch/arm/mm/flush.c
> +++ b/arch/arm/mm/flush.c
> @@ -17,6 +17,7 @@
>  #include <asm/smp_plat.h>
>  #include <asm/system.h>
>  #include <asm/tlbflush.h>
> +#include <asm/smp_plat.h>
>  
>  #include "mm.h"
>  
> @@ -93,12 +94,10 @@ void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsig
>  #define flush_pfn_alias(pfn,vaddr)	do { } while (0)
>  #endif
>  
> -#ifdef CONFIG_SMP
>  static void flush_ptrace_access_other(void *args)
>  {
>  	__flush_icache_all();
>  }
> -#endif
>  
>  static
>  void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
> @@ -122,11 +121,9 @@ void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
>  	if (vma->vm_flags & VM_EXEC) {
>  		unsigned long addr = (unsigned long)kaddr;
>  		__cpuc_coherent_kern_range(addr, addr + len);
> -#ifdef CONFIG_SMP
>  		if (cache_ops_need_broadcast())
>  			smp_call_function(flush_ptrace_access_other,
>  					  NULL, 1);
> -#endif

Err.  __cpuc_coherent_kern_range() makes the cache lines coherent between
the data and instruction threads.  So what you're doing is:

1. flush the D and I caches for the affected cache lines on the local
   processor
2. flush the entire I cache on the local processor

Why?

This has absolutely nothing to do with the rest of the patch.

  reply	other threads:[~2010-05-13 11:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-13 11:15 [RFC PATCH 0/3] ARM: flush_dcache_page/update_mmu_cache reimplementation Catalin Marinas
2010-05-13 11:15 ` [RFC PATCH 1/3] ARM: Use lazy cache flushing on ARMv7 SMP systems Catalin Marinas
2010-05-13 11:32   ` Russell King - ARM Linux [this message]
2010-05-13 11:42     ` [RFC PATCH 1/3] ARM: Use lazy cache flushing on ARMv7 SMPsystems Catalin Marinas
2010-05-13 11:16 ` [RFC PATCH 2/3] ARM: Assume new page cache pages have dirty D-cache Catalin Marinas
2010-05-13 11:16 ` [RFC PATCH 3/3] ARM: Defer the L_PTE_EXEC flag setting to update_mmu_cache() on SMP Catalin Marinas
2010-05-13 11:22 ` [RFC PATCH] ARM: Allow lazy cache flushing on ARM11MPCore Catalin Marinas
2010-05-13 11:44   ` Catalin Marinas

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=20100513113215.GA13001@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.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).