lkml.org 
[lkml]   [2001]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] swapin flush cache bug
Date
Marcelo Tosatti writes:
> If lookup_swap_cache() finds a page in the swap cache, and that page was
> in memory because of the swapin readahead, the cache is not flushed.
>
> Here is a patch to fix the problem by always flushing the cache including
> for pages in the swap cache:

> -
> - flush_page_to_ram(page);
> - flush_icache_page(vma, page);
> }
>
> mm->rss++;
> +
> + flush_page_to_ram(page);
> + flush_icache_page(vma, page);

Surely if the page is in the swap cache, we don't need the
flush_page_to_ram() because the data is already written to the page. Yes,
there may be some reminents of it in the cache due to it being written
to disk via PIO.

Thinking about it some more - we have a process. It used to contain page
P at address V. We unmapped the page (and did the right thing with the
caches). Now, something wants to access address V, so we pull the page
from the swap cache, and place page P back at address V. We therefore
shouldn't need any cache manipulation at this point.

What was the problem? The old code seems to behave well on a virtual
address indexed virtual address tagged cache.

--
Russell King (rmk@arm.linux.org.uk) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:14    [W:0.070 / U:3.288 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site