[rrd-developers] [PATCH,RFC] optional mmap based file I/O

Tobias Oetiker tobi at oetiker.ch
Tue May 29 23:28:21 CEST 2007


Hi Bernhard,

> I'm attaching an update which does:
>
> - flag rrd_resize's old file with RRD_COPY
> - cleanup error-handling pathes in rrd_update and fix a few typos in
>   comments
> - rrd_close(): implement printing mincore results for the rrd if
>   DEBUG=2 was defined
> - rrd_open(): madvise start addresses need to be page-aligned; implement
>   alternative path to the fine-grained (i.e. exact) madvise by flagging
>   just the first two pages as needed (see TWO_PAGES). Implement
>   alternative path that records the last madvise()ed area to avoid
>   redundant calls to madvise() on identical areas (due to
>   page-alignment constraints) -- see CHECK_MADVISE_OVERLAPS. Implement
>   path for USE_DIRECT_IO.
> - configure: add check for O_DIRECT flag to open(2). Add option
>   --enable-direct-io. Add _GNU_SOURCE to CFLAGS to silence warnings
>   about chroot which is marked LEGACY since SUSv2 and is a non POSIX
>   extension. Make checks for posix_fadvise() dependant on
>   --disable-mmap, since we do not need fadvise for the mmap case.
>
> Please apply.

done ... a few questions/things ...

* what is the tought behind  (in rrd_last)

     close(rrd_file->fd);
     rrd_close(rrd_file);

  shoulnd rrd_close close as well ?

* why do you flag the first TWO pages ? rrd files with headers
  takeing up two pages should be pretty rare ...

* for figuring the pagesize you should use getpagesize is
  available.

* if mmap is not used, then it would be cool if posix fadvise was
  still called (have not checked the code, just saw that you
  removed the check from configure)

cheers
tobi

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



More information about the rrd-developers mailing list