Bug 29765 - Convert NFS from readpages to readahead => tapset/linux/nfs.stp breakage
Summary: Convert NFS from readpages to readahead => tapset/linux/nfs.stp breakage
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: runtime (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-09 12:57 UTC by Martin Cermak
Modified: 2023-05-19 09:07 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
new tapset probe nfs.aop.readfolio (363 bytes, patch)
2023-05-17 15:09 UTC, Martin Cermak
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Cermak 2022-11-09 12:57:17 UTC
Kernel commit 8786fde84 (Convert NFS from readpages to readahead) breaks the tapset/linux/nfs.stp (stap commit 7eed8d1fe):

semantic error: while resolving probe point: identifier 'module' at /usr/local/share/systemtap/tapset/linux/nfs.stp:976:27
        source:                           module("nfs").function ("nfs_readpages")

Linux kernel change:

commit 8786fde8421ce755a842051f9528674a1b1f0b9a
Author: Matthew Wilcox (Oracle) <willy@infradead.org>
Date:   Sat Jan 22 20:54:52 2022 +0000

    Convert NFS from readpages to readahead
    
    NFS is one of the last two users of the deprecated ->readpages aop.
    This conversion looks straightforward, but I have only compile-tested
    it.tapset/linux/nfs.stp  
    
    Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>


Reproducer using 5.14.0-186.kpq1.el9:

# cat readpages.stp 
probe nfs.aop.readpages {
        log(name);
        printf("dev=%d\n", dev);
        printf("ino=%d\n", ino);
        printf("nr_pages=%d\n", nr_pages);
        printf("file=%d\n", file);
        printf("rpages=%d\n", rpages);
        printf("rsize=%d\n", rsize);
        printf("argstr=%s\n", argstr);
        printf("size=%d\n", size);
        printf("units=%s\n", units);
}

probe nfs.aop.readpages.return {
        log(name);
        printf("retstr=%s\n", retstr);
        printf("size=%d\n", size);
        printf("units=%s\n", units);
}
# stap -vp4 readpages.stp 
Pass 1: parsed user script and 472 library scripts using 123716virt/102716res/8432shr/94144data kb, in 570usr/120sys/910real ms.
semantic error: while resolving probe point: identifier 'module' at /usr/local/share/systemtap/tapset/linux/nfs.stp:976:27
        source:                           module("nfs").function ("nfs_readpages")
                                          ^

semantic error: no match (similar functions: nfs_readpage, nfs_readahead, nfs_writepages, nfs_readdir, nfs_readpage_done)

semantic error: resolution failed in alias expansion builder

semantic error: while resolving probe point: identifier 'nfs' at readpages.stp:1:7
        source: probe nfs.aop.readpages {
                      ^

semantic error: no match

semantic error: while resolving probe point: identifier 'module' at /usr/local/share/systemtap/tapset/linux/nfs.stp:995:34
        source:                                  module("nfs").function ("nfs_readpages").return
                                                 ^

semantic error: resolution failed in alias expansion builder

Pass 2: analyzed script: 0 probes, 0 functions, 0 embeds, 0 globals using 190100virt/170936res/10092shr/160528data kb, in 2250usr/650sys/2903real ms.
Pass 2: analysis failed.  [man error::pass2]
#
Comment 1 Martin Cermak 2023-05-17 15:09:54 UTC
Created attachment 14885 [details]
new tapset probe nfs.aop.readfolio

Additional possibly interesting kernel commit:
65d023af7f29eb1250a6105141a74776bae7e1f8

When filing this PR, I thought that existing probe nfs.aop.readpage(s)
should be taught to also work with function ("nfs_read_folio").

But since a page can only be identified within a folio in case
the page number is known (*) ITSM the tapset should simply
keep probe nfs.aop.readpage(s) untouched, and provide brand new
probe nfs.aop.readfolio.

Attached trivial version of probe nfs.aop.readfolio.

-------
* https://elixir.bootlin.com/linux/latest/source/include/linux/page-flags.h#L282
Comment 2 Frank Ch. Eigler 2023-05-18 16:50:42 UTC
lgtm
Comment 3 Martin Cermak 2023-05-19 09:07:31 UTC
commit 7b1557c548686c55948e4a38d8954eff420428a9