Re: 2.6.xx: dirty pages never being sync'd to disk?

From: Mark Lord (lkml_at_rtr.ca)
Date: 11/14/05

  • Next message: Greg KH: "Re: 2.6.14-mm1"
    Date:	Mon, 14 Nov 2005 12:15:18 -0500
    To: Badari Pulavarty <pbadari@gmail.com>
    
    

    Badari Pulavarty wrote:
    >
    > Interesting. Since you have a very easy to reproduce case -
    > can you write a program to do posix_fadvise(POSIX_FADV_DONTNEED)
    > on those files in directory "t" and see what happens ?

    Sure. It appears to cause an immediate "sync" of the file data
    to disk (lots of drive activity for a few seconds), and the Dirty
    count from /proc/meminfo reduces correspondingly.

    Oddly enough, the Dirty count didn't go all the way down, though.
    Doing a "sync" or a second run of the program afterwards does
    get the count down to zero immediately, without any significant I/O.

    Strange.

    #include <fcntl.h>
    #include <stdio.h>
    #include <unistd.h>
    #include <sys/types.h>

    int main (int argc, char *argv[])
    {
             while (--argc > 0) {
                     int fd = open(*++argv, O_RDWR);
                     if (fd == -1) {
                             perror(*argv);
                     } else {
                             int posix_fadvise(int, off_t, off_t, int);
                             const int POSIX_FADV_DONTNEED = 4;
                             int rc = posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED);
                             if (rc == -1)
                                     perror(*argv);
                             close(fd);
                     }
             }
             return 0;
    }
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Greg KH: "Re: 2.6.14-mm1"

    Relevant Pages

    • Re: [GIT PULL] Ext3 latency fixes
      ... as it also implies an immediate unplug of the device. ... So not only does it flag the priority as sync, ... They may be bulk, ... this effort at the filesystem level. ...
      (Linux-Kernel)
    • Re: [2.6.13] pktcdvd: IO-errors
      ... > It was the first time I ever tried it. ... Actually, just wrote a small file to it, did a sync, sync ... What gcc versions were used when compiling the kernels? ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] Laptop-mode v7 for linux 2.6.1
      ... > disc does not spin up every time I switch to another folder or just ... If you have some app which calls sync() all ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Mercurial 0.3 vs git benchmarks
      ... > This agrees with my tests here, the time to apply patches is somewhat disk ... ext3 really does suck in many ways. ... because it can only sync the whole log. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [bkbits] predicted outage
      ... We're moving office space in about 10 days. ... Sounds simple and since the new ISP is the old ISP it might ... before the move so those of you who need to sync can sync and not be ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)