linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Potapenko <glider@google.com>
To: Christoph Lameter <cl@linux.com>
Cc: Andrey Konovalov <adech.fo@gmail.com>,
	Dmitriy Vyukov <dvyukov@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Joonsoo Kim <js1304@gmail.com>,
	Kostya Serebryany <kcc@google.com>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>,
	kasan-dev <kasan-dev@googlegroups.com>,
	Linux Memory Management List <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1] [mm] Set page->slab_cache for every page allocated for a kmem_cache.
Date: Fri, 27 May 2016 19:41:37 +0200	[thread overview]
Message-ID: <CAG_fn=V5pTXzPvRGd4PfGp33q8dD7gyNRF8p9W+JXS054Y+RXw@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1605271229330.30511@east.gentwo.org>

On Fri, May 27, 2016 at 7:30 PM, Christoph Lameter <cl@linux.com> wrote:
> On Fri, 27 May 2016, Alexander Potapenko wrote:
>
>> It's reasonable to rely on the fact that for every page allocated for a
>> kmem_cache the |slab_cache| field points to that cache. Without that it's
>> hard to figure out which cache does an allocated object belong to.
>
> The flags are set only in the head page of a coumpound page which is used
> by SLAB. No need to do this. This would just mean unnecessarily dirtying
> struct page cachelines on allocation.
>

Got it, thank you.
Looks like I just need to make sure my code uses
virt_to_head_page()->page_slab to get the cache for an object.

-- 
Alexander Potapenko
Software Engineer

Google Germany GmbH
Erika-Mann-Straße, 33
80636 München

Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2016-05-27 17:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-27 17:14 Alexander Potapenko
2016-05-27 17:30 ` Christoph Lameter
2016-05-27 17:41   ` Alexander Potapenko [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='CAG_fn=V5pTXzPvRGd4PfGp33q8dD7gyNRF8p9W+JXS054Y+RXw@mail.gmail.com' \
    --to=glider@google.com \
    --cc=adech.fo@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=aryabinin@virtuozzo.com \
    --cc=cl@linux.com \
    --cc=dvyukov@google.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=js1304@gmail.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=kcc@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rostedt@goodmis.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