calculate actual state of caches wrt set of files/dirs, without modifying caches ? - Kernel

This is a discussion on calculate actual state of caches wrt set of files/dirs, without modifying caches ? - Kernel ; Is it possible to calculate the following thing from userspace: Some benchmarking program has list of filenames and dirnames. Can it calculate how many of inodes and data blocks of those items are *cached* vs how many are not, without ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: calculate actual state of caches wrt set of files/dirs, without modifying caches ?

  1. calculate actual state of caches wrt set of files/dirs, without modifying caches ?

    Is it possible to calculate the following thing from userspace:
    Some benchmarking program has list of filenames and dirnames.
    Can it calculate how many of inodes and data blocks of those items are *cached*
    vs how many are not, without modifying existing
    status of inode caches & buffer caches ?

    Thanks
    Yakov
    --
    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/

  2. Re: calculate actual state of caches wrt set of files/dirs, without modifying caches ?

    "Yakov Lerner" writes:

    > Is it possible to calculate the following thing from userspace:
    > Some benchmarking program has list of filenames and dirnames.
    > Can it calculate how many of inodes and data blocks of those items are *cached*
    > vs how many are not, without modifying existing
    > status of inode caches & buffer caches ?


    For inodes/dentries it is not possible AFAIK (short of taking a kernel
    crash dump and walking the data structures), but for file data you can mmap
    the file without accessing it and then check with mincore() for each page.

    -Andi
    --
    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/

+ Reply to Thread