["Stephen C. Tweedie" <sct@redhat.com>] Re: O_DSYNC flag for open

Started by Doug McNaughtalmost 25 years ago7 messages
#1Doug McNaught
doug@wireboard.com

Just a quick delurk to pass along this tidbit from linux-kernel on
Linux *sync() behavior, since we've been talking about it a lot...

-Doug

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Doug McNaught (#1)
Re: ["Stephen C. Tweedie" <sct@redhat.com>] Re: O_DSYNC flag for open

Doug McNaught <doug@wireboard.com> forwards:

2.4's O_SYNC actually does a fdatasync internally. This is also the
default behaviour of HPUX, which requires you to set a sysctl variable
if you want O_SYNC to flush timestamp changes to disk.

Well, that guy might know all about Linux, but he doesn't know anything
about HPUX (at least not any version I've ever run). O_SYNC is
distinctly different from O_DSYNC around here.

regards, tom lane

#3Doug McNaught
doug@wireboard.com
In reply to: Doug McNaught (#1)
Re: ["Stephen C. Tweedie" <sct@redhat.com>] Re: O_DSYNC flag for open

Tom Lane <tgl@sss.pgh.pa.us> writes:

Doug McNaught <doug@wireboard.com> forwards:

2.4's O_SYNC actually does a fdatasync internally. This is also the
default behaviour of HPUX, which requires you to set a sysctl variable
if you want O_SYNC to flush timestamp changes to disk.

Well, that guy might know all about Linux, but he doesn't know anything
about HPUX (at least not any version I've ever run). O_SYNC is
distinctly different from O_DSYNC around here.

Y'know, I figured that might be the case. ;) He's a well-respected
Linux filesystem hacker, so I trust him on the Linux stuff.

So are we still thinking about preallocating log files as a
performance hack? It does seem that using preallocated files along
with O_DATASYNC will eliminate pretty much all metadata writes under
Linux in future...

[NOT suggesting we try to add anything to 7.1, I'm eagerly awaiting RC1]

-Doug

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Doug McNaught (#3)
Re: ["Stephen C. Tweedie" <sct@redhat.com>] Re: O_DSYNC flag for open

Doug McNaught <doug@wireboard.com> writes:

So are we still thinking about preallocating log files as a
performance hack?

We're not just thinking about it, we're doing it in current sources ...

regards, tom lane

#5Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Doug McNaught (#3)
Re: ["Stephen C. Tweedie" <sct@redhat.com>] Re: O_DSYNC flag for open

So are we still thinking about preallocating log files as a
performance hack? It does seem that using preallocated files along
with O_DATASYNC will eliminate pretty much all metadata writes under
Linux in future...

[NOT suggesting we try to add anything to 7.1, I'm eagerly awaiting RC1]

I am pretty sure that is done.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#6Giles Lean
giles@nemeton.com.au
In reply to: Tom Lane (#2)
Re: ["Stephen C. Tweedie" <sct@redhat.com>] Re: O_DSYNC flag for open

[ Drifting off topic ... ]

Well, that guy might know all about Linux, but he doesn't know anything
about HPUX (at least not any version I've ever run). O_SYNC is
distinctly different from O_DSYNC around here.

There is a HP_UX kernel flag 'o_sync_is_o_dsync' which will cause
O_DSYNC to be treated as O_SYNC. It defaults to being off -- it
is/was a backward compatibility "feature" since HP-UX 9.X (which is
history now) had implemented O_SYNC as O_DSYNC.

http://docs.hp.com/cgi-bin/otsearch/getfile?id=/hpux/onlinedocs/os/KCparam.OsyncIsOdsync.html

Regards,

Giles

#7Giles Lean
giles@nemeton.com.au
In reply to: Giles Lean (#6)
Re: ["Stephen C. Tweedie" <sct@redhat.com>] Re: O_DSYNC flag for open

There is a HP_UX kernel flag 'o_sync_is_o_dsync' which will cause
O_DSYNC to be treated as O_SYNC. It defaults to being off -- it

... other way around there, of course. Trying to clarify and
adding confusion instead. :-(

is/was a backward compatibility "feature" since HP-UX 9.X (which is
history now) had implemented O_SYNC as O_DSYNC.

Muttering,

Giles