Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1463969
| From | Johannes Weiner <hannes@cmpxchg.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: uprobes: memory leak in enable/disable loop |
| Date | 2016-08-16 19:50 +0200 |
| Message-ID | <s6QEV-64O-1@gated-at.bofh.it> (permalink) |
| References | <s6x9g-1ZP-9@gated-at.bofh.it> <s6NnH-49C-1@gated-at.bofh.it> <s6Nxn-4cZ-1@gated-at.bofh.it> <s6NH3-4gh-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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+
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
uprobes: memory leak in enable/disable loop Brenden Blanco <bblanco@plumgrid.com> - 2016-08-15 23:00 +0200
Re: uprobes: memory leak in enable/disable loop Oleg Nesterov <oleg@redhat.com> - 2016-08-16 16:20 +0200
Re: uprobes: memory leak in enable/disable loop Oleg Nesterov <oleg@redhat.com> - 2016-08-16 16:30 +0200
Re: uprobes: memory leak in enable/disable loop Michal Hocko <mhocko@kernel.org> - 2016-08-16 16:40 +0200
Re: uprobes: memory leak in enable/disable loop Oleg Nesterov <oleg@redhat.com> - 2016-08-16 16:40 +0200
Re: uprobes: memory leak in enable/disable loop Brenden Blanco <bblanco@plumgrid.com> - 2016-08-16 19:00 +0200
[PATCH 0/2] uprobes: memory leak in enable/disable loop Oleg Nesterov <oleg@redhat.com> - 2016-08-17 17:40 +0200
[PATCH 1/2] uprobes: fix the memcg accounting Oleg Nesterov <oleg@redhat.com> - 2016-08-17 17:40 +0200
[tip:perf/urgent] uprobes: Fix the memcg accounting tip-bot for Oleg Nesterov <tipbot@zytor.com> - 2016-08-18 10:20 +0200
[PATCH 2/2] uprobes: rename the "struct page *" args of __replace_page() Oleg Nesterov <oleg@redhat.com> - 2016-08-17 17:50 +0200
[tip:perf/core] uprobes: Rename the "struct page *" args of __replace_page() tip-bot for Oleg Nesterov <tipbot@zytor.com> - 2016-08-18 13:00 +0200
Re: uprobes: memory leak in enable/disable loop Johannes Weiner <hannes@cmpxchg.org> - 2016-08-16 19:50 +0200
csiph-web