linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Chernenkov <dmitryc@google.com>
To: Christoph Lameter <cl@linux.com>
Cc: Andrey Ryabinin <a.ryabinin@samsung.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Pekka Enberg <penberg@kernel.org>,
	Linux Memory Management List <linux-mm@kvack.org>,
	Sasha Levin <sasha.levin@oracle.com>,
	Konstantin Khlebnikov <koct9i@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] slub memory quarantine
Date: Tue, 3 Mar 2015 21:36:52 +0400	[thread overview]
Message-ID: <CAA6XgkFRWGZnfpaH5bBSah9SEMpvaJc6CvsaZDXgK-B3mQNYig@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1503031041340.14643@gentwo.org>

[-- Attachment #1: Type: text/plain, Size: 1800 bytes --]

I'm working on a different set of tools for KASan, independent of
slub_debug (so it can be turned off either by cmdline flag or kernel
config). Most of the ideas are taken from the userspace ASan.

- Use our own data structures (metadata, redzones, stacks, quarantine), so
the same code works in SLAB/SLUB, and Kasan is less dependent on allocator
internals.
- Redzone size is flexible based on object size.
- Store alloc/free stacks separately, in a compact structure (stack depot)
and index them via a hashtable, so we don't store identical stacks multiple
times. SLUB_DEBUG stacks have overhead of 256 bytes per object. Stack depot
takes ~100 times less.
- Quarantine is global (not per-slab or per-cache), with per-cpu queues
periodically flushed into a global one. kmem_cache_destroy and
kmem_cache_shrink launch a scan of quarantine to return all objects from
associated caches to the freelist. Thus, we don't need a separate shrinker
hook.



On Tue, Mar 3, 2015 at 7:42 PM, Christoph Lameter <cl@linux.com> wrote:

> On Tue, 3 Mar 2015, Andrey Ryabinin wrote:
>
> > On 03/03/2015 12:10 PM, Dmitry Vyukov wrote:
> > > Please hold on with this.
> > > Dmitry Chernenkov is working on a quarantine that works with both slub
> > > and slab, does not cause spurious OOMs and does not depend on
> > > slub-debug which has unacceptable performance (acquires global lock).
> >
> > I think that it's a separate issue. KASan already depend on slub_debug -
> it required for redzones/user tracking.
> > I think that some parts slub debugging (like user tracking and this
> quarantine)
> > could be moved (for CONFIG_KASAN=y) to the fast path without any locking.
>
> In general these features need to be ifdeffed out since they add
> significant overhead for the data structures and execution paths.
>
>

[-- Attachment #2: Type: text/html, Size: 2288 bytes --]

      reply	other threads:[~2015-03-03 17:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-03  8:55 Andrey Ryabinin
2015-03-03  9:10 ` Dmitry Vyukov
2015-03-03 15:39   ` Andrey Ryabinin
2015-03-03 16:42     ` Christoph Lameter
2015-03-03 17:36       ` Dmitry Chernenkov [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=CAA6XgkFRWGZnfpaH5bBSah9SEMpvaJc6CvsaZDXgK-B3mQNYig@mail.gmail.com \
    --to=dmitryc@google.com \
    --cc=a.ryabinin@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=dvyukov@google.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=koct9i@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --cc=sasha.levin@oracle.com \
    /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