From: Julia Lawall <julia.lawall@lip6.fr>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Julia Lawall <julia.lawall@lip6.fr>,
zhong jiang <zhongjiang@huawei.com>,
akpm@linux-foundation.org, kirill.shutemov@linux.intel.com,
hannes@cmpxchg.org, mgorman@techsingularity.net,
linux-mm@kvack.org, kbuild-all@01.org
Subject: Re: [PATCH v2] mm: fix the memory leak after collapsing the huge page fails (fwd)
Date: Wed, 10 May 2017 14:50:04 +0800 (SGT) [thread overview]
Message-ID: <alpine.DEB.2.20.1705101448580.20213@hadrien> (raw)
In-Reply-To: <951ad516-b8da-8277-d4ad-141ba3b47bec@suse.cz>
On Wed, 10 May 2017, Vlastimil Babka wrote:
> On 05/10/2017 08:25 AM, Julia Lawall wrote:
> >
> >
> > On Wed, 10 May 2017, zhong jiang wrote:
> >
> >> On 2017/5/9 23:43, Julia Lawall wrote:
> >>> Hello,
> >>>
> >>> I don't know if there is a bug here, but it could e worth checking on. If
> >>> the loop on line 1481 is executed, page will not be NULL at the out label
> >>> on line 1560. Instead it will have a dummy value. Perhaps the value of
> >>> result keeps the if at the out label from being taken.
> >>>
> >>> julia
> >> Hi, Julia
> >>
> >> it has no memory leak. so my initial thought is not correct. but I do not know you mean.
> >> The page is local variable. it aybe a dummy value. but it should not cause any issue.
> >> is it right? or I miss something.
> >
> > I had first been thinking that the if branch was referencing page. In
> > that case, if page were a dummy value, then there could be a problem. But
> > now I see that the branch does not refer to page. So the question is
> > just, if the loop on lines 1481-1491 is executed, is it correct to execute
> > the code put_page(new_page)? Or will result be SCAN_SUCCEEDED in that
> > case?
>
> That loop is under "if (result == SCAN_SUCCEED)", so yeah. It also ends
> with "*hpage = NULL;", so the put_page(hpage) in khugepaged_do_scan()
> won't apply. I see no problem besides the very non-obvious code :/
OK, thanks for the clarification.
julia
--
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>
prev parent reply other threads:[~2017-05-10 6:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-09 15:43 Julia Lawall
2017-05-10 5:55 ` zhong jiang
2017-05-10 6:25 ` Julia Lawall
2017-05-10 6:48 ` Vlastimil Babka
2017-05-10 6:50 ` Julia Lawall [this message]
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=alpine.DEB.2.20.1705101448580.20213@hadrien \
--to=julia.lawall@lip6.fr \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=kbuild-all@01.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=vbabka@suse.cz \
--cc=zhongjiang@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox