Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp1326918imb; Sat, 2 Mar 2019 10:52:53 -0800 (PST) X-Google-Smtp-Source: APXvYqysAgsjU9ukSmORFeICY3dWt0+UcJKJQIcDpP7yXVb/fkmU5CEUsSKyltqobDsccTjLPNDa X-Received: by 2002:a65:4203:: with SMTP id c3mr10964573pgq.271.1551552773239; Sat, 02 Mar 2019 10:52:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551552773; cv=none; d=google.com; s=arc-20160816; b=uSpX89230qPqm40jbGjPORLU+R11hbn+JnovvlzJrDfwqtdrXBhzWleasWt/o7TGa1 7o2eT5HYvudVDtMcL0zosi0wRjlevzUGfBHvQZ9ez7SEeKqYADj2cjmx4/Y6q20B36Nu jq+jFnsOMHbHTO6jECyLPqW0i1hEL3zTpK52e6GDM6v/CLmEzMsZyoIxDxUm/tn8d3xo iyqWV1TENQoYUKdIXuvVjveBeesQi1ORpzopeA3dcOdov4ox7pgyHh4YzYh360uaM/dq XnF/PamHhWEAsUOiEps60xVJMDdCKcOLIIKAk+N7PGNdcusNSzpdTa2a9NJflC3ORuGB 4txg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=p294S3ouHPUIV8PTe0QimWfREFPhgIOO+zNrdEjSyss=; b=oVzxM6P9BoQELqnsrp/+sUNF0xhRzMlPRDS7dZ2DxoXyHUIcldjpqmOXTZMQbz5uRG 63HFS1CyHfaBsPQgsikl6vwWsnKE3iMTUh5Hw6qb05YgRG3tHPNFs4OH0Mu7Q0aCKaxX cuyUd9CYbA1BGZg8nCINFmutVC2EUNHuQV6Jk9g3pC53MlAqkstpam1rJoDRggQciAVY ++1tMPaEIOKpaL1P93EuNlQz/P+K0SCLrc/wZs+kTisoVoiYKBMS2M0IJjGzSgVVrQk2 fZ/5mlvjaWTNehRVuBkyywkYS03fyXhCGEsPON5mAVxtwIDTrvFmIUEB1O6GquI8rUjt 48Mg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d3si1167223pla.399.2019.03.02.10.52.37; Sat, 02 Mar 2019 10:52:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726851AbfCBSwS (ORCPT + 99 others); Sat, 2 Mar 2019 13:52:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36574 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726648AbfCBSwR (ORCPT ); Sat, 2 Mar 2019 13:52:17 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9C5D4307CEB2; Sat, 2 Mar 2019 18:51:47 +0000 (UTC) Received: from sky.random (ovpn-121-1.rdu2.redhat.com [10.10.121.1]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 220315D70A; Sat, 2 Mar 2019 18:51:45 +0000 (UTC) Date: Sat, 2 Mar 2019 13:51:44 -0500 From: Andrea Arcangeli To: Jan Stancek Cc: linux-mm@kvack.org, akpm@linux-foundation.org, willy@infradead.org, peterz@infradead.org, riel@surriel.com, mhocko@suse.com, ying.huang@intel.com, jrdr.linux@gmail.com, jglisse@redhat.com, aneesh.kumar@linux.ibm.com, david@redhat.com, raquini@redhat.com, rientjes@google.com, kirill@shutemov.name, mgorman@techsingularity.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mm/memory.c: do_fault: avoid usage of stale vm_area_struct Message-ID: <20190302185144.GD31083@redhat.com> References: <20190302171043.GP11592@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Sat, 02 Mar 2019 18:51:47 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Jan, On Sat, Mar 02, 2019 at 07:19:39PM +0100, Jan Stancek wrote: > + struct mm_struct *vm_mm = READ_ONCE(vma->vm_mm); The vma->vm_mm cannot change under gcc there, so no need of READ_ONCE. The release of mmap_sem has release semantics so the vma->vm_mm access cannot be reordered after up_read(mmap_sem) either. Other than the above detail: Reviewed-by: Andrea Arcangeli Thanks, Andrea