mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Vlastimil Babka <vbabka@suse.cz>,
	Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Linux-MM <linux-mm@kvack.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 6.10 000/809] 6.10.3-rc3 review
Date: Tue, 6 Aug 2024 11:09:52 -0700	[thread overview]
Message-ID: <4f71784a-e896-4512-b1e5-600d0497037c@roeck-us.net> (raw)
In-Reply-To: <53b2e1f2-4291-48e5-a668-7cf57d900ecd@suse.cz>

On 8/6/24 04:02, Vlastimil Babka wrote:
> On 8/6/24 04:40, Linus Torvalds wrote:
>> [ Let's drop random people and bring in Vlastimil ]
> 
> tglx was reproducing it so I add him back
> 
>> Vlastimil,
>>   it turns out that the "this patch" is entirely a red herring, and the
>> problem comes and goes randomly with just some code layout issues. See
>>
>>     http://server.roeck-us.net/qemu/parisc64-6.10.3/
>>
>> for more detail, particularly you'll see the "log.bad.gz" with the full log.
> 
> [    0.000000] BUG kmem_cache_node (Not tainted): objects 21 > max 16
> [    0.000000] Slab 0x0000000041ed0000 objects=21 used=5 fp=0x00000000434003d0 flags=0x200(workingset|section=0|zone=0)
> 
> flags tell us this came from the partial list (workingset), there's no head flag so order-0
> 
> since the error was detected it basically throws the slab page away and tries another one
> 
> [    0.000000] BUG kmem_cache (Tainted: G    B             ): objects 25 > max 16
> [    0.000000] Slab 0x0000000041ed0080 objects=25 used=6 fp=0x0000000043402790 flags=0x240(workingset|head|section=0|zone=0)
> 
> this was also from the partial list but head flag so at least order-1, two things are weird:
> - max=16 is same as above even though it should be at least double as
> slab page's order is larger
> - objects=25 also isn't at least twice than objects=21
> 
> All the following are:
> [    0.000000] BUG kmem_cache (Tainted: G    B             ): objects 25 > max 16
> [    0.000000] Slab 0x0000000041ed0300 objects=25 used=1 fp=0x000000004340c150 flags=0x40(head|section=0|zone=0)
> 
> we depleted the partial list so it's allocating new slab pages, that are
> also at least order-1
> 
> It looks like maxobj calculation is bogus, would be useful to see what values it
> calculates from. I'm attaching a diff, but maybe it will also hide the issue...
> 

If I am really careful I can catch the problem. Adding a parameter to slab_err()
makes it disappear. Calling slab_order() multiple times makes it disappear. But I can
assign the result of slab_order() to a variable and go from there, by changing the
parameters to slab_err() one at a time. Here is what I get by combining multiple
test runs.

objects 21 max 16 order 0 size 192
  with:
   Slab 0x0000000041ed0000 objects=21 used=5 fp=0x00000000434003d0 flags=0x200(workingset|section=0|zone=0)
objects 25 max 16 order 1 size 320 (many times)
  with:
   Slab 0x0000000041ed0080 objects=25 used=6 fp=0x0000000043402790 flags=0x240(workingset|head|section=0|zone=0)
   Slab 0x0000000041ed0300 objects=25 used=1 fp=0x000000004340c150 flags=0x40(head|section=0|zone=0)
   Slab 0x0000000041ed0380 objects=25 used=1 fp=0x000000004340e150 flags=0x40(head|section=0|zone=0)
   and so on

If I add a log message into check_slab() and display every check I get:

objects 21 max 21 (order 0 size 192)
objects 25 max 25 (order 1 size 320)
objects 25 max 25 (order 1 size 320)
objects 25 max 25 (order 1 size 320)
objects 21 max 21 (order 0 size 192)

and so on. I guess that confirms that the maxobj calculation is wrong in the failure case.
That seems weird, though, given that order_objects() should return a constant based on
order and size. PAGE_SIZE is 4096, meaning order_objects() should return 21 and 25, never
16. That does make me really wonder if there is an emulation problem, though I don't
really understand why that would not be persistent.

Any idea what else I could test ?

Thanks,
Guenter


  parent reply	other threads:[~2024-08-06 18:09 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-31 10:03 Greg Kroah-Hartman
2024-07-31 11:03 ` Pavel Machek
2024-07-31 12:18 ` Mark Brown
2024-07-31 13:33 ` Luna Jernberg
2024-07-31 14:59 ` Jon Hunter
2024-07-31 15:12 ` Christian Heusel
2024-07-31 16:49 ` Markus Reichelt
2024-07-31 19:04 ` Peter Schneider
2024-07-31 19:29 ` Naresh Kamboju
2024-07-31 19:47 ` Justin Forbes
2024-07-31 20:25 ` Shuah Khan
2024-07-31 20:37 ` Allen
2024-07-31 21:03 ` Florian Fainelli
2024-08-01  5:15 ` Jiri Slaby
2024-08-01  7:49 ` Ron Economos
2024-08-02  6:59 ` Miguel Ojeda
2024-08-04 18:36 ` Guenter Roeck
2024-08-05  3:28   ` Guenter Roeck
2024-08-05  8:56     ` Thomas Gleixner
2024-08-05 12:51       ` Thomas Gleixner
2024-08-05 15:02         ` Guenter Roeck
2024-08-05 21:49           ` Thomas Gleixner
2024-08-06  1:16             ` Guenter Roeck
2024-08-05 17:42       ` Guenter Roeck
2024-08-06  2:40   ` Linus Torvalds
2024-08-06 11:02     ` Vlastimil Babka
2024-08-06 17:20       ` Guenter Roeck
2024-08-06 17:34         ` Linus Torvalds
2024-08-06 17:49           ` Linus Torvalds
2024-08-06 18:10             ` Linus Torvalds
2024-08-06 18:13             ` Guenter Roeck
2024-08-06 18:23               ` Linus Torvalds
2024-08-06 19:21                 ` Vlastimil Babka
2024-08-06 19:40                   ` Vlastimil Babka
2024-08-07 18:51             ` Alexander Gordeev
2024-08-06 17:33       ` Thomas Gleixner
2024-08-06 19:25         ` Vlastimil Babka
2024-08-06 23:24           ` Thomas Gleixner
2024-08-07  0:49             ` James Bottomley
2024-08-07  1:38               ` Guenter Roeck
2024-08-07 12:45               ` Thomas Gleixner
2024-08-08  1:07             ` Guenter Roeck
2024-08-08  7:48               ` Vlastimil Babka
2024-08-08 14:46                 ` Guenter Roeck
2024-08-08  9:57               ` Thomas Gleixner
2024-08-08 14:59                 ` Guenter Roeck
2024-08-08 15:58                   ` John David Anglin
2024-08-08 15:53                 ` Linus Torvalds
2024-08-08 16:12                   ` Thomas Gleixner
2024-08-08 16:33                     ` Linus Torvalds
2024-08-08 17:48                       ` Thomas Gleixner
2024-08-08 18:19                         ` Linus Torvalds
2024-08-08 20:52                           ` Guenter Roeck
2024-08-08 21:50                             ` John David Anglin
2024-08-08 22:29                               ` John David Anglin
2024-08-08 23:33                                 ` Linus Torvalds
2024-08-09  0:33                                   ` John David Anglin
2024-08-09  0:56                                 ` Guenter Roeck
2024-08-09  0:50                               ` Guenter Roeck
2024-08-08 22:15                             ` Richard Henderson
2024-09-03  7:54                           ` Helge Deller
2024-09-03 14:13                             ` Guenter Roeck
2024-09-03 18:43                             ` Linus Torvalds
2024-08-06 18:09       ` Guenter Roeck [this message]
2024-08-06 19:31         ` Vlastimil Babka
2024-07-31 14:09 Ronald Warsow

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=4f71784a-e896-4512-b1e5-600d0497037c@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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

all inboxes | Powered by JetHome®