Re: Read/Write call interaction w/ UBC
Re: Read/Write call interaction w/ UBC
- Subject: Re: Read/Write call interaction w/ UBC
- From: Michael Smith <email@hidden>
- Date: Sat, 12 Jul 2008 11:48:46 -0700
On Jul 11, 2008, at 3:56 PM, shailesh jain wrote:
1) If the user mmap's a file and makes some changes to it and then
calls
read() system call (without msync'ing), is it the responsibility of
a filesystem
to flush the changes that could have been made by mmap system call
before
actually reading the file ?
No. The Darwin VM and buffer cache are fully coherent. The read(2)
call may race with another thread that is currently updating the
mapped region, however.
2) Also, while referring to source for smbfs, I came across a
comment that said " we shall maintain synchronization between mmap
and read/write by using UPL". Isn't just flushing mmaped pages
enough ?
It's not clear what you mean by "flushing mmaped pages".
The smbfs code uses the UPL as its co-ordination with the VM; by
passing file I/O through the buffer writes update the VM.
= Mike
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden