lkml.org 
[lkml]   [2000]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectwhy invalidate_buffers() in blkdev_put()?
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/

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