From: Suren Baghdasaryan <surenb@google.com>
To: David Hildenbrand <david@redhat.com>
Cc: Hao Ge <hao.ge@linux.dev>,
rppt@kernel.org, akpm@linux-foundation.org, babka@suse.cz,
kent.overstreet@linux.dev, kees@kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, Hao Ge <gehao@kylinos.cn>
Subject: Re: [PATCH] codetag: debug: mark codetags for cma pages as empty
Date: Thu, 15 Aug 2024 11:04:31 -0700 [thread overview]
Message-ID: <CAJuCfpEArs7qr=QJE6+RiV2GTK+q4_UCHaAEQK_7coARuJj_dw@mail.gmail.com> (raw)
In-Reply-To: <e6357e8e-5dd4-47a1-b7a4-603d32633692@redhat.com>
On Thu, Aug 15, 2024 at 9:39 AM David Hildenbrand <david@redhat.com> wrote:
>
> On 15.08.24 11:03, Hao Ge wrote:
> > From: Hao Ge <gehao@kylinos.cn>
> >
> > Here are some warnning
> >
> > [ 1.342603] ------------[ cut here ]------------
> > [ 1.342608] alloc_tag was not set
> > [ 1.342623] WARNING: CPU: 0 PID: 1 at ./include/linux/alloc_tag.h:130 __free_pages+0x1a4/0x1b4
> > [ 1.342633] Modules linked in:
> > [ 1.342639] CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.11.0-rc3+ #12
> > [ 1.342645] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> > [ 1.342650] pc : __free_pages+0x1a4/0x1b4
> > [ 1.342654] lr : __free_pages+0x1a4/0x1b4
> > [ 1.342658] sp : ffff8000833dbcb0
> > [ 1.342661] x29: ffff8000833dbcb0 x28: ffff000b34d9dac0 x27: ffff80008175f000
> > [ 1.342669] x26: 00000000000fc000 x25: ffff800082ac6028 x24: ffff80008252e000
> > [ 1.342675] x23: ffff0000c0660000 x22: 0000000000000000 x21: 0000000000000009
> > [ 1.342681] x20: 0000000000000000 x19: fffffd7fc3ac0000 x18: ffffffffffffffff
> > [ 1.342688] x17: ffff80008105bf68 x16: ffff800081841bb4 x15: 0720072007200720
> > [ 1.342694] x14: 0720072007200720 x13: 0720072007200720 x12: 0720072007200720
> > [ 1.342700] x11: 0720072007200720 x10: 0720072007200720 x9 : 0720072007200720
> > [ 1.342706] x8 : 0720072007200720 x7 : ffff80008237bad0 x6 : c0000000ffff7fff
> > [ 1.342712] x5 : ffff80008237ba78 x4 : ffff8000820bbad0 x3 : 0000000000000001
> > [ 1.342719] x2 : 13c63f521095dc00 x1 : 13c63f521095dc00 x0 : 0000000000000000
> > [ 1.342725] Call trace:
> > [ 1.342728] __free_pages+0x1a4/0x1b4
> > [ 1.342732] init_cma_reserved_pageblock+0x5c/0xac
> > [ 1.342739] cma_init_reserved_areas+0x2b4/0x3f4
> > [ 1.342744] do_one_initcall+0x54/0x368
> > [ 1.342749] kernel_init_freeable+0x23c/0x450
> > [ 1.342755] kernel_init+0x2c/0x144
> > [ 1.342760] ret_from_fork+0x10/0x20
> > [ 1.342764] ---[ end trace 0000000000000000 ]---
> >
> > To avoid debug warnings while freeing cma pages which were not
> > allocated with usual allocators, mark their codetags as empty before
> > freeing.
> >
> > Reference commit d224eb0287fb ("codetag: debug: mark codetags
> > for reserved pages as empty")
> >
> > Fixes: 4b8736964640 ("mm/slab: add allocation accounting into slab allocation and free paths")
> > Signed-off-by: Hao Ge <gehao@kylinos.cn>
> > ---
> > mm/mm_init.c | 10 ++++++++++
> > 1 file changed, 10 insertions(+)
> >
> > diff --git a/mm/mm_init.c b/mm/mm_init.c
> > index 75c3bd42799b..d7d40a8d738f 100644
> > --- a/mm/mm_init.c
> > +++ b/mm/mm_init.c
> > @@ -2243,6 +2243,16 @@ void __init init_cma_reserved_pageblock(struct page *page)
> > set_page_count(p, 0);
> > } while (++p, --i);
> >
> > + /* pages were reserved and not allocated */
> > + if (mem_alloc_profiling_enabled()) {
> > + union codetag_ref *ref = get_page_tag_ref(page);
> > +
> > + if (ref) {
> > + set_codetag_empty(ref);
> > + put_page_tag_ref(ref);
> > + }
> > + }
> > +
> > set_pageblock_migratetype(page, MIGRATE_CMA);
> > set_page_refcounted(page);
> > __free_pages(page, pageblock_order);
>
> See https://lkml.kernel.org/r/20240813150758.855881-2-surenb@google.com
Good timing! Yes, it's the same issue.
>
> --
> Cheers,
>
> David / dhildenb
>
prev parent reply other threads:[~2024-08-15 18:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-15 9:03 Hao Ge
2024-08-15 16:39 ` David Hildenbrand
2024-08-15 18:04 ` Suren Baghdasaryan [this message]
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='CAJuCfpEArs7qr=QJE6+RiV2GTK+q4_UCHaAEQK_7coARuJj_dw@mail.gmail.com' \
--to=surenb@google.com \
--cc=akpm@linux-foundation.org \
--cc=babka@suse.cz \
--cc=david@redhat.com \
--cc=gehao@kylinos.cn \
--cc=hao.ge@linux.dev \
--cc=kees@kernel.org \
--cc=kent.overstreet@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rppt@kernel.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