public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* confused about block device behaviour
@ 2002-02-05 16:19 lord latex
  2002-02-05 19:25 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: lord latex @ 2002-02-05 16:19 UTC (permalink / raw)
  To: linux-kernel

hi

i've got written a block device driver for the 2.4.x 
kernel and it seems to work. but something looks 
strange to me. i've go a very simple application that 
does nothing more then open the block device, read 
1024 byte and close the device. when i run this app. 
serveral times my do_request function gets called 
every time. why? i expect this block beeing buffered 
in the buffer cache. what do i don't see, or what is 
possibly wrong with my block device?

thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: confused about block device behaviour
  2002-02-05 16:19 confused about block device behaviour lord latex
@ 2002-02-05 19:25 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2002-02-05 19:25 UTC (permalink / raw)
  To: llx; +Cc: linux-kernel

lord latex wrote:
> 
> hi
> 
> i've got written a block device driver for the 2.4.x
> kernel and it seems to work. but something looks
> strange to me. i've go a very simple application that
> does nothing more then open the block device, read
> 1024 byte and close the device. when i run this app.
> serveral times my do_request function gets called
> every time. why? i expect this block beeing buffered
> in the buffer cache. what do i don't see, or what is
> possibly wrong with my block device?
> 

The kernel invalidates the device's cache on the final close.
If you hold the device open in a different process:

	sleep 1000 < /dev/foo

while you run the test, you'll see that the underlying device's
contents are indeed cached.

-

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-02-05 19:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-05 16:19 confused about block device behaviour lord latex
2002-02-05 19:25 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox