Re: [PATCH] swapin flush cache bug

NIIBE Yutaka (gniibe@m17n.org)
Wed, 14 Feb 2001 11:08:07 +0900 (JST)


Alan Cox wrote:
> Ok we need to handle that case a bit more intelligently so those flushes dont
> get into other ports code paths.

Possibly at fs/buffer.c:end_buffer_io_async?

We need to flush the cache when I/O was READ or READA. Is there any
way for end_buffer_io_async to distinguish which I/O (READ or WRITE)
has been done?

--------------------------------------
Problem with write-back cache.

(1) Page got swapped out

Swap out
[ Disk ] <---- P [ Page ]

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

Swap in
[ Disk ] ----> P [ Page ]
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

[ Disk ] P [ Page ] <----- U
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.

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