[rrd-developers] teting mmap/mtime updates

Tobias Oetiker tobi at oetiker.ch
Fri Dec 5 16:04:15 CET 2008

Hi Bernhard,

Today Bernhard Reutner-Fischer wrote:

> It would only complain on broken kernels which are way outdated by now.
> Not sure whom you were asking all this, but see below.

it works in recent linux kernel but the problem was only fixed
sometime in 2007 I think ... you would not beleive what people are
running rrdtool on ...

Also I have reports that OSX does NOT work, even today.

so I thought it would make sense todo something about it as backup
systems fail to backup rrdfiles which seem to be un-changed.

> >        res = msync(addr, 4, MS_ASYNC);
> >        }
> /* The ASYNC means that we schedule the msync and return immediately.
>    Since we want to see if the modification time is updated upon
>    msync(), we have to make sure that our asynchronous request
>    completes before we stat below. In a real application, the
>    request would be completed at a random time in the future
>    but for this test we do not want to wait an arbitrary amount of
>    time, so force a commit now.  */
> sync();
> >        stat(temp, &stbuf);

Shouln't the representation in the filesystem be updated
imediately, only the on-disk image would follow later ...

but lets be 'friendly' and sync.

what I am doing now, is to add a utime call right after open for
all rw mmap access.


Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch tobi at oetiker.ch ++41 62 775 9902 / sb: -9900

More information about the rrd-developers mailing list