qihua wu
2008-Dec-26 09:52 UTC
[dtrace-discuss] Anyway in DTRACE to know whether the IO from an app bypass the file system cache or not?
Hi, All, Do we have entry point to tell us whether the IO performed bypass FS cache or not? Somebody said using dd to copy file using raw disk format such as dd if=/dev/dsk/... will bypass the FS cache but using dd to copy a normal file will NOT bypass the FS cache, I''d like to verify this. I am wondering whether Dtrace could help on this case. Thanks, Daniel, -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20081226/54fe60b4/attachment.html>
James Litchfield
2008-Dec-26 20:51 UTC
[dtrace-discuss] Anyway in DTRACE to know whether the IO from an app bypass the file system cache or not?
Look at the io provider. It shows you when physical IOs are issued. /usr/demo/dtrace/ionsoop.d provides a very basic example fo how to use this. I tend to prefer this version for the very basic information: #! /usr/sbin/dtrace -Fs io:::start { @a[execname, pid, args[2]->fi_pathname != "<none>" ? args[2]->fi_pathname : args[1]->dev_pathname, args[0]->b_bcount] = count(); } With a command such as: dd if=/dev/dsk/c0d0s2 ibs=1048576 of=/dev/null obs=1048576 You''ll see among other things (eliminating spaces for clarity): dd 1591 /devices/pci at 0,0/pci-ide at 1f,2/ide at 0/cmdk at 0,0:c 57344 26351 26351 read of 67344 bytes. Hmm. maxphys is 1MB on this system, I''ll need to look further. You can gather elapsed times, track which are readcs vs writes and lots of other things. The key is the io provider to see the "physical" IOs performed. Jim Litchfield ========== qihua wu wrote:> Hi, All, > > Do we have entry point to tell us whether the IO performed bypass FS > cache or not? > Somebody said using dd to copy file using raw disk format such as dd > if=/dev/dsk/... will bypass the FS cache but using dd to copy a > normal file will NOT bypass the FS cache, I''d like to verify this. I > am wondering whether Dtrace could help on this case. > > Thanks, > Daniel, > ------------------------------------------------------------------------ > > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org >
max at bruningsystems.com
2008-Dec-26 22:01 UTC
[dtrace-discuss] Anyway in DTRACE to know whether the IO from an app bypass the file system cache or not?
Hi Daniel, qihua wu wrote:> Hi, All, > > Do we have entry point to tell us whether the IO performed bypass FS > cache or not? > Somebody said using dd to copy file using raw disk format such as dd > if=/dev/dsk/... will bypass the FS cache but using dd to copy a > normal file will NOT bypass the FS cache, I''d like to verify this. I > am wondering whether Dtrace could help on this case.If the I/O (specifically, read/write) is not going through a cache from/to the disk, the physio(9f) routine should be called. Take a look at the physio(9f) man page. So, # dtrace -n ''physio:entry{}'' should fire on read/write calls that bypass any caching. Try this with dd if=foo of=/dev/null count=10 where foo is the file. If physio() is not getting called, code above the disk driver is buffering the data (or someone has written a very different disk driver...). If you try dd with the raw device, you''ll see physio(9f) getting called. max