linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "David Wang" <00107082@163.com>
To: "Suren Baghdasaryan" <surenb@google.com>
Cc: "Vlastimil Babka" <vbabka@suse.com>,
	vbabka@suse.cz, linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	"Harry Yoo" <harry.yoo@oracle.com>
Subject: Re: [7.0-rc1] codetag: kernel warning "alloc_tag was not set" during boot
Date: Tue, 24 Feb 2026 19:15:32 +0800 (CST)	[thread overview]
Message-ID: <1fc0ba5b.691c.19c8f5c88e1.Coremail.00107082@163.com> (raw)
In-Reply-To: <CAJuCfpEsykCarj6_k5T9EeLDfsA0fFL182g1hQ+tb-7EM=izsw@mail.gmail.com>




At 2026-02-24 15:07:08, "Suren Baghdasaryan" <surenb@google.com> wrote:
>On Mon, Feb 23, 2026 at 6:28 PM David Wang <00107082@163.com> wrote:
>>
>>
>> At 2026-02-24 01:18:32, "Vlastimil Babka" <vbabka@suse.com> wrote:
>> >On 2/23/26 16:51, David Wang wrote:
>> >> Hi,
>> >>
>> >> When upgrade to 7.0.0-rc1, caught a kernel WARN during boot:
>> >
>> >Would this possibly help? (it probably shouldn't but let's see)
>> >https://lore.kernel.org/all/20260223075809.19265-1-harry.yoo@oracle.com/
>> >
>>
>> Hi,
>> I tried this patch, but sadly, it doesn't help with the warning on my system...
>
>Unfortunately I can't boot far enough with your config to get that warning.
>
>You might be able to track down which allocation does not get its tag
>by first checking for current->alloc_tag==NULL inside
>__alloc_tagging_slab_alloc_hook() and dump the stack if that happens.
>If there are no hits (which is probably what will happen) you can do
>the same while checking for obj_exts==NULL. I suspect that condition
>will hit multiple times and one of those will likely be the cause of
>this warning. I'll look into this more tomorrow if the cause is not
>found by then.

I throw in some debug code :

iff --git a/mm/slub.c b/mm/slub.c
index 862642c165ed..2f72fbae4ecc 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2375,6 +2375,14 @@ __alloc_tagging_slab_alloc_hook(struct kmem_cache *s, void *object, gfp_t flags)
         * check should be added before alloc_tag_add().
         */
        if (obj_exts) {
+               if (!current->alloc_tag) {
+                       static int counter=0;
+                       if (counter==0) {
+                               pr_warn("object_exts & !current->alloc_tag");
+                               dump_stack();
+                       }
+                       counter++;
+               }
                unsigned int obj_idx = obj_to_index(s, slab, object);
 
                get_slab_obj_exts(obj_exts);
@@ -2382,6 +2390,14 @@ __alloc_tagging_slab_alloc_hook(struct kmem_cache *s, void *object, gfp_t flags)
                alloc_tag_add(&obj_ext->ref, current->alloc_tag, s->size);
                put_slab_obj_exts(obj_exts);
        } else {
+               if (!current->alloc_tag) {
+                       static int counter=0;
+                       if (counter==0) {
+                               pr_warn("!object_exts & !current->alloc_tag");
+                               dump_stack();
+                       }
+                       counter++;
+               }
                alloc_tag_set_inaccurate(current->alloc_tag);
        }
 }


But neither "object_exts & !current->alloc_tag" nor "!object_exts & !current->alloc_tag" was ever hit.


Some update:
1. Same warning shows up with my KVM on the same host.  
2. reverting 913ffd3a1bf5 can make the warning go away.


David

>
>>
>>
>>

  reply	other threads:[~2026-02-24 11:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-23 15:51 David Wang
2026-02-23 17:18 ` Vlastimil Babka
2026-02-23 18:34   ` Suren Baghdasaryan
2026-02-24  1:56     ` David Wang
2026-02-24  2:15   ` Harry Yoo
2026-02-24  2:28   ` David Wang
2026-02-24  7:07     ` Suren Baghdasaryan
2026-02-24 11:15       ` David Wang [this message]
2026-02-24 14:16       ` Harry Yoo
2026-02-24 14:26         ` Harry Yoo

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=1fc0ba5b.691c.19c8f5c88e1.Coremail.00107082@163.com \
    --to=00107082@163.com \
    --cc=harry.yoo@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=surenb@google.com \
    --cc=vbabka@suse.com \
    --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