From: Vladimir Davydov <vdavydov@virtuozzo.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
stable@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/3] mm: memcontrol: fix swap counter leak on swapout from offline cgroup
Date: Wed, 3 Aug 2016 17:31:17 +0300 [thread overview]
Message-ID: <20160803143117.GK13263@esperanza> (raw)
In-Reply-To: <20160803141203.GA12838@cmpxchg.org>
On Wed, Aug 03, 2016 at 10:12:03AM -0400, Johannes Weiner wrote:
> On Wed, Aug 03, 2016 at 02:46:40PM +0300, Vladimir Davydov wrote:
...
> > diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> > index 1c0aa59fd333..8c8e68becee9 100644
> > --- a/mm/memcontrol.c
> > +++ b/mm/memcontrol.c
> > @@ -4044,7 +4044,7 @@ static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg)
> > * The root cgroup cannot be destroyed, so it's refcount must
> > * always be >= 1.
> > */
> > - if (memcg == root_mem_cgroup) {
> > + if (WARN_ON_ONCE(memcg == root_mem_cgroup)) {
> > VM_BUG_ON(1);
> > break;
> > }
>
> The WARN_ON_ONCE() makes sense to me. But if we warn on all configs
> anyway, the VM_BUG_ON() doesn't provide any additional value. Anybody
> who is testing new code and enables DEBUG_VM should notice a warning
> without requiring the kernel to blow up in their face; it also allows
> them to check other state that is not necessarily available in BUG().
Personally, I prefer to crash the kernel as early as possible when
debugging to get vmcore for further investigation. Judging by
mem_cgroup_update_lru_size(), I'm not alone.
--
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@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
<stable@vger.kernel.org>, <linux-mm@kvack.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/3] mm: memcontrol: fix swap counter leak on swapout from offline cgroup
Date: Wed, 3 Aug 2016 17:31:17 +0300 [thread overview]
Message-ID: <20160803143117.GK13263@esperanza> (raw)
In-Reply-To: <20160803141203.GA12838@cmpxchg.org>
On Wed, Aug 03, 2016 at 10:12:03AM -0400, Johannes Weiner wrote:
> On Wed, Aug 03, 2016 at 02:46:40PM +0300, Vladimir Davydov wrote:
...
> > diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> > index 1c0aa59fd333..8c8e68becee9 100644
> > --- a/mm/memcontrol.c
> > +++ b/mm/memcontrol.c
> > @@ -4044,7 +4044,7 @@ static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg)
> > * The root cgroup cannot be destroyed, so it's refcount must
> > * always be >= 1.
> > */
> > - if (memcg == root_mem_cgroup) {
> > + if (WARN_ON_ONCE(memcg == root_mem_cgroup)) {
> > VM_BUG_ON(1);
> > break;
> > }
>
> The WARN_ON_ONCE() makes sense to me. But if we warn on all configs
> anyway, the VM_BUG_ON() doesn't provide any additional value. Anybody
> who is testing new code and enables DEBUG_VM should notice a warning
> without requiring the kernel to blow up in their face; it also allows
> them to check other state that is not necessarily available in BUG().
Personally, I prefer to crash the kernel as early as possible when
debugging to get vmcore for further investigation. Judging by
mem_cgroup_update_lru_size(), I'm not alone.
WARNING: multiple messages have this Message-ID (diff)
From: Vladimir Davydov <vdavydov@virtuozzo.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
<stable@vger.kernel.org>, <linux-mm@kvack.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/3] mm: memcontrol: fix swap counter leak on swapout from offline cgroup
Date: Wed, 3 Aug 2016 17:31:17 +0300 [thread overview]
Message-ID: <20160803143117.GK13263@esperanza> (raw)
In-Reply-To: <20160803141203.GA12838@cmpxchg.org>
On Wed, Aug 03, 2016 at 10:12:03AM -0400, Johannes Weiner wrote:
> On Wed, Aug 03, 2016 at 02:46:40PM +0300, Vladimir Davydov wrote:
...
> > diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> > index 1c0aa59fd333..8c8e68becee9 100644
> > --- a/mm/memcontrol.c
> > +++ b/mm/memcontrol.c
> > @@ -4044,7 +4044,7 @@ static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg)
> > * The root cgroup cannot be destroyed, so it's refcount must
> > * always be >= 1.
> > */
> > - if (memcg == root_mem_cgroup) {
> > + if (WARN_ON_ONCE(memcg == root_mem_cgroup)) {
> > VM_BUG_ON(1);
> > break;
> > }
>
> The WARN_ON_ONCE() makes sense to me. But if we warn on all configs
> anyway, the VM_BUG_ON() doesn't provide any additional value. Anybody
> who is testing new code and enables DEBUG_VM should notice a warning
> without requiring the kernel to blow up in their face; it also allows
> them to check other state that is not necessarily available in BUG().
Personally, I prefer to crash the kernel as early as possible when
debugging to get vmcore for further investigation. Judging by
mem_cgroup_update_lru_size(), I'm not alone.
--
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>
next prev parent reply other threads:[~2016-08-03 14:31 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-02 15:00 [PATCH v2 1/3] mm: memcontrol: fix swap counter leak on swapout from offline cgroup Vladimir Davydov
2016-08-02 15:00 ` Vladimir Davydov
2016-08-02 15:00 ` Vladimir Davydov
2016-08-02 15:00 ` [PATCH v2 2/3] mm: memcontrol: fix memcg id ref counter on swap charge move Vladimir Davydov
2016-08-02 15:00 ` Vladimir Davydov
2016-08-02 15:00 ` Vladimir Davydov
2016-08-02 17:22 ` Johannes Weiner
2016-08-02 17:22 ` Johannes Weiner
2016-08-02 15:00 ` [PATCH v2 3/3] mm: memcontrol: add sanity checks for memcg->id.ref on get/put Vladimir Davydov
2016-08-02 15:00 ` Vladimir Davydov
2016-08-02 16:01 ` Michal Hocko
2016-08-02 16:01 ` Michal Hocko
2016-08-02 17:27 ` Johannes Weiner
2016-08-02 17:27 ` Johannes Weiner
2016-08-02 16:00 ` [PATCH v2 1/3] mm: memcontrol: fix swap counter leak on swapout from offline cgroup Michal Hocko
2016-08-02 16:00 ` Michal Hocko
2016-08-02 17:33 ` Johannes Weiner
2016-08-02 17:33 ` Johannes Weiner
2016-08-02 20:31 ` Michal Hocko
2016-08-02 20:31 ` Michal Hocko
2016-08-03 10:06 ` Vladimir Davydov
2016-08-03 10:06 ` Vladimir Davydov
2016-08-03 10:06 ` Vladimir Davydov
2016-08-03 9:50 ` Vladimir Davydov
2016-08-03 9:50 ` Vladimir Davydov
2016-08-03 9:50 ` Vladimir Davydov
2016-08-03 11:09 ` Michal Hocko
2016-08-03 11:09 ` Michal Hocko
2016-08-03 11:46 ` Vladimir Davydov
2016-08-03 11:46 ` Vladimir Davydov
2016-08-03 11:46 ` Vladimir Davydov
2016-08-03 12:00 ` Michal Hocko
2016-08-03 12:00 ` Michal Hocko
2016-08-03 14:12 ` Johannes Weiner
2016-08-03 14:12 ` Johannes Weiner
2016-08-03 14:31 ` Vladimir Davydov [this message]
2016-08-03 14:31 ` Vladimir Davydov
2016-08-03 14:31 ` Vladimir Davydov
2016-08-02 17:21 ` Johannes Weiner
2016-08-02 17:21 ` 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=20160803143117.GK13263@esperanza \
--to=vdavydov@virtuozzo.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=stable@vger.kernel.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.