Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2182522ybm; Thu, 23 May 2019 12:43:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxKe3RIMS4qt6T9PgIuD+y1JcfSdD8smbjWDdbrDgTmlf/HbUWfIHau66lYEg0leW4EVkPq X-Received: by 2002:a17:902:201:: with SMTP id 1mr55691062plc.263.1558640598567; Thu, 23 May 2019 12:43:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558640598; cv=none; d=google.com; s=arc-20160816; b=d8QHggPP0XxGBe+MCtdQUCUFthsKLSO4pwHWC5IyB2Fxka3ST0QJVk7wvzB8PW6SRX 7OPKQiqQ3yBNcCnGo6hnC/xWMimO9aUJkbsvIrDkJsgeDtzKOvLAGqdwyy882VwAUtgh amWvS+CKS+Qq/kikiYOkAPptpWSc6yXoV+MG1nYR1sLoAKeHx58E5+xirjNL1W8mFFWr SJ184gRDz4ZNBSKcLki5Fg2ny2zFkAX1ALSzCTyQsIocGOJ6RvOoGYX1mTkO+NQrFQmF svyB8PjIpL2mQs/ZQShPvVsnixDhCPykPiRF3tQqLdbzyoUt2WwdKvTYky3PfwzwuJEV Di7g== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Fi7p5p+9Nk4FHS4jmY84B9aBKyPNKxal1CnrzIqa/D0=; b=gaSNAdcyO3NlnJbWbxiJHtVWF7gK4CWCKrfqMnQOXIdDO7SegeBOLBzvD33kuozvAb udWR1IdWArYEDzHcvrrE3KDGCqjzEq2yKUFBnYiQaDUr7kNH0akNkk+GXj1RagLpBZfs CONyVuDq2NION46ILQxaB5KIkSw127Y33szDd0NwC9DBNRAgkXZpEMmg3+X0uak/IaGX KuHhepXM6FCiBitjJVaCKzHWCtuf2NoKnr8b3IqHjbPFIUIl4bdH8kuVL6iIxBw4pHWW gYvE+/EMM0RDvbDotEdf9cvb4PWRucujTfDVC4OIZWidcA2VYitnk4MiFqiz3bM5wKLF IV2w== 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 v30si356657pfi.148.2019.05.23.12.43.03; Thu, 23 May 2019 12:43:18 -0700 (PDT) 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 S2390819AbfEWTkF (ORCPT + 99 others); Thu, 23 May 2019 15:40:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53712 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390281AbfEWTkD (ORCPT ); Thu, 23 May 2019 15:40:03 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 356F988E63; Thu, 23 May 2019 19:40:02 +0000 (UTC) Received: from redhat.com (unknown [10.20.6.178]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4820A60BF3; Thu, 23 May 2019 19:40:01 +0000 (UTC) Date: Thu, 23 May 2019 15:39:59 -0400 From: Jerome Glisse To: Jason Gunthorpe Cc: linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Leon Romanovsky , Doug Ledford , Artemy Kovalyov , Moni Shoua , Mike Marciniszyn , Kaike Wan , Dennis Dalessandro Subject: Re: [PATCH v4 0/1] Use HMM for ODP v4 Message-ID: <20190523193959.GA5658@redhat.com> References: <20190522174852.GA23038@redhat.com> <20190522235737.GD15389@ziepe.ca> <20190523150432.GA5104@redhat.com> <20190523154149.GB12159@ziepe.ca> <20190523155207.GC5104@redhat.com> <20190523163429.GC12159@ziepe.ca> <20190523173302.GD5104@redhat.com> <20190523175546.GE12159@ziepe.ca> <20190523182458.GA3571@redhat.com> <20190523191038.GG12159@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190523191038.GG12159@ziepe.ca> User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 23 May 2019 19:40:02 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 23, 2019 at 04:10:38PM -0300, Jason Gunthorpe wrote: > > On Thu, May 23, 2019 at 02:24:58PM -0400, Jerome Glisse wrote: > > I can not take mmap_sem in range_register, the READ_ONCE is fine and > > they are no race as we do take a reference on the hmm struct thus > > Of course there are use after free races with a READ_ONCE scheme, I > shouldn't have to explain this. Well i can not think of anything again here the mm->hmm can not change while driver is calling hmm_range_register() so if you want i can remove the READ_ONCE() this does not change anything. > If you cannot take the read mmap sem (why not?), then please use my > version and push the update to the driver through -mm.. Please see previous threads on why it was a failure. Cheers, J?r?me