public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Vladimir Davydov <vdavydov@virtuozzo.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Christoph Lameter <cl@linux.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@kernel.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: slub: replace kick_all_cpus_sync with synchronize_sched in kmem_cache_shrink
Date: Fri, 1 Apr 2016 17:48:03 +0200	[thread overview]
Message-ID: <20160401154803.GL3448@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <1459513817-11853-1-git-send-email-vdavydov@virtuozzo.com>

On Fri, Apr 01, 2016 at 03:30:17PM +0300, Vladimir Davydov wrote:
> When we call __kmem_cache_shrink on memory cgroup removal, we need to
> synchronize kmem_cache->cpu_partial update with put_cpu_partial that
> might be running on other cpus. Currently, we achieve that by using
> kick_all_cpus_sync, which works as a system wide memory barrier. Though
> fast it is, this method has a flow - it issues a lot of IPIs, which
> might hurt high performance or real-time workloads.
> 
> To fix this, let's replace kick_all_cpus_sync with synchronize_sched.
> Although the latter one may take much longer to finish, it shouldn't be
> a problem in this particular case, because memory cgroups are destroyed
> asynchronously from a workqueue so that no user visible effects should
> be introduced. OTOH, it will save us from excessive IPIs when someone
> removes a cgroup.
> 
> Anyway, even if using synchronize_sched turns out to take too long, we
> can always introduce a kind of __kmem_cache_shrink batching so that this
> method would only be called once per one cgroup destruction (not per
> each per memcg kmem cache as it is now).
> 
> Reported-and-suggested-by: Peter Zijlstra <peterz@infradead.org>
> Signed-off-by: Vladimir Davydov <vdavydov@virtuozzo.com>

Thanks!

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>

  reply	other threads:[~2016-04-01 15:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-01 12:30 [PATCH] mm: slub: replace kick_all_cpus_sync with synchronize_sched in kmem_cache_shrink Vladimir Davydov
2016-04-01 15:48 ` Peter Zijlstra [this message]
2016-04-06 11:56 ` Michal Hocko

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=20160401154803.GL3448@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=hannes@cmpxchg.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --cc=vdavydov@virtuozzo.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