linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: zhong jiang <zhongjiang@huawei.com>
Cc: Michal Hocko <mhocko@kernel.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	David Rientjes <rientjes@google.com>,
	Hugh Dickins <hughd@google.com>,
	Linux Memory Management List <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Xishi Qiu <qiuxishi@huawei.com>
Subject: Re: double call identical release when there is a race hitting
Date: Tue, 6 Jun 2017 17:56:01 +0200	[thread overview]
Message-ID: <20170606155600.GA17705@redhat.com> (raw)
In-Reply-To: <5936B098.6020807@huawei.com>

I can't answer authoritatively, but

On 06/06, zhong jiang wrote:
>
> Hi
>
> when I review the code, I find the following scenario will lead to a race ,
> but I am not sure whether the real issue will hit or not.
>
> cpu1                                                                      cpu2
> exit_mmap                                               mmu_notifier_unregister
>    __mmu_notifier_release                                 srcu_read_lock
>             srcu_read_lock
>             mm->ops->release(mn, mm)                 mm->ops->release(mn,mm)
>            srcu_read_unlock                                         srcu_read_unlock
>
>
> obviously,  the specified mm will call identical release function when
> the related condition satisfy.  is it right?

I think you are right, this is possible, perhaps the comments should mention
this explicitly.

See the changelog in d34883d4e35c0a994e91dd847a82b4c9e0c31d83 "mm: mmu_notifier:
re-fix freed page still mapped in secondary MMU":

	"multiple ->release() callouts", we needn't care it too much ...

Oleg.

--
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>

  reply	other threads:[~2017-06-06 15:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-06 13:39 double call identical release when there is a race hitting zhong jiang
2017-06-06 15:56 ` Oleg Nesterov [this message]
2017-06-07  2:20   ` zhong jiang

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=20170606155600.GA17705@redhat.com \
    --to=oleg@redhat.com \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=qiuxishi@huawei.com \
    --cc=rientjes@google.com \
    --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;
as well as URLs for NNTP newsgroup(s).