from small one page howto to huge articles all in one place

search text in:




Other .linuxhowtos.org sites:gentoo.linuxhowtos.org



Last additions:
using iotop to find disk usage hogs

using iotop to find disk usage hogs

words:

887

views:

209586

userrating:


May 25th. 2007:
Words

486

Views

258592

why adblockers are bad


Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

words:

161

views:

149883

userrating:


April, 26th. 2006:

Druckversion
You are here: manpages





cachestat

Section: System Calls (2)
Updated: 202-0-28
Index Return to Main Contents
 

NAME

cachestat - query the page cache statistics of a file  

SYNOPSIS

#include <sys/mman.h>
int cachestat(unsigned int fd, struct cachestat_range *cstat_range,
              struct cachestat *cstat, unsigned int flags);
struct cachestat_range { __u64 off; __u64 len; }; struct cachestat { __u64 nr_cache; __u64 nr_dirty; __u64 nr_writeback; __u64 nr_evicted; __u64 nr_recently_evicted; };  

DESCRIPTION

cachestat() queries the number of cached pages, dirty pages, pages marked for writeback, evicted pages, and recently evicted pages in the byte range specified by .off and .len in the cachestat_range structure. An evicted page is one that was previously in the page cache but has since been evicted. A page is considered recently evicted if its reentry into the cache would indicate active usage under memory pressure. The results are returned in a cachestat structure, pointed to by the cstat argument. The .off and .len fields must be no-negative. If .len~>~0, the queried range is [.off,~.off+.len]. If len~==~0, the range is from .off to the end of the file. The flags argument is reserved for future use and must be set to 0. Currently, hugetlbfs files are not supported.  

RETURN VALUE

On success, cachestat() returns 0. On error, -1 is returned, and errno is set to indicate the error.  

ERRORS

EFAULT
cstat or cstat_range point to an invalid address.
EINVAL
Invalid flags value.
EBADF
Invalid file descriptor.
EOPNOTSUPP
The file descriptor refers to a hugetlbfs file, which is unsupported.
 

STANDARDS

Linux.  

HISTORY

Linux 6.5.  

CAVEATS

Note that the status of a page may change after cachestat() retrieves it but before the values are returned to the application; thus, the values may be slightly outdated.


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
ERRORS
STANDARDS
HISTORY
CAVEATS





Support us on Content Nation
rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2025 Sascha Nitsch Unternehmensberatung GmbH
Valid XHTML1.1 : Valid CSS
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 12.6 ms