linux writing often on main disk

This is a discussion on linux writing often on main disk within the Linux Programming forums, part of the Platform Specific Boards category; oh that's cool but it then prevents me from measuring the time for writing to the hard disk!!...

  1. #16
    Alessio Stella
    Join Date
    May 2008
    Location
    Italy, Bologna
    Posts
    251
    oh that's cool but it then prevents me from measuring the time for writing to the hard disk!!

  2. #17
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by mynickmynick View Post
    oh that's cool but it then prevents me from measuring the time for writing to the hard disk!!
    No, but it may prevent you from getting an accurate measurement for a short sequence of writes.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #18
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,265
    You can get around this by making your test use direct IO. Open the file with the O_DIRECT option set, and it wont cache the writes. Keep in mind that you will need to make all your writes page aligned (usually 4096 bytes).

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. ReadyBoost for Linux?
    By cyberfish in forum Tech Board
    Replies: 0
    Last Post: 06-07-2009, 05:52 AM
  2. C99 and int main()
    By cwr in forum C Programming
    Replies: 8
    Last Post: 09-19-2005, 07:54 AM
  3. Writing Linux Drivers
    By Jperensky in forum Linux Programming
    Replies: 1
    Last Post: 03-20-2002, 09:30 AM
  4. void or int for main?:)
    By bigtamscot in forum C Programming
    Replies: 13
    Last Post: 09-27-2001, 04:11 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21