[lkml]   [2001]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] swapin flush cache bug
Hello Stephen, 

Stephen C. Tweedie wrote:
> First, don't we want to do a flush_page_to_ram() *before* starting the
> swap IO?

Well, let me explain the issue. It is the thing we need to do
flushing *after* I/O.

Problem with virtually indexed physically tagged write-back cache.

(1) Page got swapped out

Swap out
[ Page ] ----> [ Disk ]

(2) Page got swapped in asynchronously, possibly by read-ahead

Swap in
[ Page ] <---- [ Disk ]

The I/O from disk goes through kernel virtual address K.
We have cache entries indexed by K.

(3) Page fault occurs at user space U

U ----> [ Page ] -----> [ Disk ]

The control goes to do_swap_page, found the page at

If K and U indexes differently, we have cache alias issues, we need
to flush the entries indexed by K and let them go to memory. Or else,
user space will see bogus data in Page.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:55    [W:0.100 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site