From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751884AbdECHXq (ORCPT ); Wed, 3 May 2017 03:23:46 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:59550 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751042AbdECHXl (ORCPT ); Wed, 3 May 2017 03:23:41 -0400 Subject: Re: [RFC v3 05/17] RCU free VMAs To: Matthew Wilcox References: <1493308376-23851-1-git-send-email-ldufour@linux.vnet.ibm.com> <1493308376-23851-6-git-send-email-ldufour@linux.vnet.ibm.com> <20170430050529.GH27790@bombadil.infradead.org> Cc: paulmck@linux.vnet.ibm.com, peterz@infradead.org, akpm@linux-foundation.org, kirill@shutemov.name, ak@linux.intel.com, mhocko@kernel.org, dave@stgolabs.net, jack@suse.cz, linux-kernel@vger.kernel.org, linux-mm@kvack.org, haren@linux.vnet.ibm.com, khandual@linux.vnet.ibm.com, npiggin@gmail.com, bsingharora@gmail.com From: Laurent Dufour Date: Wed, 3 May 2017 09:23:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170430050529.GH27790@bombadil.infradead.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17050307-0008-0000-0000-000004398CB3 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17050307-0009-0000-0000-00001D814D92 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-05-03_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705030141 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30/04/2017 07:05, Matthew Wilcox wrote: > On Thu, Apr 27, 2017 at 05:52:44PM +0200, Laurent Dufour wrote: >> +static inline bool vma_is_dead(struct vm_area_struct *vma, unsigned int sequence) >> +{ >> + int ret = RB_EMPTY_NODE(&vma->vm_rb); >> + unsigned seq = ACCESS_ONCE(vma->vm_sequence.sequence); >> + >> + /* >> + * Matches both the wmb in write_seqlock_{begin,end}() and >> + * the wmb in vma_rb_erase(). >> + */ >> + smp_rmb(); >> + >> + return ret || seq != sequence; >> +} > > Hang on, this isn't vma_is_dead(). This is vma_has_changed() (possibly > from live to dead, but also possibly grown or shrunk; see your earlier > patch). This makes sense. Thanks, Laurent