[LTP] [PATCH v1 0/3] cachestat testing suite

Cyril Hrubis chrubis@suse.cz
Mon Jul 15 18:00:30 CEST 2024


Hi!
> > I had to go through the cachestat code and maybe i found the solution. I 
> > will send the tests soon.
> 
> I had a look as well and it looks that cachestat should work fine for
> all file descriptors that can be mmaped(). So as long as you get success
> for a file descriptor that returns EBADF for mmap() it shouldn't
> probably work with cachestat() either.

And after more staring at the kernel sources I've found that:

- anonymous inodes have the page cache mappings initialized to zeros and
  empty list
- this is not used for anything for most types of file descriptors (e.g.
  sockets)

So if you call cacestat() on a socket fd it will try to loop over empty
list of vmas and the end result would be statistics that are full of
zeroes. Maybe that is worth of a special test just for this case.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list