Friday, November 01, 2013

SYNCHRONIZE_CACHE on close()

Recently while testing iSCSI I noticed that when you close a raw device, which is an iSCSI target, Solaris sends SCSI SYNCHRONIZE command on close().
$ dd if=/dev/zero of=/dev/rdsk/c0t6537643965643539d0s0 bs=1b count=1
1+0 records in
1+0 records out


$ dtrace -n fbt::*SYNCHRONIZE_CACHE:entry'{printf("%s %d\n", execname, pid);stack();}'
dtrace: description 'fbt::*SYNCHRONIZE_CACHE:entry' matched 1 probe

dd 2562

              sd`sdclose+0x1c0
              genunix`dev_close+0x55
              specfs`device_close+0xb3
              specfs`spec_close+0x171
              genunix`fop_close+0x9f
              genunix`closef+0x68
              genunix`closeandsetf+0x5be
              genunix`close+0x18
              unix`_sys_sysenter_post_swapgs+0x149

No comments: