From: Johannes Weiner <hannes@cmpxchg.org>
To: Hugh Dickins <hughd@google.com>
Cc: Vladimir Davydov <vdavydov@virtuozzo.com>,
"Kirill A. Shutemov" <kirill@shutemov.name>,
Andrew Morton <akpm@linux-foundation.org>,
Michal Hocko <mhocko@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] memcg: simplify and inline __mem_cgroup_from_kmem
Date: Fri, 16 Oct 2015 15:19:22 -0700 [thread overview]
Message-ID: <20151016221922.GA4355@cmpxchg.org> (raw)
In-Reply-To: <alpine.LSU.2.11.1510161458280.26747@eggly.anvils>
On Fri, Oct 16, 2015 at 03:12:23PM -0700, Hugh Dickins wrote:
> --- 4035m/mm/list_lru.c 2015-10-15 15:26:59.835572128 -0700
> +++ 4035M/mm/list_lru.c 2015-10-16 03:11:51.000000000 -0700
> @@ -63,6 +63,16 @@ list_lru_from_memcg_idx(struct list_lru_
> return &nlru->lru;
> }
>
> +static __always_inline struct mem_cgroup *mem_cgroup_from_kmem(void *ptr)
> +{
> + struct page *page;
> +
> + if (!memcg_kmem_enabled())
> + return NULL;
> + page = virt_to_head_page(ptr);
> + return page->mem_cgroup;
> +}
> +
> static inline struct list_lru_one *
> list_lru_from_kmem(struct list_lru_node *nlru, void *ptr)
> {
I like this better than the mm.h include, too.
--
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>
WARNING: multiple messages have this Message-ID (diff)
From: Johannes Weiner <hannes@cmpxchg.org>
To: Hugh Dickins <hughd@google.com>
Cc: Vladimir Davydov <vdavydov@virtuozzo.com>,
"Kirill A. Shutemov" <kirill@shutemov.name>,
Andrew Morton <akpm@linux-foundation.org>,
Michal Hocko <mhocko@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] memcg: simplify and inline __mem_cgroup_from_kmem
Date: Fri, 16 Oct 2015 15:19:22 -0700 [thread overview]
Message-ID: <20151016221922.GA4355@cmpxchg.org> (raw)
In-Reply-To: <alpine.LSU.2.11.1510161458280.26747@eggly.anvils>
On Fri, Oct 16, 2015 at 03:12:23PM -0700, Hugh Dickins wrote:
> --- 4035m/mm/list_lru.c 2015-10-15 15:26:59.835572128 -0700
> +++ 4035M/mm/list_lru.c 2015-10-16 03:11:51.000000000 -0700
> @@ -63,6 +63,16 @@ list_lru_from_memcg_idx(struct list_lru_
> return &nlru->lru;
> }
>
> +static __always_inline struct mem_cgroup *mem_cgroup_from_kmem(void *ptr)
> +{
> + struct page *page;
> +
> + if (!memcg_kmem_enabled())
> + return NULL;
> + page = virt_to_head_page(ptr);
> + return page->mem_cgroup;
> +}
> +
> static inline struct list_lru_one *
> list_lru_from_kmem(struct list_lru_node *nlru, void *ptr)
> {
I like this better than the mm.h include, too.
next prev parent reply other threads:[~2015-10-16 22:19 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-04 22:21 [PATCH 1/3] memcg: simplify charging kmem pages Vladimir Davydov
2015-10-04 22:21 ` Vladimir Davydov
2015-10-04 22:21 ` [PATCH 2/3] memcg: unify slab and other kmem pages charging Vladimir Davydov
2015-10-04 22:21 ` Vladimir Davydov
2015-10-08 15:10 ` Michal Hocko
2015-10-08 15:10 ` Michal Hocko
2015-10-17 0:19 ` Johannes Weiner
2015-10-17 0:19 ` Johannes Weiner
2015-10-17 15:05 ` Vladimir Davydov
2015-10-17 15:05 ` Vladimir Davydov
2015-10-19 8:09 ` Michal Hocko
2015-10-19 8:09 ` Michal Hocko
2015-10-04 22:21 ` [PATCH 3/3] memcg: simplify and inline __mem_cgroup_from_kmem Vladimir Davydov
2015-10-04 22:21 ` Vladimir Davydov
2015-10-08 15:13 ` Michal Hocko
2015-10-08 15:13 ` Michal Hocko
2015-10-16 13:17 ` Kirill A. Shutemov
2015-10-16 13:17 ` Kirill A. Shutemov
2015-10-16 13:51 ` Vladimir Davydov
2015-10-16 13:51 ` Vladimir Davydov
2015-10-16 22:12 ` Hugh Dickins
2015-10-16 22:19 ` Johannes Weiner [this message]
2015-10-16 22:19 ` Johannes Weiner
2015-10-16 22:21 ` Andrew Morton
2015-10-16 22:21 ` Andrew Morton
2015-10-17 14:58 ` Vladimir Davydov
2015-10-17 14:58 ` Vladimir Davydov
2015-10-19 8:08 ` Michal Hocko
2015-10-19 8:08 ` Michal Hocko
2015-10-16 14:36 ` Michal Hocko
2015-10-16 14:36 ` Michal Hocko
2015-10-08 14:40 ` [PATCH 1/3] memcg: simplify charging kmem pages Michal Hocko
2015-10-08 14:40 ` 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=20151016221922.GA4355@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=hughd@google.com \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--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 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.