vfs.add_to_page_cache not working anymore?

William Cohen wcohen@redhat.com
Tue Jun 13 15:22:11 GMT 2023


On 6/12/23 11:39, Daire Byrne via Systemtap wrote:
> I have recently updated my kernel (v6.3) and with systemtap version (v4.8),
> an old systemtap script I was using has stopped working.
> 
> It looks like I was counting pages added via vfs.add_to_page_cache as a
> means to work out file reads (over NFS) per pid.
> 
> But this function no longer seem to hit at all for me anymore:
> 
> stap -e 'probe vfs.add_to_page_cache { printf("Works.\n"); exit() }'
> 
> I am aware that v4.9 is the latest systemtap, but I have been struggling to
> get it to compile with the new jupyter stuff (my python version is too old).
> 
> Anyway, any help or pointers for vfs.add_to_page_cache greatly appreciated.
> 
> Daire
> 

Hi,

Switching to systemtap-4.9 is probably not going to change the results
in this case as there are no changes in tapset/linux/vfs.stp between
4.8 and 4.9.

Unfortunately, the kernels changes over time and some functions probed
by the tapset change over time or the way they are used by other parts
of the kernel changes.  The vfs.add_to_page cache in the vfs.stp has
three possible functions it probes: add_to_page_cache_locked,
add_to_page_cache_lru, and add_to_page_cache.  The first two functions
were added due to kernel commit f00654007fe1c15.  Did some git commit
archeology and only add_to_page_cache_lru is in the kernel due to
kernel git commit 2bb876b58d593d7f2522ec0f41f20a74fde76822.

The following URL show where add_to_page_cache_lru is used in 6.2.16
kernels nfs and can provide some method of seeing how the nfs related
functions get called:

https://elixir.bootlin.com/linux/v6.2.16/A/ident/add_to_page_cache_lru

As far as specifically what has changed to cause vfs.add_to_page_cache
not to trigger for NFS operations I am not sure.  For the 6.2 kernel
it might be good to get a backtrace of the triggering of it and then
use that information to see what has changed in the functions on the
backtrace.

stap -ldd -e 'probe vfs.add_to_page_cache { print_backtrace(); printf("Works.\n"); exit() }'

-Will



More information about the Systemtap mailing list