why invalidate_buffers() in blkdev_put()?

From: Mikael Pettersson (mikpe@csd.uu.se)
Date: Sat Jan 15 2000 - 05:32:59 EST


In 2.3.39 a call to invalidate_buffers() was added to
fs/block_dev.c:blkdev_put().

Is it really necessary to forcibly throw away in-core cached
data just because the device was closed?

The device is synced, so the cache is simply reclaimed if/when
that memory is needed later on, and check_media_change() is there
to invalidate the cache if the media has changed the next time
the device is opened.

The effect is quite visible when a slow removable device,
say a floppy, is accessed multiple times. E.g.

# tar tvf /dev/fd0
        reads from media
# tar xvf /dev/fd0
        kernels < 2.3.39 read from in-core cache,
        2.3.39 reads from media _again_

/Mikael

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



This archive was generated by hypermail 2b29 : Sun Jan 23 2000 - 21:00:12 EST