From: Vladimir Davydov <vdavydov-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
To: Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
Cc: Michal Hocko <mhocko-AlSwsSmVLrQ@public.gmane.org>,
linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [RFC PATCH] mm: memcontrol: reign in CONFIG space madness
Date: Thu, 10 Dec 2015 14:38:07 +0300 [thread overview]
Message-ID: <20151210113807.GW11488@esperanza> (raw)
In-Reply-To: <20151209203004.GA5820-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
On Wed, Dec 09, 2015 at 03:30:04PM -0500, Johannes Weiner wrote:
> there has been quite a bit of trouble that stems from dividing our
> CONFIG space and having to provide real code and dummy functions
> correctly in all possible combinations. This is amplified by having
> the legacy mode and the cgroup2 mode in the same file sharing code.
>
> The socket memory and kmem accounting series is a nightmare in that
> respect, and I'm still in the process of sorting it out. But no matter
> what the outcome there is going to be, what do you think about getting
> rid of the CONFIG_MEMCG[_LEGACY]_KMEM and CONFIG_INET stuff?
>
> Because they end up saving very little and it doesn't seem worth the
> trouble. CONFIG_MEMCG_LEGACY_KMEM basically allows not compiling the
> interface structures and the limit updating function. Everything else
> is included anyway because of cgroup2. And CONFIG_INET also only saves
> a page_counter and two words in struct mem_cgroup, as well as the tiny
> socket-specific charge and uncharge wrappers that nobody would call.
>
> Would you be opposed to getting rid of them to simplify things?
That's exactly what I was thinking about while cooking the patch which
would get rid of tcp_memcontrol.c, but I was afraid I would be turned
down flat, so I dopped the idea :-)
So I'm all for this change. Actually, we already follow the trend when
we define kmem and memsw counters even if MEMCG_KMEM/MEMCG_SWAP is
disabled, and that's reasonable, because wrapping them in ifdefs would
make the code look like hell.
Besides, !CONFIG_INET && CONFIG_MEMCG looks exotic. I doubt such a
configuration exists in real life.
...
> @@ -1040,22 +1040,6 @@ config MEMCG_SWAP_ENABLED
> For those who want to have the feature enabled by default should
> select this option (if, for some reason, they need to disable it
> then swapaccount=0 does the trick).
> -config MEMCG_LEGACY_KMEM
> - bool "Legacy Memory Resource Controller Kernel Memory accounting"
> - depends on MEMCG
> - depends on SLUB || SLAB
> - help
> - The Kernel Memory extension for Memory Resource Controller can limit
> - the amount of memory used by kernel objects in the system. Those are
> - fundamentally different from the entities handled by the standard
> - Memory Controller, which are page-based, and can be swapped. Users of
> - the kmem extension can use it to guarantee that no group of processes
> - will ever exhaust kernel resources alone.
> -
> - This option affects the ORIGINAL cgroup interface. The cgroup2 memory
> - controller includes important in-kernel memory consumers per default.
> -
> - If you're using cgroup2, say N.
Hmm, should we hide memory.kmem.* files if this option is disabled?
Probably, but it won't do anything bad if we don't.
From a quick glance, the patch looks good to me.
Thanks,
Vladimir
WARNING: multiple messages have this Message-ID (diff)
From: Vladimir Davydov <vdavydov@virtuozzo.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>,
linux-mm@kvack.org, cgroups@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] mm: memcontrol: reign in CONFIG space madness
Date: Thu, 10 Dec 2015 14:38:07 +0300 [thread overview]
Message-ID: <20151210113807.GW11488@esperanza> (raw)
In-Reply-To: <20151209203004.GA5820@cmpxchg.org>
On Wed, Dec 09, 2015 at 03:30:04PM -0500, Johannes Weiner wrote:
> there has been quite a bit of trouble that stems from dividing our
> CONFIG space and having to provide real code and dummy functions
> correctly in all possible combinations. This is amplified by having
> the legacy mode and the cgroup2 mode in the same file sharing code.
>
> The socket memory and kmem accounting series is a nightmare in that
> respect, and I'm still in the process of sorting it out. But no matter
> what the outcome there is going to be, what do you think about getting
> rid of the CONFIG_MEMCG[_LEGACY]_KMEM and CONFIG_INET stuff?
>
> Because they end up saving very little and it doesn't seem worth the
> trouble. CONFIG_MEMCG_LEGACY_KMEM basically allows not compiling the
> interface structures and the limit updating function. Everything else
> is included anyway because of cgroup2. And CONFIG_INET also only saves
> a page_counter and two words in struct mem_cgroup, as well as the tiny
> socket-specific charge and uncharge wrappers that nobody would call.
>
> Would you be opposed to getting rid of them to simplify things?
That's exactly what I was thinking about while cooking the patch which
would get rid of tcp_memcontrol.c, but I was afraid I would be turned
down flat, so I dopped the idea :-)
So I'm all for this change. Actually, we already follow the trend when
we define kmem and memsw counters even if MEMCG_KMEM/MEMCG_SWAP is
disabled, and that's reasonable, because wrapping them in ifdefs would
make the code look like hell.
Besides, !CONFIG_INET && CONFIG_MEMCG looks exotic. I doubt such a
configuration exists in real life.
...
> @@ -1040,22 +1040,6 @@ config MEMCG_SWAP_ENABLED
> For those who want to have the feature enabled by default should
> select this option (if, for some reason, they need to disable it
> then swapaccount=0 does the trick).
> -config MEMCG_LEGACY_KMEM
> - bool "Legacy Memory Resource Controller Kernel Memory accounting"
> - depends on MEMCG
> - depends on SLUB || SLAB
> - help
> - The Kernel Memory extension for Memory Resource Controller can limit
> - the amount of memory used by kernel objects in the system. Those are
> - fundamentally different from the entities handled by the standard
> - Memory Controller, which are page-based, and can be swapped. Users of
> - the kmem extension can use it to guarantee that no group of processes
> - will ever exhaust kernel resources alone.
> -
> - This option affects the ORIGINAL cgroup interface. The cgroup2 memory
> - controller includes important in-kernel memory consumers per default.
> -
> - If you're using cgroup2, say N.
Hmm, should we hide memory.kmem.* files if this option is disabled?
Probably, but it won't do anything bad if we don't.
>From a quick glance, the patch looks good to me.
Thanks,
Vladimir
--
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: Vladimir Davydov <vdavydov@virtuozzo.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>, <linux-mm@kvack.org>,
<cgroups@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH] mm: memcontrol: reign in CONFIG space madness
Date: Thu, 10 Dec 2015 14:38:07 +0300 [thread overview]
Message-ID: <20151210113807.GW11488@esperanza> (raw)
In-Reply-To: <20151209203004.GA5820@cmpxchg.org>
On Wed, Dec 09, 2015 at 03:30:04PM -0500, Johannes Weiner wrote:
> there has been quite a bit of trouble that stems from dividing our
> CONFIG space and having to provide real code and dummy functions
> correctly in all possible combinations. This is amplified by having
> the legacy mode and the cgroup2 mode in the same file sharing code.
>
> The socket memory and kmem accounting series is a nightmare in that
> respect, and I'm still in the process of sorting it out. But no matter
> what the outcome there is going to be, what do you think about getting
> rid of the CONFIG_MEMCG[_LEGACY]_KMEM and CONFIG_INET stuff?
>
> Because they end up saving very little and it doesn't seem worth the
> trouble. CONFIG_MEMCG_LEGACY_KMEM basically allows not compiling the
> interface structures and the limit updating function. Everything else
> is included anyway because of cgroup2. And CONFIG_INET also only saves
> a page_counter and two words in struct mem_cgroup, as well as the tiny
> socket-specific charge and uncharge wrappers that nobody would call.
>
> Would you be opposed to getting rid of them to simplify things?
That's exactly what I was thinking about while cooking the patch which
would get rid of tcp_memcontrol.c, but I was afraid I would be turned
down flat, so I dopped the idea :-)
So I'm all for this change. Actually, we already follow the trend when
we define kmem and memsw counters even if MEMCG_KMEM/MEMCG_SWAP is
disabled, and that's reasonable, because wrapping them in ifdefs would
make the code look like hell.
Besides, !CONFIG_INET && CONFIG_MEMCG looks exotic. I doubt such a
configuration exists in real life.
...
> @@ -1040,22 +1040,6 @@ config MEMCG_SWAP_ENABLED
> For those who want to have the feature enabled by default should
> select this option (if, for some reason, they need to disable it
> then swapaccount=0 does the trick).
> -config MEMCG_LEGACY_KMEM
> - bool "Legacy Memory Resource Controller Kernel Memory accounting"
> - depends on MEMCG
> - depends on SLUB || SLAB
> - help
> - The Kernel Memory extension for Memory Resource Controller can limit
> - the amount of memory used by kernel objects in the system. Those are
> - fundamentally different from the entities handled by the standard
> - Memory Controller, which are page-based, and can be swapped. Users of
> - the kmem extension can use it to guarantee that no group of processes
> - will ever exhaust kernel resources alone.
> -
> - This option affects the ORIGINAL cgroup interface. The cgroup2 memory
> - controller includes important in-kernel memory consumers per default.
> -
> - If you're using cgroup2, say N.
Hmm, should we hide memory.kmem.* files if this option is disabled?
Probably, but it won't do anything bad if we don't.
>From a quick glance, the patch looks good to me.
Thanks,
Vladimir
next prev parent reply other threads:[~2015-12-10 11:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-09 20:30 [RFC PATCH] mm: memcontrol: reign in CONFIG space madness Johannes Weiner
2015-12-09 20:30 ` Johannes Weiner
2015-12-09 20:30 ` Johannes Weiner
[not found] ` <20151209203004.GA5820-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2015-12-10 11:38 ` Vladimir Davydov [this message]
2015-12-10 11:38 ` Vladimir Davydov
2015-12-10 11:38 ` Vladimir Davydov
2015-12-10 13:40 ` Michal Hocko
2015-12-10 13:40 ` Michal Hocko
2015-12-10 15:06 ` Johannes Weiner
2015-12-10 15:06 ` Johannes Weiner
[not found] ` <20151210150650.GA1431-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2015-12-10 16:12 ` Michal Hocko
2015-12-10 16:12 ` Michal Hocko
2015-12-10 16:12 ` Michal Hocko
2015-12-10 17:15 ` Johannes Weiner
2015-12-10 17:15 ` Johannes Weiner
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=20151210113807.GW11488@esperanza \
--to=vdavydov-5hdwgun5lf+gspxsjd1c4w@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
--cc=mhocko-AlSwsSmVLrQ@public.gmane.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.