Re: [PATCH] Cache alias issues for swapped page

From: Russell King (rmk@arm.linux.org.uk)
Date: Sat Sep 09 2000 - 03:40:31 EST


NIIBE Yutaka writes:
> (2) Flush is needed at try_to_swap
>
> When swap out, flushing is needed for physical tag too.
> diff -ruN linux-2.4.0-test8-pre6/mm/vmscan.c linux/mm/vmscan.c
> */
> + flush_page_to_ram(page);
> flush_cache_page(vma, address);

I'm concerned about this. It is my understanding that just before this
point, there shouldn't be any data in the cache for the kernels direct
mapped page (only the user space mapping), so why doesn't
flush_cache_page(vma, address) clean/invalidate the cache?

Also, I believe that the use of flush_page_to_ram() is wrong here, since
this seems to be intended to be used when the kernel has been writing to
its direct mapped version of the page, which is should not have been (if
it has, then the act of writing is a bug, not the apparantly missing call).

I'm also looking at the SH4 cache code in test8. flush_cache_page()
appears to invalidate out all cache entries whose physical tag
corresponds to "page". flush_page_to_ram() unsets the "updated" bit
on the physical tags. So, flush_cache_page() is a superset of
flush_page_to_ram() - I don't see the problem here.
   _____
  |_____| ------------------------------------------------- ---+---+-
  | | Russell King rmk@arm.linux.org.uk --- ---
  | | | | http://www.arm.linux.org.uk/personal/aboutme.html / / |
  | +-+-+ --- -+-
  / | THE developer of ARM Linux |+| /|\
 / | | | --- |
    +-+-+ ------------------------------------------------- /\\\ |
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Sep 15 2000 - 21:00:11 EST