linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: linux-mm@kvack.org
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>, linux-fsdevel@vger.kernel.org
Subject: page_ref tracepoints
Date: Thu, 23 Jan 2025 19:55:24 +0000	[thread overview]
Message-ID: <Z5KerEzWmu61hFDU@casper.infradead.org> (raw)

The page reference count tracepoints currently look like this:

                __entry->pfn = page_to_pfn(page);
                __entry->flags = page->flags;
                __entry->count = page_ref_count(page);
                __entry->mapcount = atomic_read(&page->_mapcount);
                __entry->mapping = page->mapping;
                __entry->mt = get_pageblock_migratetype(page);
        TP_printk("pfn=0x%lx flags=%s count=%d mapcount=%d mapping=%p mt=%d val=%d",


Soon, pages will not have a ->mapping, nor a ->mapcount [1].  But they will
still have a refcount, at least for now.  put_page() will move out of
line and look something like this:

void put_page(struct page *page)
{
        unsigned long memdesc = page->memdesc;
        if (memdesc_is_folio(memdesc))
                return folio_put(memdesc_folio(memdesc));
        BUG_ON(memdesc_is_slab(memdesc));
        ... handle other memdesc types here ...
	if (memdesc_is_compound_head(memdesc))
		page = memdesc_head_page(memdesc);

        if (put_page_testzero(page))
                __put_page(page);
}

What I'm thinking is:

 - Define a set of folio_ref_* tracepoints which dump exactly the same info
   as page_ref does today
 - Remove mapping & mapcount from page_ref_* functions.

Other ideas?  I don't use these tracepoints myself; they generate far
too much data to be useful to me.

[1] In case you missed it,
https://lore.kernel.org/linux-mm/Z37pxbkHPbLYnDKn@casper.infradead.org/


             reply	other threads:[~2025-01-23 19:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-23 19:55 Matthew Wilcox [this message]
2025-01-27  7:46 ` David Hildenbrand
2025-01-27 23:42 ` Alistair Popple

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z5KerEzWmu61hFDU@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox