[lkml]   [2005]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: 2.6.xx: dirty pages never being sync'd to disk?
    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.


    #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) {
    } 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)
    return 0;
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-11-14 18:22    [W:0.044 / U:47.524 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site