Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
Fatherhood.Org

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Glossary
MoreInfo
Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
FAQ
Copyright Info
Terms of Use
Privacy Info
Disclaimer
WorkBoard
Thanks
Donations
Advertising
Masthead / Impressum
Your Account

Communication
Feedback
Forums
Private Messages
Surveys

Features
HOWTOs
News Archive
Submit News
Topics
User Articles
Web Links

Google
Google


The Web
linux-tutorial.info

Who's Online
There are currently, 64 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here

  

sg_rbuf



SYNOPSIS

       sg_rbuf   [[-q]   |   [-d]   |  [-m]]  [-t]  [-s=<num_MB>]
       [-b=<num_KB>] <sg_device>


DESCRIPTION

       This command reads data with the SCSI READ BUFFER  command
       via the sg driver and then discards it. Typically the data
       being read is from a disk's memory cache.  It  is  assumed
       that  the  data  is  sourced quickly (although this is not
       guaranteed  by  the  SCSI  standards).  This  command   is
       designed for timing transfer speeds across a SCSI bus.

       -q     only  transfer  the data into kernel buffers (typi­
              cally by DMA from the SCSI adapter card) and do not
              move it into the user space.

       -d     use  direct  IO  if  available. In this case the sg
              driver will attempt to configure the DMA  from  the
              SCSI adapter to transfer directly into user memory.
              This will eliminate the copy  via  kernel  buffers.
              If  not  available  then  this will be reported and
              indirect IO will be done instead.

       -m     use memory mapped IO if available. In this case the
              sg  driver  will  attempt to configure the DMA from
              the SCSI adapter to  transfer  directly  into  user
              memory.  This  will  eliminate  the copy via kernel
              buffers.

       -t     times the bulk data transfer component of this com­
              mand. The elapsed time is printed out plus a MB/sec
              calculation. In this case "MB" is 1,000,000  bytes.
              The  gettimeofday()  system call is used internally
              for the time calculation.

       -s=<num_MB>
              size of total transfer (in  Megabytes  ==  1024^2).
              The  default is 200 MB, the maximum is 4095 MB. The
              actual number of bytes transferred may be  slightly
              less  since all transfers are the same size (and an
              integer  division  is  involved  rounding   towards
              zero).

       -b=<num_KB>
              size  of  each transfer (in Kilobytes == 1024). The
              default  is  the  actual  available   buffer   size
              returned by the READ BUFFER command. The maximum is
              the same as the default, hence  this  argument  can
              only be used to reduce the size of each transfer to
              less than  the  device's  actual  available  buffer
              size.

       On the test system /dev/sg0 corresponds to a fast disk  on
       a  U2W  SCSI  bus (max 80 MB/sec). The disk specifications
       state that its cache is 4 MB.
          $ time ./sg_rbuf /dev/sg0
       READ BUFFER reports: buffer capacity=3434944,
           offset boundary=6
       Read 200 MBytes (actual 199 MB, 209531584 bytes),
           buffer size=3354 KBytes
       real 0m5.072s, user 0m0.000s, sys 0m2.280s

       So that is approximately 40 MB/sec at  40  %  utilization.
       Now  with  the addition of the "-q" option this throughput
       improves and the utilization drops to 0%.
          $ time ./sg_rbuf -q /dev/sg0
       READ BUFFER reports: buffer capacity=3434944,
           offset boundary=6
       Read 200 MBytes (actual 199 MB, 209531584 bytes),
           buffer size=3354 KBytes
       real 0m2.784s, user 0m0.000s, sys 0m0.000s


AUTHOR

       Written by Doug Gilbert


REPORTING BUGS

       Report bugs to <dgilbert@interlog.com>.


COPYRIGHT

       Copyright © 2000, 2001 Douglas Gilbert
       This software is distributed  under  the  GPL  version  2.
       There is NO warranty; not even for MERCHANTABILITY or FIT­
       NESS FOR A PARTICULAR PURPOSE.


SEE ALSO

       time(1)

sg3_utils-0.96            December 2001                SG_RBUF(8)
  
Show your Support for the Linux Tutorial

Purchase one of the products from our new online shop. For each product you purchase, the Linux Tutorial gets a portion of the proceeds to help keep us going.


Login
Nickname

Password

Security Code
Security Code
Type Security Code


Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!


Amazon Wish List

Did You Know?
You can help in many different ways.


Friends



Tell a Friend About Us

Bookmark and Share



Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.14 Seconds