public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* MS_INVALIDATE broken, what alternative?
@ 2004-04-28  9:51 Michael Kerrisk
  0 siblings, 0 replies; only message in thread
From: Michael Kerrisk @ 2004-04-28  9:51 UTC (permalink / raw)
  Cc: Jamie Lokier

Gidday,

The msync() MS_INVALIDATE operation should produce behavior something like 
the following:

Invalidate cached copies of mapped data: the mapped region is synchronized 
with the contents of the file.  All pages of the mapped region that are 
inconsistent with the underlying file data are marked as invalid, and when 
next referenced, the contents of the page will be copied from the 
corresponding location in the file.  As a result, any changes that have 
been made directly to the file by another process using write() are made 
visible in the mapped region.

(To be precise, SUSv3 says:

    When MS_INVALIDATE is specified, msync( ) shall invalidate 
    all cached copies of mapped data that are inconsistent with 
    the permanent storage locations such that subsequent 
    references shall obtain data that was consistent with the 
    permanent storage locations sometime between the call to 
    msync( ) and the first subsequent memory reference to the data.
)

However as noted in a recent thread 
(http://marc.theaimsgroup.com/?l=linux-kernel&m=108083668427418&w=2), 
the current Linux implementation of this flag is broken: it provides 
behavior equivalent to flags==0.

Is there any way of achieving this functionality with current kernels?  
(Or might MS_INVALIDATE actually get correctly implemented?)

Thanks,

Michael
--
Michael Kerrisk
michael.kerrisk@gmx.net






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-04-28  9:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-28  9:51 MS_INVALIDATE broken, what alternative? Michael Kerrisk

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