linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Lyashkov <umka@cloudlinux.com>
To: Anatoly Stepanov <astepanov@cloudlinux.com>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org,
	vdavydov.dev@gmail.com, panda@cloudlinux.com,
	vmeshkov@cloudlinux.com
Subject: Re: [PATCH] mm: use vmalloc fallback path for certain memcg allocations
Date: Fri, 2 Dec 2016 11:19:45 +0300	[thread overview]
Message-ID: <8EB96A3D-F5B3-4358-A1A9-049866875C12@cloudlinux.com> (raw)
In-Reply-To: <1480554981-195198-1-git-send-email-astepanov@cloudlinux.com>


> 1 дек. 2016 г., в 4:16, Anatoly Stepanov <astepanov@cloudlinux.com> написал(а):
> 
> As memcg array size can be up to:
> sizeof(struct memcg_cache_array) + kmemcg_id * sizeof(void *);
> 
> where kmemcg_id can be up to MEMCG_CACHES_MAX_SIZE.
> 
> When a memcg instance count is large enough it can lead
> to high order allocations up to order 7.
> 
> The same story with memcg_lrus allocations.
> So let's work this around by utilizing vmalloc fallback path.
> 
> Signed-off-by: Anatoly Stepanov <astepanov@cloudlinux.com>
> ---
> include/linux/memcontrol.h | 16 ++++++++++++++++
> mm/list_lru.c              | 14 +++++++-------
> mm/slab_common.c           | 21 ++++++++++++++-------
> 3 files changed, 37 insertions(+), 14 deletions(-)
> 
> diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
> index 61d20c1..a281622 100644
> --- a/include/linux/memcontrol.h
> +++ b/include/linux/memcontrol.h
> @@ -29,6 +29,9 @@
> #include <linux/mmzone.h>
> #include <linux/writeback.h>
> #include <linux/page-flags.h>
> +#include <linux/vmalloc.h>
> +#include <linux/slab.h>
> +#include <linux/mm.h>
> 
> struct mem_cgroup;
> struct page;
> @@ -878,4 +881,17 @@ static inline void memcg_kmem_update_page_stat(struct page *page,
> }
> #endif /* CONFIG_MEMCG && !CONFIG_SLOB */
> 
> +static inline void memcg_free(const void *ptr)
> +{
> +	is_vmalloc_addr(ptr) ? vfree(ptr) : kfree(ptr);
> +}
please to use a kvfree() instead.


--
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-12-02  8:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-01  1:16 Anatoly Stepanov
2016-12-02  8:19 ` Alexey Lyashkov [this message]
2016-12-02  8:44 ` Vlastimil Babka
2016-12-02  9:19   ` Michal Hocko
2016-12-02  6:54     ` Anatoly Stepanov
2016-12-05  5:23       ` Michal Hocko
2016-12-02 22:09         ` Anatoly Stepanov
2016-12-06  8:47           ` Michal Hocko
2016-12-03 15:55             ` Anatoly Stepanov
2016-12-08  8:45               ` Michal Hocko
2016-12-05 14:09         ` Heiko Carstens
2016-12-05 14:19           ` Michal Hocko
2016-12-02 22:15             ` Anatoly Stepanov
2016-12-06  8:34               ` 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=8EB96A3D-F5B3-4358-A1A9-049866875C12@cloudlinux.com \
    --to=umka@cloudlinux.com \
    --cc=akpm@linux-foundation.org \
    --cc=astepanov@cloudlinux.com \
    --cc=linux-mm@kvack.org \
    --cc=panda@cloudlinux.com \
    --cc=vdavydov.dev@gmail.com \
    --cc=vmeshkov@cloudlinux.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