Re: [PATCH] filemap: add trace events for get_pages, map_pages, and fault

2024-06-20 Thread Takaya Saeki
Thank you Matthew for taking a look at this! I fix both points and send a V2 patch. > This needs to be cast to an loff_t before shifting. I found that this applies to add_to_page_cache and delete_from_page_cache, too. I could fix them too, but I didn't since it will change the max value of those

Re: [PATCH] filemap: add trace events for get_pages, map_pages, and fault

2024-06-19 Thread Matthew Wilcox
On Tue, Jun 18, 2024 at 09:36:56AM +, Takaya Saeki wrote: > + TP_printk( > + "dev %d:%d ino %lx ofs=%lu max_ofs=%lu", It seems weird to have a space between dev and %d, but an equals between ofs and %lu. I see there is some precedent for this elsewhere, but there are other pla

Re: [PATCH] filemap: add trace events for get_pages, map_pages, and fault

2024-06-19 Thread Takaya Saeki
Thanks Steven for trying it out. > I can see it bringing down the number of pages needed to be saved > dramatically. Yes, I agree. However, note that wc does not count the size of the page caches correctly since 'get_map_pages' gives you a range. In your example of the less command, actually the

Re: [PATCH] filemap: add trace events for get_pages, map_pages, and fault

2024-06-18 Thread Steven Rostedt
On Tue, 18 Jun 2024 09:36:56 + Takaya Saeki wrote: > To allow precise tracking of page caches accessed, add new tracepoints > that trigger when a process actually accesses them. > > The ureadahead program used by ChromeOS traces the disk access of > programs as they start up at boot up. It u

[PATCH] filemap: add trace events for get_pages, map_pages, and fault

2024-06-18 Thread Takaya Saeki
To allow precise tracking of page caches accessed, add new tracepoints that trigger when a process actually accesses them. The ureadahead program used by ChromeOS traces the disk access of programs as they start up at boot up. It uses mincore(2) or the 'mm_filemap_add_to_page_cache' trace event to