From: Johannes Weiner <hannes@cmpxchg.org>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Brenden Blanco <bblanco@plumgrid.com>,
Michal Hocko <mhocko@kernel.org>,
Vladimir Davydov <vdavydov@virtuozzo.com>,
linux-kernel@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Alexei Starovoitov <alexei.starovoitov@gmail.com>
Subject: Re: uprobes: memory leak in enable/disable loop
Date: Tue, 16 Aug 2016 13:36:03 -0400 [thread overview]
Message-ID: <20160816173603.GA18078@cmpxchg.org> (raw)
In-Reply-To: <20160816143407.GC17006@redhat.com>
On Tue, Aug 16, 2016 at 04:34:08PM +0200, Oleg Nesterov wrote:
> @@ -172,8 +172,10 @@ static int __replace_page(struct vm_area
> mmu_notifier_invalidate_range_start(mm, mmun_start, mmun_end);
> err = -EAGAIN;
> ptep = page_check_address(page, mm, addr, &ptl, 0);
> - if (!ptep)
> + if (!ptep) {
> + mem_cgroup_cancel_charge(kpage, memcg, false);
> goto unlock;
> + }
>
> get_page(kpage);
> page_add_new_anon_rmap(kpage, vma, addr, false);
> @@ -200,7 +202,6 @@ static int __replace_page(struct vm_area
>
> err = 0;
> unlock:
> - mem_cgroup_cancel_charge(kpage, memcg, false);
Ouch. I must have mistaken this for an exclusive error path.
The patch looks good, thank you.
Reviewed-by: Johannes Weiner <hannes@cmpxchg.org>
Fixes: 00501b531c47 ("mm: memcontrol: rewrite charge API")
Cc: stable@vger.kernel.org # 3.17+
next prev parent reply other threads:[~2016-08-16 17:40 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-15 20:58 uprobes: memory leak in enable/disable loop Brenden Blanco
2016-08-16 14:13 ` Oleg Nesterov
2016-08-16 14:25 ` Oleg Nesterov
2016-08-16 14:34 ` Oleg Nesterov
2016-08-16 16:55 ` Brenden Blanco
2016-08-17 15:36 ` [PATCH 0/2] " Oleg Nesterov
2016-08-17 15:36 ` [PATCH 1/2] uprobes: fix the memcg accounting Oleg Nesterov
2016-08-18 8:07 ` [tip:perf/urgent] uprobes: Fix " tip-bot for Oleg Nesterov
2016-08-17 15:37 ` [PATCH 2/2] uprobes: rename the "struct page *" args of __replace_page() Oleg Nesterov
2016-08-18 10:49 ` [tip:perf/core] uprobes: Rename " tip-bot for Oleg Nesterov
2016-08-16 17:36 ` Johannes Weiner [this message]
2016-08-16 14:37 ` uprobes: memory leak in enable/disable loop 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=20160816173603.GA18078@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=alexei.starovoitov@gmail.com \
--cc=bblanco@plumgrid.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhocko@kernel.org \
--cc=mingo@redhat.com \
--cc=oleg@redhat.com \
--cc=peterz@infradead.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.