linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Suren Baghdasaryan <surenb@google.com>
To: David Hildenbrand <david@redhat.com>
Cc: akpm@linux-foundation.org, kent.overstreet@linux.dev,
	vbabka@suse.cz,  pasha.tatashin@soleen.com,
	souravpanda@google.com, keescook@chromium.org,
	 linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	stable@vger.kernel.org
Subject: Re: [PATCH v2 1/1] alloc_tag: mark pages reserved during CMA activation as not tagged
Date: Tue, 13 Aug 2024 07:27:44 -0700	[thread overview]
Message-ID: <CAJuCfpExN+esSMgOSmSXivDEeiwSqkeOAr6_Pw-yL+-8ajtGYQ@mail.gmail.com> (raw)
In-Reply-To: <471af0a8-92fc-4fe0-85e4-193d713d4e57@redhat.com>

On Tue, Aug 13, 2024 at 2:25 AM David Hildenbrand <david@redhat.com> wrote:
>
> On 12.08.24 21:24, Suren Baghdasaryan wrote:
> > During CMA activation, pages in CMA area are prepared and then freed
> > without being allocated. This triggers warnings when memory allocation
> > debug config (CONFIG_MEM_ALLOC_PROFILING_DEBUG) is enabled. Fix this
> > by marking these pages not tagged before freeing them.
> >
> > Fixes: d224eb0287fb ("codetag: debug: mark codetags for reserved pages as empty")
> > Signed-off-by: Suren Baghdasaryan <surenb@google.com>
> > Cc: stable@vger.kernel.org # v6.10
> > ---
> > changes since v1 [1]
> > - Added Fixes tag
> > - CC'ed stable
> >
> > [1] https://lore.kernel.org/all/20240812184455.86580-1-surenb@google.com/
> >
> >   mm/mm_init.c | 10 ++++++++++
> >   1 file changed, 10 insertions(+)
> >
> > diff --git a/mm/mm_init.c b/mm/mm_init.c
> > index 75c3bd42799b..ec9324653ad9 100644
> > --- a/mm/mm_init.c
> > +++ b/mm/mm_init.c
> > @@ -2245,6 +2245,16 @@ void __init init_cma_reserved_pageblock(struct page *page)
> >
> >       set_pageblock_migratetype(page, MIGRATE_CMA);
> >       set_page_refcounted(page);
> > +
> > +     /* 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);
> > +             }
> > +     }
>
> Should we have a helper like clear_page_tag_ref() that wraps this?

With this one we have 3 instances of this sequence, so it makes sense
to have a helper. I'm going to send a v3 with 2 patches - one
introducing clear_page_tag_ref() and the next one adding this
instance.
Thanks for the suggestion, David!

>
> --
> Cheers,
>
> David / dhildenb
>


  reply	other threads:[~2024-08-13 14:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-12 19:24 Suren Baghdasaryan
2024-08-13  9:25 ` David Hildenbrand
2024-08-13 14:27   ` Suren Baghdasaryan [this message]
2024-08-13 15:18     ` Suren Baghdasaryan

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=CAJuCfpExN+esSMgOSmSXivDEeiwSqkeOAr6_Pw-yL+-8ajtGYQ@mail.gmail.com \
    --to=surenb@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=keescook@chromium.org \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pasha.tatashin@soleen.com \
    --cc=souravpanda@google.com \
    --cc=stable@vger.kernel.org \
    --cc=vbabka@suse.cz \
    /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