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

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?

Thanks
zhongjiang

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

WARNING: multiple messages have this Message-ID (diff)
From: zhong jiang <zhongjiang@huawei.com>
To: Michal Hocko <mhocko@kernel.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	"David Rientjes" <rientjes@google.com>,
	Hugh Dickins <hughd@google.com>,
	"Oleg Nesterov" <oleg@redhat.com>
Cc: Linux Memory Management List <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Xishi Qiu <qiuxishi@huawei.com>
Subject: double call identical release when there is a race hitting
Date: Tue, 6 Jun 2017 21:39:36 +0800	[thread overview]
Message-ID: <5936B098.6020807@huawei.com> (raw)

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?

Thanks
zhongjiang

             reply	other threads:[~2017-06-06 13:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-06 13:39 zhong jiang [this message]
2017-06-06 13:39 ` double call identical release when there is a race hitting zhong jiang
2017-06-06 15:56 ` Oleg Nesterov
2017-06-06 15:56   ` Oleg Nesterov
2017-06-07  2:20   ` zhong jiang
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=5936B098.6020807@huawei.com \
    --to=zhongjiang@huawei.com \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=oleg@redhat.com \
    --cc=qiuxishi@huawei.com \
    --cc=rientjes@google.com \
    --cc=vbabka@suse.cz \
    /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.