linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: David Howells <dhowells@redhat.com>
Cc: Christoph Lameter <cl@linux.com>, linux-mm@kvack.org
Subject: Re: [PATCH] Add a slab corruption tracepoint
Date: Mon, 19 Aug 2019 11:22:23 +0200	[thread overview]
Message-ID: <a6953dff-a37f-6bb1-b12b-7a652b62998f@suse.cz> (raw)
In-Reply-To: <8356.1566205424@warthog.procyon.org.uk>

On 8/19/19 11:03 AM, David Howells wrote:
> Vlastimil Babka <vbabka@suse.cz> wrote:
> 
>> Shouldn't that include SLUB?
> 
> I've been using SLAB.  Looking in SLUB it's much less obvious where to insert
> the tracepoint.  check_bytes_and_report() maybe?

Perhaps object_err() and slab_err().

>> I'm surprised to see SLAB used for debugging refcounting these days,
> 
> The refcount debugging in question is not in SLAB, but rather in rxrpc; it's
> just SLAB detected the resulting memory corruption.

I understand, and it's what I meant - SLUB is better suited to debug
wrong uses (use-after-free, double free) that may be e.g. result of a
refcounting bug. You can configure it to perform the extra checks only
on the single cache you care about, and when it detects inconsistency it
will also print stacktraces of who last allocated and freed the object.

> rxrpc has tracepoints
> that track the refcounting, but SLAB printks a message to indicate the
> corruption and it's a bit tricky to work out where the printk happened with
> respect to the trace.

Could you correlate by timestamps?

>> as the SLUB debugging features are vastly superior, while SLAB ones are
>> being sometimes found to be broken for years and removed.
> 
> If SLUB is better than SLAB, shouldn't SLAB be removed?

It has been proposed before, but SLAB still has its users, who don't
care about the debugging scenarios that much.

> David
> 



      reply	other threads:[~2019-08-19  9:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-08 14:11 David Howells
2019-08-12 15:03 ` Vlastimil Babka
2019-08-19  9:03 ` David Howells
2019-08-19  9:22   ` Vlastimil Babka [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=a6953dff-a37f-6bb1-b12b-7a652b62998f@suse.cz \
    --to=vbabka@suse.cz \
    --cc=cl@linux.com \
    --cc=dhowells@redhat.com \
    --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