From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f71.google.com (mail-lf0-f71.google.com [209.85.215.71]) by kanga.kvack.org (Postfix) with ESMTP id 09BE76B0279 for ; Tue, 6 Jun 2017 09:43:21 -0400 (EDT) Received: by mail-lf0-f71.google.com with SMTP id b65so18828822lfh.8 for ; Tue, 06 Jun 2017 06:43:20 -0700 (PDT) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com. [45.249.212.189]) by mx.google.com with ESMTPS id n16si5501961lje.79.2017.06.06.06.43.18 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 06 Jun 2017 06:43:19 -0700 (PDT) Message-ID: <5936B098.6020807@huawei.com> Date: Tue, 6 Jun 2017 21:39:36 +0800 From: zhong jiang MIME-Version: 1.0 Subject: double call identical release when there is a race hitting Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko , Vlastimil Babka , David Rientjes , Hugh Dickins , Oleg Nesterov Cc: Linux Memory Management List , LKML , Xishi Qiu 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751454AbdFFNkI (ORCPT ); Tue, 6 Jun 2017 09:40:08 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:7383 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751345AbdFFNkG (ORCPT ); Tue, 6 Jun 2017 09:40:06 -0400 Message-ID: <5936B098.6020807@huawei.com> Date: Tue, 6 Jun 2017 21:39:36 +0800 From: zhong jiang User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Michal Hocko , Vlastimil Babka , "David Rientjes" , Hugh Dickins , "Oleg Nesterov" CC: Linux Memory Management List , LKML , Xishi Qiu Subject: double call identical release when there is a race hitting Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.29.68] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020205.5936B0AE.0216,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 8c7ac5238d983f99742595c8702c64db Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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