Memory mapping and msync()

From: Lars Bro <lbr_at_dksin.dk>
Date: Tue, 01 Sep 1998 15:17:06 +0200

Hi,

This question is about how memory works on DU.

If I open a file and do I/O, pages of data will be located in the UBC.
Anyone else opening that same file and doing I/O will naturally see the
exactly same pages in the UBC and see the same changes as I see.

If another user then memory maps this file, will these same pages be
part of his adress space ?

Below is what I have seen in man msync(2)

 After a successful call to the msync() function with the flags
parameter
  set to MS_SYNC, all previous modifications to the mapped region are
visible
  to processes using the read() function. Previous modifications to the
file
  using the write() function might be lost.

  After a successful call to the msync() function with the flags
parameter
  set to MS_INVALIDATE, all previous modifications to the file using the
  write() function are visible to the mapped region. Previous direct
modifi-
  cations to the mapped region might be lost.

This sounds to me as if DU implements two different ways to access data
or that the SAME DATA is put TWO PLACES. I believed that "unified" of
UBC ment that file system I/O were equal to mapped I/O and I also
believed that the mach kernel was only memory mapped and even
read()/write() I/O was eventually memory mapped as going through the
mach kernel.

Well ?

-- 
   Lars Bro                                        lbr_at_dksin.dk 
   ABB Daimler-Benz Transportation Signal A/S      +45 36 39 01 77
Received on Wed Sep 09 1998 - 08:38:07 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:38 NZDT