linux-mips
[Top] [All Lists]

Re: flush_kernel_dcache_page() not needed ?

To: vagabon.xyz@gmail.com
Subject: Re: flush_kernel_dcache_page() not needed ?
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Thu, 06 Sep 2007 00:33:20 +0900 (JST)
Cc: linux-mips@linux-mips.org
In-reply-to: <46DD53BE.2070004@gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <46DC29F0.3060200@gmail.com> <20070904.005400.52128244.anemo@mba.ocn.ne.jp> <46DD53BE.2070004@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
On Tue, 04 Sep 2007 14:46:54 +0200, Franck Bui-Huu <vagabon.xyz@gmail.com> 
wrote:
> One thing you might want to try is:
> 
>       $ echo 0 > /proc/sys/kernel/randomize_va_space
> 
> and see if your system still works fine. This command should avoid a
> data cache flush when moving the stack around. See shift_arg_pages().
> 
> With this, maybe you could give this testcase a try:
> 
>       $ /bin/echo "`seq 10000`" > seq.txt
> 
> and see if seq.txt is correct. This command should pass to echo (not
> the bash builtin one) a long argument that should fill your
> dcache.

I tried this and everything worked fine with/without the
flush_kernel_dcache_page() ;)

> That said the execve syscall code is quite 'hairy' and it may not be
> suprising that after this syscall the dcache has been completly
> flushed and thus make the problem disappear.

Yes, there is an yet another path to "flush all dcache".

do_execve()
  copy_strings()
    flush_kernel_dcache_page()
  search_binary_handler()
    load_elf_binary()
      flush_old_exec()
        exec_mmap()
          mmput()
            exit_mmap()
              flush_cache_mm()
                r4k_blast_dcache()

Anyway, the implementation of flush_kernel_dcache_page() is very
simple so that we can believe it works correctly without any testcase.
Too optimistic? :)

---
Atsushi Nemoto

<Prev in Thread] Current Thread [Next in Thread>