linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Pingfan Liu <kernelfans@gmail.com>
To: Christoph Lameter <cl@linux.com>
Cc: linux-mm@kvack.org, Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] mm/slub: disallow obj's allocation on page with mismatched pfmemalloc purpose
Date: Thu, 27 Sep 2018 21:15:29 +0800	[thread overview]
Message-ID: <CAFgQCTtUGs6LkJBiZnH-kiOBUCuFpGEDX+ExvJbRTY6W5-Rh6g@mail.gmail.com> (raw)
In-Reply-To: <0100016616a8e4ba-fb8d5b4e-27cf-4f4f-b86c-a37d4e08a759-000000@email.amazonses.com>

On Thu, Sep 27, 2018 at 12:14 AM Christopher Lameter <cl@linux.com> wrote:
>
> On Wed, 26 Sep 2018, Pingfan Liu wrote:
>
> > -
> >       if (unlikely(!freelist)) {
> >               slab_out_of_memory(s, gfpflags, node);
> >               return NULL;
> >       }
> >
> > +     VM_BUG_ON(!pfmemalloc_match(page, gfpflags));
> >       page = c->page;
> > -     if (likely(!kmem_cache_debug(s) && pfmemalloc_match(page, gfpflags)))
> > +     if (likely(!kmem_cache_debug(s))
> >               goto load_freelist;
> >
> >       /* Only entered in the debug case */
> > -     if (kmem_cache_debug(s) &&
> > -                     !alloc_debug_processing(s, page, freelist, addr))
> > +     if (!alloc_debug_processing(s, page, freelist, addr))
> >               goto new_slab;  /* Slab failed checks. Next slab needed */
> > -
> > -     deactivate_slab(s, page, get_freepointer(s, freelist), c);
>
> In the debug case the slab needs to be deactivated. Otherwise the
> slowpath will not be used and debug checks on the following objects will
> not be done.
>
Got it.

Thanks,
Pingfan

  reply	other threads:[~2018-09-27 13:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-26  6:52 Pingfan Liu
2018-09-26 16:14 ` Christopher Lameter
2018-09-27 13:15   ` Pingfan Liu [this message]
2018-09-30  9:33     ` Pingfan Liu
2018-10-02 14:47       ` Christopher Lameter

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=CAFgQCTtUGs6LkJBiZnH-kiOBUCuFpGEDX+ExvJbRTY6W5-Rh6g@mail.gmail.com \
    --to=kernelfans@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.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