Re: [PATCH] swapin flush cache bug

From: NIIBE Yutaka (gniibe@m17n.org)
Date: Wed Jun 27 2001 - 19:41:13 EST


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 ]
           K

   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 ]
                   K

   The control goes to do_swap_page, found the page at
   lookup_swap_cache.

   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 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/



This archive was generated by hypermail 2b29 : Sat Jun 30 2001 - 21:00:17 EST