All of lore.kernel.org
 help / color / mirror / Atom feed
* Writeback cache, SCSI, and ReiserFS
@ 2002-10-16  5:33 JP Howard
  2002-10-16  6:59 ` Valdis.Kletnieks
  2002-10-16 12:52 ` Chris Mason
  0 siblings, 2 replies; 3+ messages in thread
From: JP Howard @ 2002-10-16  5:33 UTC (permalink / raw)
  To: ReiserFS List; +Cc: Rob Mueller

Here's a little program to test fsync() performance--if you run it with
the parameter '1' it does 10000 write/fsync combinations, with the
parameter '0' it does 10000 writes, followed by a single fsync:
----
int main(int argc, char **argv) {
  int i, fd, mode;
  mode = atoi(argv[1]);
  fd = open("/some/path", O_CREAT | O_RDWR);
  for (i=0; i<10000; i++) {
    if (i%10 == 0)
      lseek(fd, 0, SEEK_SET);
    write(fd, buf, 8192);
    if (mode == 1) {
      fsync(fd);
    }
  }
  fsync(fd);
}
----

Now, according to our RAID controller (MegaRAID Series 475), we have
writeback cache turned on. Therefore, I would have thought that the above
program would run at the same speed regardless of using parameter '1' vs
'0', since fsync should return immediately when using a writeback cache.

But, it doesn't--it's about 30x slower when doing all the fsyncs.

Now, I don't know where to look. Is this a filesystem issue (I've tested
with both ReiserFS and Ext3 with the same results), a kernel issue, or a
hardware issue? We're very keen to get good fsync performance, because
Cyrus is full of them. (Yes, I know Reiser v4 will have proper
transactions, but I'm looking for a short-term solution to this
particular issue!)

Curiously, scsiinfo says that write cache is *not* turned on, despite
what the BIOS and "megamgr" (the controller's management software) says:
----
# scsiinfo -c /dev/sda

Data from Caching Page
----------------------
Write Cache                        0
Read Cache                         1
Prefetch units                     0
<...>
----

Has anyone dealt with this issue before? Are we correct that fsync()
should return immediately when using writeback cache? Any ideas on where
to look for a solution?

Apologies if this is not a ReiserFS issue--I don't really know where we
should be focussing our attention to resolve this.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-10-16 12:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-16  5:33 Writeback cache, SCSI, and ReiserFS JP Howard
2002-10-16  6:59 ` Valdis.Kletnieks
2002-10-16 12:52 ` Chris Mason

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.