Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1305559ybl; Wed, 14 Aug 2019 14:31:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXwjnu09eYgD2OEVP1pO+ZaZq5/3SXzFVhgoTlyy0Q5Gst+7aVxC4pr2wb/vRLg8G2aLPF X-Received: by 2002:a17:902:b413:: with SMTP id x19mr1341252plr.121.1565818311423; Wed, 14 Aug 2019 14:31:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565818311; cv=none; d=google.com; s=arc-20160816; b=JgGoEUr7Z4z53CBUFwgGk2ZL+TKuvG13dxt6Yn4L6g2Qf/mQBod1nxps3C9pp6EBtl LjIt4GHUTIXih8m3QESl0TiNLtmFG5bpntrigJko8OrcCvUghfA9KTNNC2B3/+bSFxBB phfKiCQ7kDcAwl3fwz7SZuDwDqf2kqQt3CgCXidabxK5muxLwaVUz34ro0Px1YZyq9iE Sr1rutsEVynGe0FIKlLZLk71nEY43ljzO4anT5Wv94LSJ0SFYiyoka9aYwF/E8kqNtaM gBEYFcOGO/6Phm3PC8hfgzvNos6oV4klgd5LZnMyOv2vAr/rybbNYUuoXxf/DOQ8Exha taJA== 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=l693Dsnz2cNYZkVUIa0hGWj4gZqviofo6oB5vcHDRgE=; b=qhGO3TGv4oTHEbE+CyVi3OsXw/tWomEweDV/H8Tmv4/B+/UMtjq96/nlQyDR+M56Fy ppNu0TNAJIn1Kh5s0rX3oTTqT+nIooULMMIHa73zMATIdg6M3pGJAimNvY3eo6KGbwQ7 H/pAjgMoqx67mD47eKcC1z/gNISV9OnjraSlMx+ocUBtiRJHbdVD0NunbsyCsWKoQ4Vf uPhSefKrklNQZOCAEk0BP57IHqTVI+8iGydNG1s+nT+oWhKnhOYRPk7npRSDOCZgbyDs H9wCvNKp9wEZLxq2E9NsY5p1U9QzrRlbClaX+e+R1pv/KA9vW5KYcKRWxW6NAi1AmqQG DnnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=R5LCsQ2R; 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 i18si528560pfa.23.2019.08.14.14.31.34; Wed, 14 Aug 2019 14:31:51 -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=R5LCsQ2R; 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 S1729112AbfHNUO1 (ORCPT + 99 others); Wed, 14 Aug 2019 16:14:27 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:5567 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726865AbfHNUO1 (ORCPT ); Wed, 14 Aug 2019 16:14:27 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Wed, 14 Aug 2019 13:14:28 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Wed, 14 Aug 2019 13:14:26 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Wed, 14 Aug 2019 13:14:26 -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 20:14:24 +0000 Subject: Re: [PATCH v3 hmm 01/11] mm/mmu_notifiers: hoist do_mmu_notifier_register down_write to the caller 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 , Christoph Hellwig References: <20190806231548.25242-1-jgg@ziepe.ca> <20190806231548.25242-2-jgg@ziepe.ca> X-Nvconfidentiality: public From: Ralph Campbell Message-ID: <1391be01-932c-68ca-0160-e08ed2a0243d@nvidia.com> Date: Wed, 14 Aug 2019 13:14:24 -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-2-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=1565813668; bh=l693Dsnz2cNYZkVUIa0hGWj4gZqviofo6oB5vcHDRgE=; h=X-PGP-Universal:Subject:To:CC:References:X-Nvconfidentiality:From: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=R5LCsQ2RGYP/aRbOOTYVqp3+mNbaFthG3djuEbE/Q5RcS9mR/XTArigIkLJIJcoUm 2K4ojNSONT0DPE3p48KuDCnr8/b/xkcFIsjgMnEh2A4XHosGTEQqAsOIgDIYpKjhA6 rkPNvw30YaNhLDpHwnvQ22Rq+l1U9m2Nr7cxGupNe9zheNvIiYxkmouASaeFKHn1Ne hfrZ3XyWn84qlbZhdg2Z+7hrQwZnGR5tn9y+gosmO+PTqodnJTwNCIDxM/tYLWvgwz yiPA4kvRNQ0JR0eN4UhFvOmVWdRm65jh/bJrrdWl3KFGl5AiupxGl6Jnjo5KFXd1mW QlJuphdrdgDvw== 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 simplifies the code to not have so many one line functions and extra > logic. __mmu_notifier_register() simply becomes the entry point to > register the notifier, and the other one calls it under lock. > > Also add a lockdep_assert to check that the callers are holding the lock > as expected. > > Suggested-by: Christoph Hellwig > Signed-off-by: Jason Gunthorpe Nice clean up. Reviewed-by: Ralph Campbell