All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	bugzilla-daemon@bugzilla.kernel.org, dsmythies@telus.net,
	linux-mm@kvack.org
Subject: Re: [Bug 172981] New: [bisected] SLAB: extreme load averages and over 2000 kworker threads
Date: Wed, 28 Sep 2016 11:09:53 +0300	[thread overview]
Message-ID: <20160928080953.GA20312@esperanza> (raw)
In-Reply-To: <20160928020347.GA21129@cmpxchg.org>

On Tue, Sep 27, 2016 at 10:03:47PM -0400, Johannes Weiner wrote:
> [CC Vladimir]
> 
> These are the delayed memcg cache allocations, where in a fresh memcg
> that doesn't have per-memcg caches yet, every accounted allocation
> schedules a kmalloc work item in __memcg_schedule_kmem_cache_create()
> until the cache is finally available. It looks like those can be many
> more than the number of slab caches in existence, if there is a storm
> of slab allocations before the workers get a chance to run.
> 
> Vladimir, what do you think of embedding the work item into the
> memcg_cache_array? That way we make sure we have exactly one work per
> cache and not an unbounded number of them. The downside of course is
> that we'd have to keep these things around as long as the memcg is in
> existence, but that's the only place I can think of that allows us to
> serialize this.

We could set the entry of the root_cache->memcg_params.memcg_caches
array corresponding to the cache being created to a special value, say
(void*)1, and skip scheduling cache creation work on kmalloc if the
caller sees it. I'm not sure it's really worth it though, because
work_struct isn't that big (at least, in comparison with the cache
itself) to avoid embedding it at all costs.

--
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-09-28  8:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-172981-27@https.bugzilla.kernel.org/>
2016-09-27 18:10 ` [Bug 172981] New: [bisected] SLAB: extreme load averages and over 2000 kworker threads Andrew Morton
2016-09-28  2:03   ` Johannes Weiner
2016-09-28  8:09     ` Vladimir Davydov [this message]
2016-09-29  2:00       ` Joonsoo Kim
2016-09-29 13:45         ` Vladimir Davydov
2016-09-30  8:19           ` Joonsoo Kim
2016-09-30 19:58             ` Vladimir Davydov
2016-10-06  5:04             ` Doug Smythies
2016-10-06  6:35               ` Joonsoo Kim
2016-10-06 16:02               ` Doug Smythies
2016-10-07 15:55               ` Doug Smythies
2016-09-28  3:13   ` Doug Smythies
2016-09-28  5:18     ` Joonsoo Kim
2016-09-28  6:20       ` Joonsoo Kim
2016-09-28 15:22       ` Doug Smythies
2016-09-29  1:50         ` Joonsoo Kim

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=20160928080953.GA20312@esperanza \
    --to=vdavydov.dev@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bugzilla-daemon@bugzilla.kernel.org \
    --cc=dsmythies@telus.net \
    --cc=hannes@cmpxchg.org \
    --cc=iamjoonsoo.kim@lge.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.