[lkml]   [2001]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] swapin flush cache bug
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 ]

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

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.
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 13:14    [W:0.099 / U:0.932 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site