Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1388170ybl; Wed, 14 Aug 2019 16:16:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqyi4S5oRBSmxPtxJFaQ728WokbXJ64AR1V4LVLdzMxebqxcNXRobiKpbyrO4KIfPqarIn9R X-Received: by 2002:a63:e5a:: with SMTP id 26mr1229890pgo.3.1565824599021; Wed, 14 Aug 2019 16:16:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565824599; cv=none; d=google.com; s=arc-20160816; b=IviFuMGaL5N+yuorz3pdaztT2+Y2+tGYeki75e/Wo+jtE+84TYb1VjabtOzAD+Qfha PBuloXk7KE2eSBMObf87EyGioX1pbYg6duCdxECsrNIe6SjWAdVZVlfvM8Uzpe/op9W+ Mo3xk1WAW++u5fECa9VugudOqkMUnK1umjgixb+j87Ydy06pNadjLMPlV2EM7l6sKIMy tIEExKEj26rkS/aMlMEFnNbXnqxgMx3nWNPgT42sQU7AohT35s2sOoFz7eFBcxYf0+hr GXl4Dnq90kLHpRm7S93lekiv0lZuaSOqVB+kxO8P9uX1/Pb/GzXVr0l9e/5mUVSXIMre q2MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=P9RT5vwQ9P2MNi7AtBxwKiWdi93Rh+sGeCthaUvRAGA=; b=ND6yNDWRP33zGWnuAY1ykwZKfcyGG+GBN3/IWReJIlysQZN4ghrbMwpDrsbixA4Bn4 k0bJc5oHK3W+za6/Tld9ov0ec/pkj4NydbShtEN8GE72mXby+TiDLy0d6IcxE+dzMF3M UmebnHYS7YW2s/FWfFTiPnrZUIWk1OYFjtXLb07kWZR+8N5AUqu4sMdqq4PwKv9XHVCB 4xkKHg6F7rvBkHsrnxJd4AyuEJXyqder1VKuCF2WZ/k2mikeq4Kklrglmk8Jtt/beDEa OhT2HXrLlOQVF73s1iydstLwe8wyeE0ZmtNMeknUXt/RqE8JZryBZZo0PX8guybNCsXp EgHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=KJ6GRRsA; 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=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f4si761153plb.38.2019.08.14.16.16.23; Wed, 14 Aug 2019 16:16:39 -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; dkim=pass header.i=@nvidia.com header.s=n1 header.b=KJ6GRRsA; 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=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729601AbfHNVvK (ORCPT + 99 others); Wed, 14 Aug 2019 17:51:10 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:11034 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729091AbfHNVvK (ORCPT ); Wed, 14 Aug 2019 17:51:10 -0400 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Wed, 14 Aug 2019 14:51:11 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Wed, 14 Aug 2019 14:51:09 -0700 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Wed, 14 Aug 2019 14:51:09 -0700 Received: from rcampbell-dev.nvidia.com (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 14 Aug 2019 21:51:02 +0000 Subject: Re: [PATCH v3 hmm 05/11] hmm: use mmu_notifier_get/put for 'struct hmm' To: Jason Gunthorpe , CC: Andrea Arcangeli , Christoph Hellwig , John Hubbard , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , "Kuehling, Felix" , "Alex Deucher" , =?UTF-8?Q?Christian_K=c3=b6nig?= , "David (ChunMing) Zhou" , Dimitri Sivanich , , , , , , , Gavin Shan , Andrea Righi , Jason Gunthorpe References: <20190806231548.25242-1-jgg@ziepe.ca> <20190806231548.25242-6-jgg@ziepe.ca> From: Ralph Campbell X-Nvconfidentiality: public Message-ID: <66053b82-18d8-217a-b8fd-91981f66f512@nvidia.com> Date: Wed, 14 Aug 2019 14:51:02 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190806231548.25242-6-jgg@ziepe.ca> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1565819471; bh=P9RT5vwQ9P2MNi7AtBxwKiWdi93Rh+sGeCthaUvRAGA=; h=X-PGP-Universal:Subject:To:CC:References:From:X-Nvconfidentiality: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=KJ6GRRsAe+RAr5rTMPCCaxloTQYWmrR/WBzP+8kr7gip16nYfBHAmUHPXlbhEEm72 FR+1qaXQZT7vWEhXvkKhupPjaHOEDSaXlGsl5ePt7QdDbrhYX1ZOOgzO3bUjs5eGS9 +3p2cWPTV3vO98Xq4pfl3VknjdwX2ZPJG9es6I7cnO7o2mLiRqWlViag4cGHvpwwm6 fRmMqyawH4eX8IYtQuk53VGwfUdLDby5fwgRdPtR6hKzhsePeybHVahWLcd8M89osz g43SKAfGSqwbLLkjdR3VJhZ4Z+aymGB3ltZywUlmcAZGnriaqzx9Dpc0q6MDtbY5EG 961klO2uRvQ9A== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/6/19 4:15 PM, Jason Gunthorpe wrote: > From: Jason Gunthorpe > > This is a significant simplification, it eliminates all the remaining > 'hmm' stuff in mm_struct, eliminates krefing along the critical notifier > paths, and takes away all the ugly locking and abuse of page_table_lock. > > mmu_notifier_get() provides the single struct hmm per struct mm which > eliminates mm->hmm. > > It also directly guarantees that no mmu_notifier op callback is callable > while concurrent free is possible, this eliminates all the krefs inside > the mmu_notifier callbacks. > > The remaining krefs in the range code were overly cautious, drivers are > already not permitted to free the mirror while a range exists. > > Signed-off-by: Jason Gunthorpe Looks good. Reviewed-by: Ralph Campbell