mingisapsycho:~ chris$ ls -l /dev/*disk* brw-r----- 1 root operator 14, 0 Mar 6 21:44 /dev/disk0 brw-r----- 1 root operator 14, 1 Mar 6 21:44 /dev/disk0s1 brw-r----- 1 root operator 14, 4 Mar 6 21:44 /dev/disk0s2 brw-r----- 1 root operator 14, 2 Mar 6 21:44 /dev/disk0s3 brw-r----- 1 root operator 14, 3 Mar 6 21:44 /dev/disk0s4 crw-r----- 1 root operator 14, 0 Mar 6 21:44 /dev/rdisk0 crw-r----- 1 root operator 14, 1 Mar 6 21:44 /dev/rdisk0s1 crw-r----- 1 root operator 14, 4 Mar 6 21:44 /dev/rdisk0s2 crw-r----- 1 root operator 14, 2 Mar 6 21:44 /dev/rdisk0s3 crw-r----- 1 root operator 14, 3 Mar 6 21:44 /dev/rdisk0s4
OK so we have raw/character devices with XNU. So when I redo the test with: mingisapsycho:/ chris$ sudo dd if=/dev/rdisk0 of=/dev/null bs=256k count=3814 3814+0 records in 3814+0 records out 999817216 bytes transferred in 9.293714 secs (107579942 bytes/sec) That's essentially the same result as on Linux with the block level device. (Raw/character devices went away some time ago with Linux 2.6, and /dev/sda is definitely block level.) Still, it's mysterious why there is such a big difference between /dev/disk0 and /dev/rdisk0 on XNU...it doesn't seem they should be that different. There must be something else going on. Chris Murphy On Mar 6, 2011, at 9:02 PM, objectwerks inc wrote: > > On Mar 6, 2011, at 6:49 PM, Chris Murphy wrote: > >> Anyone have any idea why I'm getting a 6x difference in performance between >> two OS's on the exact same hardware? >> >> /dev/disk0 and /dev/sda are the exact same internal SATA drive. > > > Do you have the linux disk mounted async? My understanding is that linux > does that by default while most other OSes do not. Or something like that. > What file system is on the linux side? > > > >> >> >> Mac OS X 10.6.5: >> >> mingisapsycho:~ chris$ sudo dd if=/dev/disk0 of=/dev/zero bs=256k count=3814 >> Password: >> 3814+0 records in >> 3814+0 records out >> 999817216 bytes transferred in 56.340225 secs (17746064 bytes/sec) >> >> Fedora 14: >> >> [chris@macbook ~]$ sudo dd if=/dev/sda of=/dev/zero bs=256k count=3814 >> 3814+0 records in >> 3814+0 records out >> 999817216 bytes (1.0 GB) copied, 9.30449 s, 107 MB/s >> >> >> If I repeat the commands a second time without rebooting, I get: >> >> Mac OS: >> 999817216 bytes transferred in 55.951727 secs (17869282 bytes/sec) >> >> Fedora: >> 999817216 bytes (1.0 GB) copied, 0.312232 s, 3.2 GB/s >> >> So clearly Fedora is caching the entire 1GB into RAM and Mac OS X is not >> caching at all. But is there some DMA + tagged queuing that Linux could be >> doing that Mac OS X is not? Or is there something hosed with dd on Mac OS X? >> Anecdotally I get similar performance differences between local file >> duplication whether it's Finder vs Nautilus or cp vs cp. So I'm not >> understanding what could explain such a massive difference. I get similar >> numbers for write performance as well. >> >> Chris Murphy_______________________________________________ >> MacOSX-admin mailing list >> [email protected] >> http://www.omnigroup.com/mailman/listinfo/macosx-admin > > _______________________________________________ > MacOSX-admin mailing list > [email protected] > http://www.omnigroup.com/mailman/listinfo/macosx-admin _______________________________________________ MacOSX-admin mailing list [email protected] http://www.omnigroup.com/mailman/listinfo/macosx-admin
