From: Andrew Morton <akpm@linux-foundation.org>
To: Catalin Marinas <catalin.marinas@arm.com>,
Vinayak Menon <vinmenon@codeaurora.org>,
linux-mm@kvack.org
Subject: Re: [PATCH] mm: kmemleak: wait for scan completion before disabling free
Date: Mon, 26 Mar 2018 12:27:50 -0700 [thread overview]
Message-ID: <20180326122750.a41634c409f29b9d411b5d33@linux-foundation.org> (raw)
In-Reply-To: <20180326122611.acbfe1bfe6f7c1792b42a3a7@linux-foundation.org>
On Mon, 26 Mar 2018 12:26:11 -0700 Andrew Morton <akpm@linux-foundation.org> wrote:
> >
> > It looks fine to me. Maybe Andrew can pick it up.
> >
> > Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
>
> Well, the comment says:
>
> /*
> * Stop the automatic memory scanning thread. This function must be called
> * with the scan_mutex held.
> */
> static void stop_scan_thread(void)
>
>
> So shouldn't we do it this way?
If "yes" then could someone please runtime test this?
> --- a/mm/kmemleak.c~mm-kmemleak-wait-for-scan-completion-before-disabling-free-fix
> +++ a/mm/kmemleak.c
> @@ -1919,9 +1919,9 @@ static void __kmemleak_do_cleanup(void)
> */
> static void kmemleak_do_cleanup(struct work_struct *work)
> {
> + mutex_lock(&scan_mutex);
> stop_scan_thread();
>
> - mutex_lock(&scan_mutex);
> /*
> * Once it is made sure that kmemleak_scan has stopped, it is safe to no
> * longer track object freeing. Ordering of the scan thread stopping and
> _
>
next prev parent reply other threads:[~2018-03-26 19:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-26 11:23 Vinayak Menon
2018-03-26 15:44 ` Catalin Marinas
2018-03-26 19:26 ` Andrew Morton
2018-03-26 19:27 ` Andrew Morton [this message]
2018-03-27 5:29 ` Vinayak Menon
2018-03-27 17:49 ` Catalin Marinas
2018-03-28 6:51 ` Vinayak Menon
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=20180326122750.a41634c409f29b9d411b5d33@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=catalin.marinas@arm.com \
--cc=linux-mm@kvack.org \
--cc=vinmenon@codeaurora.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox